How to use this index
This page is a map. Curriculum splits classics into occupancy & quotas, booking & inventory, games, and logger & filesystem — same themes as below.
- Pick one deep dive from the practice order (don’t randomize).
- Timer 35 minutes: clarify → model → code mutation → race.
- Only then open
complete-solution/concurrency-cases. - Hubs (parking/limiter/elevator etc.) are optional revision packs.
Every classic deep dive
01Core
Lot · Lift · Limiter
02Commerce
Tickets · Stock · Locker · Library
03Systems
FS · Logs · Games
04Cadence
One classic / day × 35 min
This hub is the index, not a second textbook. Pick a deep dive, lock a 35-minute timer, talk out loud.
- Parking lot — Spots, tickets, fee in cents, typed occupancy. (Core) · complete solution
- Rate limiter — Factory + Strategy; Token Bucket + Sliding Window Log. (Core) · complete solution
- Elevator — step() simulation, SCAN, hall vs destination requests. (Core) · complete solution
- BookMyShow — City→Cinema→Show, AVAILABLE→LOCKED→BOOKED, payment stub. (Commerce) · complete solution
- Movie ticket booking — Search/browse + showtime seat state; holds as extension. (Commerce) · complete solution
- Inventory management — Multi-warehouse stock, transfers, Observer low-stock. (Commerce) · complete solution
- Amazon Locker — Deposit/pickup tokens, bay assignment, staff reclaim. (Commerce) · complete solution
- Book library — Book vs BookItem, checkout/return, fines, reservation queue. (Commerce) · complete solution
- In-memory filesystem — Entries, path helpers, move + cycle detection. (Systems) · complete solution
- Logger — LogRecord → Destination = Formatter × Sink. (Systems) · complete solution
- Connect Four — Game/Board/Player, direction-vector wins, BotEngine. (Systems) · complete solution
- Tic Tac Toe — 3×3, eight win lines, draw-before-mislabel. (Systems) · complete solution
- Chess game — Piece polymorphism, pseudo-legal vs legal, check/mate. (Systems) · complete solution
Order to practice
Don’t shuffle randomly. Build muscles in this order so each classic reuses the previous narration skeleton.
- Week spine — Core. Parking → Rate limiter → Elevator. Occupancy → quotas → simulation.
- Commerce week. Movie booking → BookMyShow → Inventory → Locker → Library. All share FREE → HELD(TTL) → COMMITTED.
- Systems week. Filesystem → Logger → Tic Tac Toe → Connect Four → Chess (stretch).
- Always open with delivery framework for the 35-minute talk track.
Concurrency note per classic
Volunteer one concurrency sentence before they ask. Link back to concurrency basics → correctness when you need the toolkit.
- Parking lot — One lot lock around enter/exit — last-spot race is the classic poke. (solution · concurrency when present)
- Rate limiter — Per-key lock on refill+consume; never one global lock for all keys. (solution · concurrency when present)
- Elevator — Enqueue requests under a lock; step() owns the car state single-threaded. (solution · concurrency when present)
- BookMyShow — Seat hold must be atomic + TTL; two bookers on one seat = one win. (solution · concurrency when present)
- Movie ticket booking — Same scarce-seat race as BookMyShow — name the claim/commit/release path. (solution · concurrency when present)
- Inventory management — Atomic reserve/transfer so stock never goes negative under two writers. (solution · concurrency when present)
- Amazon Locker — Assign bay under lock; expired reclaim vs pickup race needs clear owner. (solution · concurrency when present)
- Book library — Checkout last copy + reservation queue — serialize claim of a BookItem. (solution · concurrency when present)
- In-memory filesystem — Tree lock (or ordered path locks) on mutate; move must not race mkdir. (solution · concurrency when present)
- Logger — Per-destination (or per-sink) lock; don’t hold while formatting if async. (solution · concurrency when present)
- Connect Four — Usually single-player turn lock; if dual clients, serialize makeMove on Game. (solution · concurrency when present)
- Tic Tac Toe — Turn ownership is the race — reject move if not your turn under one lock. (solution · concurrency when present)
- Chess game — Same as games: one move at a time; clock/timer is a separate actor if asked. (solution · concurrency when present)