~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
Object-oriented design and extensible simulations
Classes that survive new requirements: games, payments, subscriptions, refactors.
Notes
Recognise it when: you implement a small domain (game, payments, ordering, subscriptions, battle system) where every level adds requirements, or you refactor messy code.
- Nouns become classes and verbs become methods. Keep state where the behaviour is.
- Extension points: strategy objects or registries (
handlers[type] = fn) instead of growingif/elifchains. New requirements should add code, not edit everything. - Invariants live in one place (e.g. a balance never goes negative). Validate inputs at the boundary.
- Refactor rounds: add tests around the current behaviour first. Then extract functions, remove duplication, and replace flags with polymorphism, keeping behaviour identical.
- Talk as you go: interviewers grade the trade-offs you say out loud (why a dataclass, why an enum, how you'd add feature X next).
Gotchas: over-engineering before requirements arrive, shared mutable defaults (def f(x=[])), and equality/hashing of domain objects.
31 problems
Practical systems
Simulation & OOP design Model the rules precisely, keep it extensible.
Object-oriented design and extensible simulations
- Basics: a bank account class with invariants basics easy
- Greenhouse watering rota easy
- OA: Recipe manager with versions 4 levels Anthropic medium
- OA: Task manager with quotas and history 5 levels Anthropic py · c++ · java medium
- OA: Dasher pay from an event stream 3 levels DoorDash medium
- OA: Debug the dasher picker, then hash-ring it 2 levels DoorDash medium
- Chat bot system refactor 4 levels OpenAI medium
- Monster team battle 3 levels OpenAI easy
- Hot-air balloon festival stability tracker Optiver py · c++ · java medium
- News subscriptions with rate limits Optiver hard
- PowerBank racks and cells 3 levels Optiver py · c++ · java hard
- Squirrel nut storage tracker 3 levels Optiver medium
- OA: Retriable function 3 levels Airbnb medium
- OA: Crypto trading system 2 levels Coinbase medium
- OA: Crypto order management system 2 levels Coinbase py · c++ · java medium
- OA: Transaction query filters and pagination 3 levels CoinbaseLyft medium
- OA: Food delivery system 2 levels Coinbase easy
- OA: Dual circuit breakers 2 levels Databricks medium
- OA: Lazy array with deferred maps 2 levels Databricks medium
- OA: Referral Credit Tracker 2 levels DatabricksUber py · c++ · java medium
- OA: K-in-a-row with validation and undo 2 levels Databricks medium
- OA: Object Field Offset Manager 3 levels Jane Street medium
- Note-taking system with timestamps and search 2 levels easy
- OA: Deal, sort and play tricks 2 levels OpenAIScale AI medium
- OA: Three-card game 2 levels OpenAI easy
- OA: Design access system 2 levels Pinterest py · c++ · java medium
- Follow graph with snapshots and recommendations 4 levels OpenAI medium
- OA: Text editor with a clipboard, undo and several documents 4 levels py · c++ · java hard
- OA: File finder with saved, combinable search rules 4 levels py · c++ · java medium
- OA: Parking garage with fees and reservations 3 levels py · c++ · java medium
- OA: Shop inventory with timed holds and backorders 4 levels py · c++ · java hard