Mini Problem Solving: Practice Questions
100 questions. Try each one yourself before checking the answer.
Short on time? Filter by Must Do for the 25 questions that cover this topic on their own.
Model one student as a dictionary, with validation in a single place.
Model the same record as a class, and see what that buys.
Handle money without losing paise to floating point.
Turn marks into a grade, a percentage and a verdict.
Convert user text into numbers without crashing.
Replace a chain of if statements with a dictionary.
Count occurrences and report the leaders.
Group records by a field.
Sort records by one field, then by several.
Find records that match, and handle "not found" properly.
Combine filters without writing one function per combination.
Summarise a set of records.
Print a table that lines up, with headers and a total row.
Drive a menu from a dictionary of functions.
Validate a form against a table of rules.
Store and use dates inside records.
Save records to a file and load them back.
Read and write records as CSV, with types restored.
Generate identifiers that do not collide.
Keep a history so an action can be undone.
Show a long list one page at a time.
Draw a bar chart in the terminal.
Make an interactive program run the same way every time.
Give the program its own error types.
Assemble the building blocks into one small working program.
Build the four operations every record store needs: create, read, update, delete.
Move money between accounts, keeping a history and never losing a rupee.
Build a cart with quantities, discounts and a printed bill.
Turn an attendance register into a percentage report.
Score a quiz against an answer key, with negative marking and a breakdown.
Implement login attempts with a lockout, without storing plain passwords.
Issue and return books, enforcing limits and charging fines.
Compare spending against a budget and report the variance.
Merge duplicate contacts without losing information.
Decide what to reorder and how much.
Book seats from a seat map, keeping groups together.
Scale a recipe and convert its units sensibly.
Split a bill fairly, including a tip, with every paisa accounted for.
Rank players, handling ties the way a scoreboard should.
Produce a word-frequency report from a text file.
Model an order's lifecycle so invalid transitions cannot happen.
Charge by tier, where each band is priced differently.
Export the same report to text, CSV and JSON.
Search records and rank the matches by relevance.
Import a batch of rows, accepting the good ones and reporting the rest.
Build settings from defaults, a file, the environment and the command line.
Record who did what, using a decorator so no call can be missed.
Cache an expensive lookup, and know when to clear it.
Retry a flaky operation with a backoff, and know when to give up.
Write a tiny test harness and use it on the functions you have built.
Build a complete menu-driven To-Do Manager with storage.
Build an ATM with a PIN, denominations and a receipt.
Build a Quiz Runner that asks questions, keeps score and reviews mistakes.
Build an Expense Tracker with categories, months and a summary.
Build a Contact Book with search, edit and export.
Build an Inventory System with stock movements and valuation.
Build an Appointment Booker with slots, clashes and cancellations.
Build a Payroll Run with allowances, deductions and payslips.
Build a Voting System with candidates, validation and a result.
Build a Parking Lot with levels, ticketing and charges.
Build a Recipe Manager with search by ingredient and a shopping list.
Build a Fitness Log with goals, streaks and weekly summaries.
Build a Support Ticket Queue with priorities, assignment and SLAs.
Build a Flashcard Trainer with spaced repetition.
Build a Restaurant Order System with a kitchen queue and a bill.
Build a Version-Controlled Notes store with history and diffs.
Build a Currency Converter with rates, cross-rates and a history.
Build a Poll and Survey tool with several question types.
Build a Password Manager with generation, strength scoring and storage.
Build a Train Booking system with seats, fares and cancellations.
This bank transfer sometimes loses money. Find the bug.
BALANCES = {"asha": 5000, "raj": 3000}
def transfer(source, target, amount):
BALANCES[source] -= amount
if amount > 20000:
raise ValueError("transfer limit exceeded")
BALANCES[target] += amount
try:
transfer("asha", "raj", 50000)
except ValueError:
pass
print(BALANCES, sum(BALANCES.values()))A shared default argument makes separate records share state.
A shallow copy is not enough for a nested record.
Watch a total drift when money is stored as a float.
Removing items while looping skips some of them.
Two parts of a program end up sharing one object by accident.
A bare except hides the bug you are looking for.
A lookup written as a scan gets slower as the data grows.
datetime.now() inside the logic makes a program untestable and wrong at midnight.
Two parallel lists that must stay in step will eventually not.
Percentages that should add to 100 do not.
A function that grew too many flags is telling you to split it.
Validating in the wrong place lets bad data in through the side door.
Choosing the wrong dictionary key merges records that should be separate.
Watch a small script turn into an unmaintainable one, and refactor it back.
Build a complete Student Management System.
Build a complete Bank with accounts, statements and interest.
Build a complete Library System with members, loans, reservations and fines.
Build a complete Expense Manager with budgets, recurring items and a forecast.
Build a complete Quiz Platform with question banks, sessions and analytics.
Build a complete Inventory & Billing system for a small shop.
Build a complete Hotel Booking system with rooms, rates and occupancy.
Build a complete Fleet & Delivery tracker with routes and status.
Build a complete Personal Finance Dashboard combining several systems.
Build a complete Event Management system with tickets, capacity and refunds.
Choose the right data structure for a record, and defend the choice.
Explain where validation, business rules and formatting belong, and why.
Design the error-handling strategy for a whole program.
Take a working but poor program and refactor it, explaining each step.
Build a Coaching Institute Management System โ the complete demonstration of this topic. Model students, courses, enrolments, fees, attendance and results, with validation, storage, reports and a menu.
Still stuck on something?
Book a free 1-on-1 session and we'll work through it together.
Book a Free Session