Low-level design (LLD)
Classes, design patterns and concurrency, with 27 mock interviews and runnable code in Java, JavaScript and Python.
110 topics · 27 mock interviews · 16 chapters
Start reading
The start of every guide is free, with no sign-up.
Chapter 1
35 pagesHow the LLD round works
- What the LLD round is and what interviewers score Beginner 6 pages
- Three formats: the design talk, machine coding and concurrency coding Beginner 6 pages
- Junior, mid-level and senior answers to the same question Intermediate 6 pages
- How the round differs by company: Amazon, Google, Microsoft, Uber, Atlassian, Rubrik, Flipkart, Swiggy, PhonePe and Razorpay Beginner 6 pages
- Talking while you design: explaining classes, taking hints and defending choices Beginner 6 pages
- Red flags: what gets candidates rejected in LLD Beginner 5 pages
Chapter 2
51 pagesThe framework
- The LLD framework: six steps for every question Beginner 6 pages
- Step 1: Clarify the requirements and cut the scope Beginner 5 pages
- Step 2: Find the entities and how they relate Beginner 6 pages
- Step 3: Draw the class diagram (just enough UML) Beginner 6 pages
- Step 4: Define the interfaces and method signatures Beginner 6 pages
- Step 5: Code the core flow first Intermediate 6 pages
- Step 6: Extend it, test it and handle the edge cases Intermediate 6 pages
- The framework end to end: tic-tac-toe in 40 minutes Beginner 7 pages
- Practice: The round and the framework 3 pages
Chapter 3
57 pagesObject-oriented building blocks
- Classes, objects and the state they own Beginner 6 pages
- Encapsulation: hiding state behind methods Beginner 6 pages
- Abstraction and interfaces Beginner 6 pages
- Inheritance, and when it goes wrong Beginner 6 pages
- Polymorphism: one call, many behaviours Beginner 6 pages
- Composition over inheritance Intermediate 6 pages
- How classes relate: association, aggregation, composition and dependency Beginner 6 pages
- Enums, value objects and immutability Intermediate 6 pages
- Errors in a design: validation, exceptions and result types Intermediate 6 pages
- Practice: Object-oriented building blocks 3 pages
Chapter 4
51 pagesDesign principles
- Single responsibility and cohesion Beginner 6 pages
- Open/closed: adding features without editing old code Intermediate 6 pages
- Liskov substitution: subclasses that keep their promises Intermediate 6 pages
- Interface segregation: small, focused interfaces Intermediate 6 pages
- Dependency inversion and dependency injection Intermediate 6 pages
- Coupling and the Law of Demeter Intermediate 6 pages
- DRY, KISS and YAGNI: when simple beats clever Beginner 6 pages
- Designing for testability Intermediate 6 pages
- Practice: Design principles 3 pages
Chapter 5
66 pagesDesign patterns: creating and structuring objects
- Design patterns in the interview: how to use them, and when not to Beginner 7 pages
- Singleton, and why interviewers distrust it Beginner 7 pages
- Factory method and simple factory Beginner 7 pages
- Abstract factory Intermediate 7 pages
- Builder Beginner 7 pages
- Adapter Beginner 7 pages
- Decorator Intermediate 7 pages
- Facade and proxy Intermediate 7 pages
- Composite Intermediate 7 pages
- Practice: Creating and structuring objects 3 pages
Chapter 6
66 pagesDesign patterns: behaviour
- Strategy Beginner 7 pages
- Observer Beginner 7 pages
- State Intermediate 7 pages
- Command, and how it gives you undo Intermediate 7 pages
- Chain of responsibility Intermediate 7 pages
- Template method Beginner 7 pages
- Iterator and visitor Advanced 7 pages
- The rarer patterns in brief: prototype, bridge, flyweight, mediator and memento Intermediate 7 pages
- Telling look-alike patterns apart: strategy vs state, decorator vs proxy, factory vs builder Intermediate 7 pages
- Practice: Behaviour patterns 3 pages
Chapter 7
66 pagesModelling patterns: the moves LLD questions repeat
- Modelling a lifecycle with a state machine: orders, elevators, vending machines Intermediate 7 pages
- Allocating scarce things: spots, seats, rooms and slots Intermediate 7 pages
- Prices, fees and rules that keep changing Intermediate 7 pages
- Money, time and IDs in code: money types, injected clocks and ID generators Intermediate 7 pages
- Storing data in memory: repositories, indexes and lookups Beginner 7 pages
- Events and notifications inside one program Intermediate 7 pages
- Undo, redo and history Intermediate 7 pages
- Modelling games: boards, turns, players and rules Beginner 7 pages
- Searching and filtering in memory: indexes and composable filters Intermediate 7 pages
- Practice: Modelling patterns 3 pages
Chapter 8
58 pagesConcurrency in LLD
- Threads, shared state and race conditions Beginner 6 pages
- Locks and critical sections Intermediate 6 pages
- Check-then-act: making booking and allocation safe Intermediate 6 pages
- Deadlocks, livelocks and starvation Intermediate 6 pages
- Atomics and compare-and-swap Intermediate 6 pages
- Thread-safe collections and read-write locks Intermediate 6 pages
- Producer–consumer and blocking queues Intermediate 7 pages
- Thread pools, executors and futures Intermediate 6 pages
- Making a class thread-safe: confinement, immutability and a locking plan Advanced 6 pages
- Practice: Concurrency 3 pages
Chapter 9
40 pagesThe machine-coding round
- The machine-coding round: format, rules and how it is marked Beginner 7 pages
- A 90-minute plan: what to build first, and what to leave out Intermediate 6 pages
- Project layout, naming and a driver you can demo Beginner 7 pages
- Writing tests fast: the cases that catch bugs Intermediate 7 pages
- When the interviewer adds a requirement halfway through Intermediate 7 pages
- The review after: walking through and defending your code Intermediate 6 pages
Chapter 10
58 pagesCase studies: the classics
Chapter 11
34 pagesCase studies: games
Chapter 12
77 pagesCase studies: bookings, commerce and money
- Design movie ticket booking (like BookMyShow or Fandango) Intermediate 11 pages
- Design expense sharing (like Splitwise) Intermediate 11 pages
- Design parcel lockers (like Amazon Locker) Intermediate 11 pages
- Design food ordering (like DoorDash or Swiggy) Intermediate 11 pages
- Design cab booking (like Uber) Advanced 11 pages
- Design an inventory and order management system Advanced 11 pages
- Design a digital wallet Advanced 11 pages
Chapter 13
88 pagesCase studies: building blocks in code
- Design an LRU cache Intermediate 11 pages
- Design a rate limiter Intermediate 11 pages
- Design a logging framework Beginner 11 pages
- Design a pub/sub message broker Intermediate 11 pages
- Design a key-value store with transactions Advanced 11 pages
- Design a task scheduler Advanced 11 pages
- Design an in-memory file system Intermediate 11 pages
- Design a notification service Intermediate 11 pages
Chapter 14
44 pagesCase studies: apps and tools
Chapter 15
61 pagesPractice problems
- Problem set: games (Connect Four, Minesweeper, a deck of cards with Blackjack, Sudoku) 11 pages
- Problem set: bookings and commerce (car rental, hotel booking, a coupon and discount engine, a shopping cart with checkout) 11 pages
- Problem set: building blocks (a thread pool, a circuit breaker, a URL shortener in code, a feature-flag service) 11 pages
- Problem set: apps (a live sports scoreboard, a music playlist with shuffle and repeat, a chat room, a mini Twitter) 11 pages
- Follow-up drills: "add a new type", "make it thread-safe", "now save it to disk" 11 pages
- Running an LLD mock round: timer, marking sheet and feedback 6 pages
Chapter 16
19 pagesRevision
More to read
Mobile, Frontend, ML and GenAI system design are being written.