Study notes

STUDY NOTES · LOW-LEVEL DESIGN

The LLD framework
A complete simple design beats an elegant half-design.

What an LLD round grades, a seven-step plan for the 45–60 minutes, which design pattern fits which situation, and the concurrency toolbox that keeps designs correct.

anuragdevon 12th Nov 2026 4 min read Low-level design · Note 1 of 11

Low-level design rounds check whether you can turn a fuzzy requirement into clean, extensible, working code: classes, interfaces, relationships, patterns and concurrency. It’s the round where everyday product engineering, turning business rules into code that survives the next change, is a direct advantage. The worked designs in this track all follow the framework below.

// THE SHORT VERSION
  • Clarify first: agree on three to six functional requirements and name what’s out of scope.
  • Interfaces only where variation is likely: pricing, payment, assignment, notification.
  • Get the core flow working before polishing anything.
  • Find the race (double booking, double assignment) and fix it properly.
01

What the interviewer evaluates

AreaWhat “strong SDE2” looks like
RequirementsAsks clarifying questions, writes down functional requirements, agrees on scope, names what’s out of scope
ModellingEntities with clear responsibilities; it’s obvious which class owns what state and behaviour
AbstractionsInterfaces where variation is likely (pricing, payment, assignment, notification). Concrete classes elsewhere
PrinciplesSOLID, composition over inheritance, no god classes, immutability for value objects
PatternsUsed naturally to solve a real need, not forced in
CodeCompiles in your head: clear names, enums for fixed sets, exceptions or result types for errors
ConcurrencySpots the race (double booking, double assignment) and fixes it correctly
ExtensibilityWhen the interviewer adds a requirement, the change fits without rewriting everything
TestabilityDependencies are injected, so you can explain how you’d unit test it
02

The 7-step framework (45–60 minutes)

StepTimeWhat to do
1. Clarify requirements5–7 minUsers and actors, core use cases, constraints, scale. Write 3 to 6 functional requirements and agree on them
2. Identify entities3–5 minNouns → classes; verbs → methods. Spot value objects (Money, Location, TimeSlot)
3. Relationships3–5 minhas-a or is-a, cardinality, and who owns the lifecycle
4. Class diagram / interfaces5–8 minKey interfaces, enums, state machines. Mark the extension points
5. Core code15–20 minWrite the main flow end to end. Skip trivial getters and setters
6. Concurrency and edge cases5 minLocks, idempotency, invalid states, failures
7. ExtensionsRemainderAnswer “what if…” by showing which class changes
// GOLDEN RULE

Get a working core flow before polishing. A complete, simple design beats an elegant half-design.

03

Pattern map: when to use which

Situation in the problemPattern
Several interchangeable algorithms (pricing, slot allocation, assignment, splitting)Strategy
An entity with a lifecycle and rules about which actions are allowed in which state (order, vending machine, elevator)State (or an enum state machine plus a transition table)
Notify many listeners when something happensObserver / pub-sub
Creating the right subtype from inputFactory
Many optional parameters in a constructorBuilder
Adding behaviour (caching, logging, retries) without changing a classDecorator
Wrapping a third-party APIAdapter
One shared instance (a registry, or a controller in the interview)Singleton (prefer DI in real code)
A request passing through handlers (validation, approval, logging levels)Chain of Responsibility
Encapsulating actions as undoable objectsCommand
A simplified entry point over subsystemsFacade
04

Concurrency toolbox for LLD

NeedTool
Prevent double booking or allocation of one resourceA lock per resource (ReentrantLock in a ConcurrentHashMap), or an atomic compare-and-set on its state
A shared counterAtomicInteger / LongAdder
A thread-safe mapConcurrentHashMap with compute/putIfAbsent (atomic per key)
Producer–consumerBlockingQueue
Many readers, few writersReadWriteLock
A temporary hold (a seat held for 10 minutes)A hold with an expiry timestamp, plus lazy cleanup or a ScheduledExecutorService
Across multiple serversA DB unique constraint, SELECT … FOR UPDATE, optimistic versioning, or a Redis lock with a fencing token
05

The designs in this track

#ProblemMain patterns and skills tested
01Parking LotStrategy, Factory, concurrency on slot allocation
02Food delivery systemState machine, Strategy (pricing, assignment), Observer, idempotency
03Splitwise (expense sharing)Strategy (split types), validation, debt simplification
04Movie Ticket Booking (BookMyShow)Seat locking with expiry, concurrency, idempotent payment
05Rate LimiterStrategy (algorithms), thread safety, distributed extension
06Elevator SystemState, Strategy (scheduling), event loop
07Vending MachineState pattern (the classic example)
08Notification ServiceStrategy, Template Method, retries, Observer
09Tic-Tac-Toe / Board GamesClean modelling, O(1) win check, extensibility
10In-Memory Key-Value Store with TTLConcurrency, expiry, eviction, transactions
06

How to practise

  1. Take one problem a day. Close the file and spend 45 minutes designing and coding it yourself on paper or in an IDE, without AI.
  2. Then compare with the reference here. Note what you missed: requirements, an abstraction, a race condition.
  3. Do it again 3 days later from scratch. LLD is pattern muscle memory, just like DSA.
  4. Practise the extension questions out loud. That’s where SDE2 candidates stand out.
// MORE TO PRACTISE THE SAME WAY

library management, hotel booking, ride hailing (Uber), chess, Snake & Ladder, ATM, logging framework, cab fare calculator, Instagram feed (LLD level), meeting scheduler, inventory management, coupon engine, file system (mkdir, ls), and an in-memory search/autocomplete.

→

More in Low-level design

Note 1
The LLD framework
You're reading this.
Note 2
Parking lot
Note 3
Food delivery system
Note 4
Splitwise
Note 5
Movie ticket booking
Note 6
Rate limiter
Note 7
Elevator system
Note 8
Vending machine
Note 9
Notification service
Note 10
Tic-tac-toe
Note 11
Key-value store with TTL
END OF NOTE 1

Up next: Parking lot

Short, plain-language notes on what interviewers ask an SDE2 and how to think about it.

Contact