LLD Case Studies in Low-Level Design
Lessons in this section
- Parking Lot
Design a parking lot: spot sizes, the smallest spot that fits, tickets and fees, then build it against a hidden test suite.
- Elevator
Design an elevator that serves floors fairly: time in steps, a set of requests, and the elevator algorithm, tested step by step.
- LRU Cache
Build a least-recently-used cache with O(1) get and put, using a Map that remembers order, and check it against a speed test.
- Rate Limiter
Build a per-user token bucket rate limiter with lazy refill and an injectable clock, tested with a fake clock.
- Splitwise
Design an expense splitter: equal, exact and percent splits in whole rupees, net balances, and settling up with few payments.
- Library System
Design a library: copies, loans with due days and fines, a three-book limit and a fair waiting list, built against hidden tests.
- Vending Machine
Rebuild a vending machine with the State pattern: coins, change, sold-out items and refunds, with hidden tests and a design check.
- Seat Booking
Design cinema seat booking like BookMyShow: hold then confirm, expiring holds, all-or-nothing groups and a lock tested in every order.