System design fundamentals

HLD vs LLD: Difference, Examples & Interview Questions

HLD (High Level Design) decides which services a system is made of and how they work together at scale. LLD (Low Level Design) decides the classes, interfaces and patterns inside one of those services. Same product, two zoom levels - and in interviews, two separate rounds.

HLD and LLD at a glance

HLDLLD
Full formHigh Level DesignLow Level Design
Also calledSystem design, architectureObject-oriented design, machine coding
ScopeA whole system of servicesThe inside of one service or module
Building blocksServices, databases, caches, queues, CDNs, load balancersClasses, interfaces, enums, design patterns
Main questionWill it scale and survive failure?Is it correct, readable and easy to extend?
Output in an interviewAn architecture diagram and the trade-offs behind itA class diagram or working code
Graded onRequirements, estimates, data model, scaling, trade-offsModelling, SOLID, patterns, extensibility, code quality
Typical round45-60 minutes of discussion at a whiteboard45-90 minutes, often with code that must run
Weighted most atSDE-2, senior and staffSDE-1 and SDE-2, and machine coding rounds

What is HLD in system design?

High level design is the architecture of a system. It answers what the components are, what each one owns and how a request travels between them: an API gateway in front of a set of services, which databases hold which data, where caches sit, what goes through a queue, and what a CDN serves. It is driven by numbers - users, requests per second, data volume - because those numbers decide whether one database is enough or the data has to be sharded.

An HLD is judged on non-functional properties: scalability, availability, latency, consistency and cost. Most of the interesting decisions are trade-offs, such as accepting eventual consistency in a feed so that it stays fast.

What is LLD in system design?

Low level design is the structure of the code inside one component. It names the classes and what each is responsible for, the interfaces between them, the relationships (composition, inheritance) and the design patterns that make the code easy to change - a Strategy for pricing rules, a State machine for an elevator, an Observer for notifications.

An LLD is judged on correctness and how well it absorbs change: SOLID principles, clear boundaries, no duplicated logic, and whether a new requirement lands as a new class rather than an edit to five existing ones.

The same problem, designed both ways: BookMyShow

HLD of BookMyShow

  • Services for catalogue and search, show listings, seat booking, payments and notifications, behind an API gateway.
  • A temporary seat hold with a short expiry, held in a fast store, so two people cannot pay for the same seat.
  • A payment flow with timeouts that releases the hold when payment fails, and idempotent confirmation.
  • Caching and a CDN for listings and posters; extra capacity for a blockbuster release that brings a flash crowd.

LLD of BookMyShow

  • Classes such as Movie, Theatre, Screen, Show, Seat and Booking, with a seat-status enum.
  • A SeatLockProvider interface, so the locking strategy can change without touching booking logic.
  • A PricingStrategy for seat categories and surge pricing, added without editing Booking.
  • Thread-safe seat selection so two concurrent bookings cannot both succeed.

Read both in full: the ticket booking system design (HLD) and the BookMyShow low level design.

HLD and LLD documents

Outside interviews, both are written documents, produced in that order.

An HLD document usually contains

  • Goals, non-goals and the requirements, including the numbers the design must meet.
  • An architecture diagram, the responsibility of each component and the data flow between them.
  • Data stores and why each was chosen, plus the main APIs between services.
  • Scaling, availability and security approach, and the trade-offs that were considered and rejected.

An LLD document usually contains

  • Class and sequence diagrams for the component, with responsibilities for each class.
  • Interfaces and method signatures, database schemas and indexes.
  • Error handling, edge cases and how the component is tested.

HLD and LLD interview questions

Common HLD (system design) questions

Common LLD questions

Which should you prepare first?

  • Freshers and SDE-1: LLD and DSA first. HLD questions at this level are small and forgiving.
  • SDE-2: both, roughly equally. Most loops have one round of each.
  • Senior and staff: HLD carries the most weight, but an LLD or machine coding round is still common at Indian product companies.

For a plan, read how to prepare for a system design interview. To rehearse, practise HLD with an AI interviewer, practise LLD against hidden tests, or book a live 1:1 mock interview.

HLD vs LLD FAQ

What is the full form of HLD and LLD?

HLD stands for High Level Design and LLD for Low Level Design. In interviews, HLD is usually called system design, and LLD is often called object-oriented design or, when working code is required, a machine coding round.

What is the main difference between HLD and LLD?

Scope. HLD designs a whole system of services - which components exist, how data flows between them and how the system scales and fails. LLD designs the inside of one component - its classes, interfaces, relationships and the design patterns that hold them together, down to method signatures.

Is system design HLD or LLD?

Both are system design, but when an interview says "system design round" it almost always means HLD. Low level design is normally named separately as an LLD, OOD or machine coding round.

Which comes first, HLD or LLD?

In a real project HLD comes first: the architecture is agreed, then each service gets a low level design. For interview preparation the order depends on level - freshers and SDE-1 candidates usually meet LLD and DSA first, while SDE-2 and senior loops weight HLD more heavily.

Do freshers get HLD interview questions?

Sometimes, but smaller ones - a URL shortener or a rate limiter - graded on clear requirements and basic scaling ideas. Large distributed designs are expected from SDE-2 upwards. Freshers are far more likely to face an LLD or machine coding round.

Is a machine coding round HLD or LLD?

LLD. A machine coding round is a low level design problem where the deliverable is working code rather than a diagram: 60 to 90 minutes to build an extensible solution, usually followed by a new requirement to add.