Low-Level Design
Object-oriented design rounds reward clean abstractions, clear responsibilities and extensibility. Learn the approach, then practice on the classic problems.
Foundations
- Introduction — What LLD rounds look like and a 5-step approach that works for every problem.
- OOP & SOLID — Encapsulation, composition over inheritance and the five SOLID principles.
- Design Patterns — The handful of patterns that actually show up: Strategy, Factory, Observer, State and more.
- Class Modeling — From a vague prompt to entities, relationships, enums and a quick class diagram.
- Concurrency & Thread Safety — Race conditions, locks, condition variables, lock granularity and avoiding deadlock.
- The Machine-Coding Round — Runnable code in 90 minutes: time plan, code structure, quick tests and extensions.
- Handling Extension Follow-Ups — Classifying "now add X" changes, where each one plugs in, and refactoring calmly when it doesn't.
Problem Walkthroughs
- Design a Parking Lot — Entities, spot allocation strategies, tickets and pricing.
- Design an LRU Cache — Hash map + doubly linked list, with O(1) get/put and thread safety.
- Design an Elevator System — States, request dispatching and pluggable scheduling strategies.
- Design a Vending Machine — The State pattern, integer money, change-making and all-or-nothing sales.
- Design Tic-Tac-Toe — Board games skeleton, O(1) win detection and generalizing to N×N and other games.
- Design a Text Editor (Undo/Redo) — The Command pattern, undo/redo stacks, grouping edits and gap buffers vs ropes.
- Implement a Rate Limiter Class — Pluggable token bucket and sliding window limiters with an injected clock and locks.
- Design Splitwise — Split strategies, cent rounding, net balances and simplifying debts.
- Design Movie Ticket Booking — Show seats, expiring holds, all-or-nothing seat claims and per-show locking.
- Design an In-Memory File System — The Composite pattern, path resolution, move/remove edge cases and composable search.
- Design an In-Memory Pub/Sub Broker — Per-subscriber queues, ordering, backpressure, retries, dead letters and replay.
- Design a Spreadsheet — Formulas as a dependency graph: cycle detection, topological recalculation and parsing.
- Design a Stock Order Book — Price-time priority, partial fills, lazy cancels and the invariants trading firms check.
- Design a Task Scheduler — A run-time heap, a dispatcher that sleeps until due, worker pools, cancels and recurrence.
- Design an ATM & Digital Wallet — Atomic transfers, idempotency keys, double-entry ledgers, ATM states and dispensing cash.
- Design Ride-Hailing Matching — Ride lifecycles, pluggable matching strategies and preventing double assignment.
- Design a Discount Engine — Composable conditions and effects, stacking order, rounding and exclusive promotions.
- Design a Logging Framework — Loggers, handlers and formatters, level inheritance, propagation and thread safety.
- Design a Notification Service — Channels, preferences, templates, retries with backoff and idempotent delivery.
- Design a Circuit Breaker — A closed, open and half-open state machine with failure-rate windows, trial calls and a fake clock.
- Design an HTTP Router — A segment trie with static, parameter and wildcard precedence, 404 vs 405, and middleware.
- Design a Library & Car Rental System — Title vs copy, loans, holds and fines, and date-range availability for reservations.