Topic 0.2
LLD vs HLD
In one line
Low-level design is the code view (classes, interfaces, patterns, relationships); high-level design is the system view (services, databases, queues, scaling). Both matter, and interviews start at HLD and zoom into LLD.
Think of it like this
Building a house. HLD is the architect's plan: how many rooms, where the kitchen is, how water and power come in. LLD is the carpenter's plan: exactly how each door, cupboard and hinge is built.
Key ideas
- 01
LLD → classes, interfaces, objects, relationships, design patterns, production-quality code.
- 02
HLD → services, databases, queues, caches, load balancers, CDNs, distributed systems.
- 03
HLD answer components: requirements, scale, APIs, data model, architecture, flow, bottlenecks, scaling, failure, consistency, security, monitoring, trade-offs.
- 04
LLD answer components: requirements, actors, use cases, entities, responsibilities, relationships, interfaces, SOLID, patterns, extensibility, concurrency, code, tests.
- 05
Interview convention: HLD = whiteboard boxes and arrows; LLD = editor and unit tests.
- 06
A senior interview usually mixes both: design Twitter (HLD), then design the notification worker (LLD).
Java / Spring map
- →
HLD maps to modules and infra: Gateway, Order-Service, Payment-Service, Kafka, Postgres, Redis.
- →
LLD maps to packages inside one service: domain model, ports (interfaces), adapters (implementations), application services.
Explain without notes
For the same product, list two questions you'd only ask in an HLD round and two only in an LLD round.
Practice
Take the 'Rate Limiter' problem and produce both an HLD sketch (boxes) and an LLD sketch (interfaces + classes).
Completion checklist
I can state the full HLD checklist and the full LLD checklist from memory.