0 XP · 0 scenes

HLD vs LLD: What Is the Difference?

By Vivek Kumar Bhardwaj · Updated · 5 min read

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 questionDesign Uber, WhatsApp or a URL shortenerDesign a parking lot, a vending machine or a chess game
FocusServices, databases, caches, queues, load balancersClasses, interfaces, relationships, methods
Main topicsScaling, availability, consistency, sharding, trade-offsSOLID principles, design patterns, clean OOP
What you produceAn architecture diagram and a discussion of trade-offsA class diagram and working code
Typical roundSystem design roundMachine 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.