HLD means high-level design, also called system design. It is about the big pieces of a system: services, databases, caches, queues and how they talk to each other. LLD means low-level design, also called object-oriented design. It is about the classes, interfaces and methods inside one of those pieces.
A simple way to remember: HLD answers "what boxes do we need, and how do they scale?" LLD answers "what classes go inside one box, and how do they work together cleanly?"
HLD vs LLD at a glance
| HLD (system design) | LLD (object-oriented design) | |
|---|---|---|
| Typical question | Design Uber, WhatsApp or a URL shortener | Design a parking lot, a vending machine or a chess game |
| Focus | Services, databases, caches, queues, load balancers | Classes, interfaces, relationships, methods |
| Main topics | Scaling, availability, consistency, sharding, trade-offs | SOLID principles, design patterns, clean OOP |
| What you produce | An architecture diagram and a discussion of trade-offs | A class diagram and working code |
| Typical round | System design round | Machine coding or object-oriented design round |
One product, both views: a parking lot
- LLD view. Classes such as ParkingLot, Level, Spot, Vehicle and Ticket. A strategy decides the price. A factory creates the right kind of spot.
- HLD view. Now there are thousands of lots in many cities. You need a payments service, a database that is split by city (sharding), a cache for live availability (caching), and a plan for what happens when a payment service is down.
Which should you learn first?
Check the role. Many companies ask HLD mostly for experienced candidates, and LLD or data structures for freshers, but this varies, so read the job description.
If you are early in your career, learn SOLID and the common patterns first, because they also make your everyday code better. Then move to system design. If you are experienced, start with system design and keep a few LLD patterns ready.
Learn HLD with the interactive system design lessons. Learn LLD with SOLID and 23 design patterns, each with a class diagram, a step-by-step flow and code in Python and Java.