Level 7 of 7 · about 4 weeks
Case studies II: more LLD questions
Ten more full designs run through the five-step method: LRU cache, rate limiter, logger, elevator, movie ticket booking, Splitwise, cab booking, food ordering, publish-subscribe and an in-memory file system.
Modules
Core: everyone needs it. Common: most jobs use it. Specialist: optional depth, safe to skip on a first read.
1
LRU cache
Constant-time get and put with a map and a linked list, then policies and threads
Core 6 parts · about 4 hours
2
Rate limiter in code
Four algorithms behind one interface, with time under the test's control
Core 6 parts · about 4 hours
3
Logger
Levels, named loggers, appenders and an async queue that never slows the caller
Core 6 parts · about 4 hours
4
Elevator system
One car as a small state machine, many cars behind a dispatcher
Core 6 parts · about 4 hours
5
Movie ticket booking
Seats, timed holds, all-or-nothing booking and no double sales
Core 6 parts · about 4 hours
6
Splitwise (shared expenses)
Split rules, a net balance per person, and fewer payments to settle up
Core 6 parts · about 4 hours
7
Cab booking
Matching riders to drivers, a trip state machine and no double assignment
Core 6 parts · about 4 hours
8
Food ordering
Menu, cart, stock, an order state machine and listeners for each change
Core 6 parts · about 4 hours
9
Publish-subscribe system
Topics as logs, consumers with offsets, retries and a dead list
Core 6 parts · about 4 hours
10
In-memory file system
A tree of files and folders, path parsing, move and find
Core 6 parts · about 4 hours