LLD Real Problems
18 problems, from Parking Lot to LRU Cache and Pub/Sub — with production-style Java.
Every LLD problem in this phase is solved with the same method: requirements → entities → responsibilities → relationships → interfaces → SOLID → patterns → extensibility → concurrency → code → tests.
Discipline: solve the problem yourself before reading the code here. The code is a checkpoint, not a cheat sheet.
Level 1
Problem 4.1 — Parking Lot
Level 1The canonical LLD problem. It exercises composition, the Factory pattern, pricing strategies, ticketing, and concurrency around spot assignment.
14 min 1 code practice
Problem 4.2 — Vending Machine
Level 1The classic State-pattern problem: same actions behave differently depending on idle/has-money/dispensing states.
10 min 1 diagram 1 code practice
Problem 4.3 — ATM
Level 1State + transaction handling + cash management + authentication. Districts it from vending machine with authentication, session and ledger concerns.
8 min 1 code practice
Problem 4.4 — Library Management
Level 1Entities, borrow/return flows, fine calculation and search — the 'clean CRUD with rules' LLD problem.
8 min 1 code practice
Level 2
Problem 4.5 — Elevator
Level 2State + scheduling + concurrency + request handling. The harder LLD: multiple elevators moving between floors with internal and external requests.
14 min 1 diagram 1 code practice
Problem 4.6 — Splitwise
Level 2Expense splitting with strategies and settlement math — exactly one map of balances and a strategy per split rule.
7 min 1 code practice
Problem 4.7 — Tic-Tac-Toe
Level 2A tight game-engine problem where strategy, board state, players and win-checking must stay decoupled and extensible.
9 min 1 code practice
Problem 4.8 — Chess
Level 2The inheritance-vs-composition battle ground: piece movement, game state, rules, castling, check/checkmate.
9 min 1 code practice
Level 3
Problem 4.9 — BookMyShow (Ticket Booking)
Level 3Seat locking, show/seat modeling, pricing by category, and the invalidation of stale holds — a Level-3 problem that combines LLD and concurrency.
8 min 1 diagram 1 code practice
Problem 4.10 — Food Delivery (LLD)
Level 3Order lifecycle state machine + delivery-partner matching + notifications — the LLD version of the classic HLD.
7 min 1 code practice
Problem 4.11 — Ride Booking (LLD)
Level 3Driver/rider matching, pricing (surge), trip lifecycle and the 'find nearest available driver' core.
7 min 1 code practice
Problem 4.12 — Notification System (LLD)
Level 3The factory + strategy + observer showcase: channels, templates, fan-out and retries.
8 min 1 code practice
Problem 4.13 — Payment System (LLD)
Level 3Where correctness is non-negotiable: payment states, idempotency keys, double-charge prevention, and the integration-seam problem.
8 min 1 diagram 1 code practice
Problem 4.14 — File Storage System (LLD)
Level 3Storage abstraction, naming, chunking metadata, and access control — the LLD core under Dropbox/Drive HLDs.
8 min 1 code practice
Problem 4.15 — Rate Limiter (LLD)
Level 3The bridge problem between LLD and HLD: algorithms, concurrency-safe counters, and where Redis takes over. Revisit it in Phase 12 for the distributed version.
13 min 1 code practice
Problem 4.16 — LRU Cache
Level 3The most-asked LLD warm-up: `get` and `put` in O(1) with least-recently-used eviction, built from a hash map plus a doubly linked list, then made thread-safe and generic.
8 min 1 code practice
Problem 4.17 — Logging Framework
Level 3Design a mini SLF4J/Logback: log levels, multiple appenders (console, file, remote), formatters, per-logger configuration, and asynchronous writing that never blocks the application.
8 min 1 code practice
Problem 4.18 — In-Memory Pub/Sub System
Level 3Topics, publishers, and subscribers in one process: fan-out delivery, per-subscriber ordering, slow-consumer isolation, and offsets for replay, a small model of Kafka and Redis Pub/Sub.
8 min 1 code practice