Low-Level Design · Note 1 of 9
Introduction to Low-Level Design
Quick answer
What is low-level design in a software interview?
Low-level design is the round where you turn a small problem, such as a parking lot or an LRU cache, into classes, their relations and working code. You clarify requirements, pick entities from the nouns and methods from the verbs, draw a class diagram, apply patterns where change is expected, write the code and walk a use case through it. Interviewers grade extensibility, SOLID and readable code.
On this page
Low-level design (LLD) turns a small, concrete problem into classes, relations and working code. Many companies run it as a machine-coding round: about an hour to design and code.
What the round asks
- A bounded problem: parking lot, elevator, LRU cache, movie booking, splitwise.
- A class diagram, then code that runs one or two use cases.
- Discussion: "what if we add a new vehicle type?", "what if two users book the same seat?".
HLD vs LLD
| High-level design | Low-level design | |
|---|---|---|
| Unit | Services, databases, queues | Classes, interfaces, methods |
| Question | What runs where, how it scales | How the code is structured |
| Output | Box-and-arrow architecture | Class diagram and code |
| Graded on | Scale, availability, trade-offs | Extensibility, SOLID, clarity |
High-level design draws services, databases and the arrows between them. It answers what runs where and how the pieces talk.
Transcript · 4 steps
The approach
- Clarify requirements: use cases, actors, limits, what is out of scope.
- Find entities and behaviours: nouns become classes, verbs become methods.
- Draw the class diagram: fields and methods per class.
- Add relations: inheritance, composition, association, with multiplicity.
- Apply patterns where a requirement is likely to change.
- Write the code: core classes first, then a small
main. - Walk a use case through the code to prove it works.
Start from the requirement exactly as the interviewer gave it. Read it slowly: the nouns, the verbs and the word has are the raw material of the design.
Transcript · 4 steps
- An actor (driver, admin) is outside the system; it calls methods, it is not a class.
- Put a method on the class that owns the data it needs.
Growing the model
Start from the class the use cases enter through, then add one class at a time.
Begin with the class the use cases enter through: ParkingLot, with park and leave as its public methods. Everything else hangs off it.
Transcript · 5 steps
- Composition when the part dies with the whole (floor in a lot).
- Abstract class or interface where new kinds will arrive (vehicles).
- Keep each class small: one reason to change (SOLID).
The driver arrives: the gate calls park(car) on the lot. Walking one use case through the classes is how you prove the design works.
Transcript · 7 steps
What interviewers grade
- Extensibility: a new type is a new class, not a new
if. - SOLID: small classes, interfaces at the points of change.
- Readable code: clear names, no god class, no global state.
- Correctness: the use case runs; edge cases (lot full, double booking) are handled.
- Communication: you state assumptions and trade-offs aloud.
Interview questions
- How is LLD different from HLD? HLD places services and data stores; LLD designs the classes inside one of them.
- Where do you start? With questions: use cases, actors and scope, before any class.
- How do you find the classes? Nouns in the agreed requirements; verbs become methods.
- When do you use a design pattern? When a named requirement is likely to change, such as pricing rules or notification targets.
- What makes a design extensible? New behaviour arrives as a new class behind an existing interface.
Common questions
What is the difference between HLD and LLD?
High-level design decides the services, databases, caches and queues of a whole system and how they talk. Low-level design zooms into one component and decides its classes, interfaces, relations and method signatures, usually down to running code.
What is a machine-coding round?
It is a low-level design round where you must also write working code, typically in 60 to 120 minutes, for a problem such as a parking lot, a snake and ladder game or a splitwise clone. The code is judged on structure and extensibility as much as on whether it runs.
How do I start a low-level design question?
Ask questions before drawing anything. Pin down the use cases, the actors, the scale of each entity and what is out of scope, then list the nouns and verbs in the agreed requirements. Those become your first classes and methods.
Which design patterns matter most for LLD interviews?
Strategy, Observer, State, Factory, Singleton and Decorator come up most because LLD problems keep needing swappable rules, notifications, state machines and object creation. Use a pattern when it solves a change you can name, not to show it off.
Do I need UML for an LLD interview?
You need enough UML to draw a class diagram quickly: a box per class with fields and methods, and lines for inheritance, interfaces, composition and association. Nobody grades notation details, but a clear diagram makes your design easy to follow and discuss.