Understanding Your Current Programming Foundation
This isn't a test - it's a conversation to identify what you know well and what needs reinforcement.
Important: Be honest!
Design the solution before writing any code.
Scenario: A library needs a system to calculate late fees for overdue books.
Rules:
Your Task: Design the solution using either a flowchart OR pseudocode (your choice). Don't write Python code yet!
Read and analyze this pseudocode.
FUNCTION calculate_discount(purchase_amount, is_member)
discount = 0
IF is_member = TRUE THEN
IF purchase_amount >= 100 THEN
discount = purchase_amount * 0.20
ELSE IF purchase_amount >= 50 THEN
discount = purchase_amount * 0.10
ELSE
discount = purchase_amount * 0.05
END IF
ELSE
IF purchase_amount >= 100 THEN
discount = purchase_amount * 0.10
END IF
END IF
RETURN discount
END FUNCTION
For each scenario, choose the best data structure and explain why.
You need to store student names in a class roster. You'll frequently check if a student exists in the class.
Options: List, Set, Dictionary
Your choice: __________
Why? __________
You're implementing an "undo" feature in a text editor. The most recent action should be undone first.
Options: List, Stack, Queue
Your choice: __________
Why? __________
Managing a printer queue where documents print in the order they were submitted.
Options: List, Stack, Queue
Your choice: __________
Why? __________
Storing student records where you need to quickly look up a student by their ID number.
Options: List, Dictionary, Set
Your choice: __________
Why? __________
Answer these questions about Python data types:
What's the difference between an integer and a float? Give examples.
When would you use a string vs a character?
What's a Boolean? Give me an example of when you'd use one in your code.
What happens if you try to add a string and an integer in Python? (e.g., "hello" + 5)
Do you know what LIFO and FIFO mean? Where are they used?
Have you heard of Waterfall and Agile methodologies?
If yes: Can you explain the difference?
Can you explain the difference between:
Give examples if you can!
How do you test if your code works? What's your process?
What debugging tools have you used? (e.g., print statements, breakpoints, VSCode debugger, etc.)
What's the difference between a class and an object?
Can you give me a real-world example? (e.g., "Car" class vs actual cars)
Have you written classes in Python before?
If yes: What did you create?
If no: That's okay - we'll learn together!
Do you know what these terms mean?
Why would you use OOP instead of just writing functions?
Analyze this Python class:
class BankAccount:
def __init__(self, account_number, balance=0):
self.account_number = account_number
self.balance = balance
def deposit(self, amount):
if amount > 0:
self.balance += amount
return True
return False
def withdraw(self, amount):
if amount > 0 and amount <= self.balance:
self.balance -= amount
return True
return False
def get_balance(self):
return self.balance
__init__ do?)account = BankAccount('12345', 100) - what have I created?