SysDesignAtlas

HLD vs LLD — Telling the Rounds Apart

Where the line between the two sits, how to work out which round you're in within two minutes, and what to do when the interviewer moves from one to the other mid-question.

HLD + LLDEasy7 min readinterviewframeworkhldlld
Confidence

Both rounds open with the same three words: "design a something". They score completely different things. Answering at the wrong level is the most common way a prepared candidate loses a round they could have passed.

#The line is the program boundary

Here's the whole distinction in one rule.

  • HLD covers things that talk to each other over a network. If two boxes in your drawing could sit in different buildings, you're doing HLD.
  • LLD covers things that talk to each other inside one running program, by calling methods. Same memory, same process.

Everything else follows from that one difference. Network messages can get lost, arrive late, or arrive twice — so HLD worries about retries, copies of data, and what happens when a machine dies. Method calls don't get lost — so LLD worries about different things: keeping classes easy to change, and stopping two threads from corrupting shared data.

Product What are we building, and for whom HLD · servers and databases Traffic, storage, delay, what happens when it breaks LLD · classes and interfaces Jobs, boundaries, extension, threads Code · methods and data structures Signatures, rules, speed
Zoom levels. An SDE-2 loop usually samples the middle two.

#Working out which one you're in

ClueIt's HLDIt's LLD
The question"Design Twitter""Design a parking lot"
Scale mentioned?"…for 100 million users"Usually not mentioned
What they ask you to draw"Draw the architecture""What classes would you have?"
The follow-up"What if that whole region goes down?""Now add a new payment type"
Who's interviewingOften a senior engineerOften your future teammate

The strongest clue is a number of users. If the question mentions scale, they want HLD. If it's a bounded physical thing — parking lot, lift, chess, vending machine, ATM, library — they want LLD, and talking about splitting the database will look like avoidance.

#What earns points in each

In HLD: scoping the problem, doing arithmetic that actually changes a decision, a data model with a stated rule for splitting the data, walking one request end to end, two proper deep dives, and naming what breaks first at ten times the traffic. Depth beats breadth — one component explained properly outweighs six merely listed.

In LLD: listing the entities, getting the relationships right (has-a versus is-a), putting interfaces where things genuinely vary, method signatures that read well, walking one operation through your objects, thread safety, and how cleanly a new requirement lands. Here, ability to absorb change beats completeness. A small design where a new requirement means adding one class beats a big one that covers every feature of today but has to be rewritten for tomorrow's.

#When they move from one to the other

This happens constantly in SDE-2 (mid-level engineer) interview loops and it catches people out. You've spent 25 minutes on the architecture of a notification system, and the interviewer says: "Let's zoom into the delivery service. What does the code look like?"

That is not a new question. It's an invitation to go one level down on a box you already drew. Three moves:

  1. Name the box. "This is the worker that takes jobs off the queue and delivers them."
  2. State what it promises. "It takes a notification, picks a channel, sends it, reports the result." That promise is the class you're about to design.
  3. Find what varies. Channels differ (email, SMS, push) — so Channel is an interface. Retry rules differ per channel — so that's another one.

Every zoom-in is those same three moves. Going the other way — from classes back up to architecture — is rarer; the move there is: "if I run many copies of this, what data is shared, and where does it live?"

Delivery svc one box in HLD What it promises send(Notification) What varies? channel, retries, format Interfaces Channel, RetryPolicy
Zooming in: the box you drew becomes the classes you design.

#Words that mean the same thing at both levels

Using these precisely is free credibility.

  • Idempotent — doing it twice has the same effect as doing it once. In HLD that's about a network call being retried; in LLD it's about a method that's safe to call again after a half-finished attempt.
  • Contract — what something promises, regardless of how it's built. An API endpoint in HLD, an interface in LLD.
  • Coupling — how much changing this forces you to change that. Services joined by a direct call in HLD; in LLD, a class that builds its helper with new EmailSender() is tied to that exact class and can't be handed a different one.
  • Single writer — the cheapest way to avoid two things clashing, at either level. One server owning a slice of data in HLD; one thread owning an object in LLD.

#Check yourself

Where exactly is the line between HLD and LLD?Show answer
The program boundary. HLD covers things talking over a network (messages can be lost, late or duplicated); LLD covers things calling methods inside one process (focus on change and threads).
What is the strongest clue that a question is HLD?Show answer
A number of users or a scale. Bounded physical things — parking lot, lift, chess, ATM, library — signal LLD.
What do you do with questions that sit on the line?Show answer
Rate limiter, cache, notifications, logger, scheduler: ask whether they want a library inside one service or a distributed architecture across a fleet. Asking is a seniority signal.
What earns points in HLD versus LLD?Show answer
HLD: scope, arithmetic that changes decisions, a data model with a split rule, one request end to end, two deep dives, what breaks at 10×. LLD: entities, relationships, interfaces where things vary, signatures, threads, and how cleanly a new requirement lands.
What are the three moves when asked to zoom into a box?Show answer
Name the box, state what it promises (that becomes the class), and find what varies (those become interfaces).
Name a concept that means the same thing at both levels.Show answer
Idempotent (a retried call or method has one effect), contract (API or interface), coupling (direct calls or new), and single writer (one server per data slice or one thread per object).

#What to carry forward

  • HLD is across the network; LLD is inside one program.
  • A user count means HLD; a bounded physical thing means LLD; ask when it's both.
  • State your zoom level in the first minute so a mismatch surfaces early.
  • Zooming in: name the box, state its promise, find what varies.
  • It's one subject — keeping things independent so they can change — seen from two distances.
00:00
/ 7m