Low-level design (LLD) is about the code inside one service: which classes exist, what each is responsible for, how they talk to each other, and how the design copes when requirements change. Where system design asks "which boxes and databases?", LLD asks "which classes and interfaces, and why?"
It shows up in three ways:
- OOP questions in fresher technical rounds at service companies: pillars, interfaces, a small class design.
- Design-pattern and SOLID questions for experienced engineers, often through their own Java, C# or Python code.
- Machine coding or LLD rounds at product companies: design and code a parking lot or a cache in 60 to 90 minutes.
How deep do you need to go?
| You are | What to expect | Focus on |
|---|---|---|
| A fresher at a service company | OOP concepts with examples, maybe "design classes for a library system" on paper | Stages 1 and 2 |
| Experienced at a service company (2 to 6 years) | SOLID, common patterns in your stack, "how would you structure this module?" | Stages 1 to 3 |
| Product companies | A full LLD or machine coding round, with working code | All stages |
Stage 1: OOP that holds up under questions (1 week)
Most LLD mistakes are really OOP mistakes. Make sure you can explain, with your own code:
- Encapsulation, abstraction, inheritance and polymorphism.
- Interfaces versus abstract classes, and when to use each.
- Composition over inheritance: why "a car has an engine" usually beats "a sports car is a car" hierarchies.
- Cohesion and coupling: one class, one job, few dependencies.
Our CS fundamentals guide covers the OOP questions freshers get.
Stage 2: SOLID (1 week)
- Single responsibility: one reason to change.
- Open/closed: add behaviour by adding code, not by editing working code.
- Liskov substitution: a subclass must work wherever its parent does.
- Interface segregation: small, focused interfaces.
- Dependency inversion: depend on interfaces, not concrete classes.
For each principle, have one before-and-after example: a class that breaks it and the refactor that fixes it. DigitalOcean's SOLID guide has short, clear examples.
Stage 3: the patterns that actually come up (2 weeks)
You don't need all 23 Gang of Four patterns. These cover nearly every interview:
| Pattern | Use it when | Classic example |
|---|---|---|
| Strategy | The algorithm varies (pricing, payment, sorting) | Parking fee calculation |
| Factory | Creating objects depends on input | Creating vehicle or notification types |
| Singleton | Exactly one instance is genuinely needed (use sparingly) | A configuration registry |
| Observer | Many parts react to one event | Notifying users when an order ships |
| State | Behaviour changes with state | A vending machine or an order lifecycle |
| Decorator | Add features without subclass explosion | Pizza toppings, logging wrappers |
| Builder | Objects with many optional fields | Building an HTTP request |
| Adapter | Making an old interface fit a new one | Wrapping a third-party payment SDK |
Refactoring.Guru explains every pattern with diagrams and code in several languages. It's the best free reference.
Stage 4: the classic problems (3 weeks)
Work through these roughly in this order. Each one exercises different ideas:
- Parking lot. Entities, enums, a fee strategy, finding a spot.
- LRU cache. Data structure design, O(1) operations, then thread safety.
- Library management. Relationships, search, borrowing rules.
- Vending machine. The state pattern, done properly.
- Elevator system. Scheduling, state and concurrency.
- Movie ticket booking (BookMyShow). Seat locking and concurrent bookings.
- Splitwise. Balances, simplifying debts, clean interfaces.
- Snake and ladder or tic-tac-toe. Game loops and extensibility.
- Rate limiter. Algorithms behind an interface. See rate limiting algorithms.
- Logger or notification service. Observers, levels, multiple outputs.
Awesome low-level design has write-ups and code for most of these to compare against once you've tried them yourself.
Stage 5: concurrency in LLD
Senior LLD rounds almost always ask "what if two users do this at once?" Two people booking the same seat, two threads using the cache. Learn locks, atomic operations and thread-safe collections in your language. Our processes and threads guide covers the basics with runnable code.
How to run an LLD round
- Clarify requirements (5 minutes): which features are in scope, and which can wait.
- List the entities and their responsibilities.
- Sketch the classes and relationships: a quick class diagram, interfaces first.
- Walk through one use case end to end, calling the methods you designed.
- Code the core (machine coding rounds): clean, runnable, with a small demo.
- Discuss extensions: a new vehicle type, a new payment method, concurrency.
Common mistakes
- God classes. One
ParkingLotManagerthat does everything. - Pattern stuffing. Five patterns where one would do.
- No interfaces. Hard-coding concrete classes everywhere makes every extension painful.
- Ignoring concurrency until the interviewer asks.
- Not talking. LLD is a conversation about trade-offs. Silent coding loses marks even if the code works.
Practise explaining designs
LLD skill shows most clearly when you explain why your classes look the way they do. In a mock design round, the interviewer starts with your own project ("how is the code in your project structured?") and then pushes on extensibility and failure, which is exactly where LLD reasoning gets tested. Do one after each stage and the report will show whether your explanations are landing.