High-Level Design vs Low-Level Design (HLD vs LLD)
HLD vs LLD explained: what each interview round tests, the deliverables of high-level and low-level design, and how to prepare for both with examples.
High-level design (HLD) is the architecture of a whole system: which services exist, how they communicate, where data is stored, and how it scales and fails. Low-level design (LLD) is the design of the code inside one component: its classes, interfaces, data structures and how they collaborate. Many companies interview for both as separate rounds, often called the system design round and the machine-coding or object-oriented design round, and they reward different skills.
HLD vs LLD at a glance
| High-level design | Low-level design | |
|---|---|---|
| Scope | The whole system, across many machines | One service, module or feature |
| Building blocks | Services, databases, caches, queues, load balancers, CDNs | Classes, interfaces, enums, methods, design patterns |
| Main concerns | Scale, latency, availability, consistency, data flow, cost | Responsibilities, extensibility, readability, testability, concurrency |
| Deliverable | Architecture diagram, APIs, data model, scaling and failure plan | Class diagram and working code (or detailed pseudocode) |
| Typical questions | Design a URL shortener, a chat system, a news feed | Design a parking lot, an elevator system, a library system, a rate limiter class |
| Assessed on | Trade-offs and reasoning about requirements and scale | Clean abstractions, SOLID principles, appropriate patterns, correct behaviour |
How an HLD round runs
- Clarify functional and non-functional requirements.
- Estimate scale: users, requests per second, storage. See estimation.
- Define the main APIs. See API design.
- Draw the high-level architecture and data flow.
- Design the data model and choose storage. See SQL vs NoSQL.
- Deep dive into the hardest parts: scaling, caching, consistency, failures.
- Summarise trade-offs and what you'd improve.
The full framework is in how to prepare for a system design interview.
How an LLD round runs
- Clarify requirements and scope: for a parking lot, which vehicle types, how many floors, how pricing works, whether multiple entry gates run concurrently.
- Identify entities (nouns): ParkingLot, Floor, Spot, Vehicle, Ticket, Payment.
- Define responsibilities and relationships: which class owns what, what's an interface, what's composition vs inheritance.
- Design the key interfaces and methods, often as a class diagram.
- Apply patterns where they fit: a strategy for pricing or spot allocation, a factory for vehicles, an observer for display boards. See design patterns.
- Write the core code and walk through a scenario end to end.
- Discuss extensibility and concurrency: adding a new vehicle type, two cars grabbing the same spot.
What good looks like in each
- HLD: requirements drive every component, numbers justify choices, the design is proportionate, and failure handling is explicit.
- LLD: each class has one clear responsibility, behaviour that varies sits behind interfaces, new requirements need additions not rewrites, and shared state is protected. See SOLID principles.
- Both: state assumptions, explain trade-offs, and keep it simple until a requirement demands more.
A common LLD mistake is over-engineering: ten patterns in a parking lot. Use a pattern only when you can name the change it makes easy. A common HLD mistake is the opposite of LLD's: drawing boxes without saying why each is needed.
How they connect
Real systems need both. An HLD might include a rate limiter service; the LLD of that service decides how the token-bucket algorithm, its storage interface and its configuration are structured. Senior candidates move between levels comfortably, zooming into one component's internals during an HLD deep dive when it matters.
Where it’s used
Often include a machine-coding or LLD round alongside, or instead of, a light HLD round.
Weight HLD heavily, with LLD-style deep dives into a critical component.
Architecture docs (HLD) and component design docs (LLD) are written at both levels.
In an interview
- Ask which round you're in and adjust the level of detail.
- In HLD, start from requirements and scale; in LLD, from entities and responsibilities.
- Use design patterns only where they make a named change easy.
- Be ready to zoom from HLD into one component's LLD.
Further reading
- Refactoring Guru: Design PatternsRefactoring Guru
- The System Design PrimerDonne Martin, GitHub