← Back to Design & Development
LLD · In a Hurry · Part 1 of 3

Low-Level Design — Introduction

What LLD interviews actually test, why they're not "code more LeetCode", and the four dimensions you're being scored on the entire 45 minutes.

Setting the Scene

What is Low-Level Design, Really?

Picture Sarah at her L5 onsite. After lunch she walks into a room and the interviewer says, "Design a parking lot." Sarah's brain immediately does the wrong thing — it reaches for boxes-and-arrows. "Should I draw a load balancer? Maybe a database?" Twenty minutes in she has a Postgres schema, a sharding strategy, and zero classes. The interviewer politely interrupts: "This is great… but what does the Ticket object look like? What method does the gate call when a car drives in?" Sarah freezes. She designed a system when she was supposed to design objects.

That's the single sentence definition of LLD: it's the design of the objects, not the system. If High-Level Design (HLD) is "what boxes are on the architecture diagram", Low-Level Design is "what classes live inside one of those boxes, what methods they expose, and how they collaborate at runtime." LLD is the moment you stop drawing rectangles for services and start drawing rectangles for classes — with fields above the line and methods below.

The newbie one-liner. HLD answers "how does the data move between machines?" LLD answers "once the data lands in one machine, what code processes it?" An HLD interview ends with a system diagram. An LLD interview ends with compilable Java (or Python or C++) on the whiteboard.

If you've never seen an LLD interview before, here's the shape: the prompt is usually a real-world thing with rules — a parking lot, a vending machine, an elevator, a chess game, a movie booking site. Your job over 45–60 minutes is to walk the interviewer from "here's the problem" to "here's the working object model" — naming classes, drawing relationships, choosing design patterns where they fit, and writing enough code (usually one or two key methods) that the interviewer can see how the runtime would actually behave when a user takes an action.

Comparison

LLD vs HLD — Two Different Conversations

The fastest way to internalize what LLD is is to put it next to what it isn't. Most candidates blur the two and end up doing neither well. Here's the side-by-side a senior engineer carries in their head.

Dimension HLD (System Design) LLD (Object Design)
Unit of designServices, databases, queuesClasses, interfaces, methods
VocabularySharding, replication, caching, fan-outInheritance, composition, polymorphism, encapsulation
Diagram typeBoxes-and-arrows architectureUML class diagram + sequence diagram
Failure mode you fix"What if traffic 10×?""What if we add a new payment method?"
Code on the boardRare — maybe a JSON payloadMandatory — at least one full class + one driver method
Patterns you citeDistributed: leader election, gossip, MapReduceGoF: Strategy, Factory, Observer, State, Decorator
Trade-offs centred onConsistency vs availability, latency vs costFlexibility vs simplicity, abstraction vs over-engineering
Typical prompt"Design Twitter""Design a Parking Lot"
The mental switch. When the prompt is a company ("Design Uber", "Design WhatsApp"), you're almost certainly in HLD territory. When the prompt is a physical object or game ("Design a vending machine", "Design Snake & Ladders"), you're in LLD territory. There are exceptions — "Design Splitwise" can be either — but if you're unsure, just ask: "Is this an object-design question or a system-design question?" The interviewer will tell you in one sentence.

So why does the industry keep both interviews? Because they test orthogonal skills. HLD tests whether you understand distributed systems — how data moves under load. LLD tests whether you understand object-oriented design — how to model a domain so the code stays maintainable for five years. A great backend engineer needs both: HLD to choose the right architecture, LLD to write the code that runs inside it without becoming an unmaintainable spaghetti pile.

Motivation

Why LLD Exists — The Story Behind the Interview

To understand why companies test LLD, watch what happens to a real codebase three years in. Imagine Raj joins a payments startup in year one. The codebase is small — one file called Payment.java with a 300-line method that handles "charge a card". Life is simple. Six months later the company adds Apple Pay. The method becomes 500 lines with a giant if/else. Then UPI. Then crypto. Then a partnership with a buy-now-pay-later provider. By year three, that one method is 4,000 lines, nobody can change it without breaking three other flows, and every new payment method takes three weeks instead of three days.

LLD is the discipline that prevents that file. The same problem — "charge a card" — could have been modelled as a PaymentMethod interface with a Card, ApplePay, UPI, and Crypto implementation. Adding a new method would mean writing one new class, not editing a 4,000-line monster. That difference — open for extension, closed for modification — is the soul of LLD. Interviewers test it because they've all maintained the 4,000-line version, and they don't want to do it again.

🟥 The 4000-line method

public class Payment {
  public void charge(String type, double amt) {
    if (type.equals("card")) {
      // 800 lines of card logic
    } else if (type.equals("applepay")) {
      // 600 lines of Apple Pay logic
    } else if (type.equals("upi")) {
      // 700 lines of UPI logic
    } // ...10 more elses
  }
}

🟩 The LLD version

interface PaymentMethod {
  Receipt charge(double amt);
}

class Card     implements PaymentMethod { ... }
class ApplePay implements PaymentMethod { ... }
class UPI      implements PaymentMethod { ... }

// Adding crypto = one new file, zero edits
class Crypto   implements PaymentMethod { ... }
So what. LLD interviews are companies asking, "If we hire you, will you be the engineer who writes the 4000-line method, or the one who writes the interface? We can't promote the first kind to senior — they create work for the rest of the team for years."

That's the why. Now the rest of this introduction is about the how — what specifically interviewers measure, how the 45-minute conversation flows, and which mental tools (SOLID, GoF patterns, UML) you need to walk in with already loaded.

Scoring Rubric

The Four Pillars — What Interviewers Actually Score

Just like HLD has four scoring dimensions, so does LLD — but they're different ones. Knowing them tells you where to spend the 45 minutes. Most loops are won or lost on Pillar 2 (modelling) and Pillar 4 (communication), not on whether you remembered all 23 GoF patterns.

① Requirements Discipline

Can you turn a vague prompt — "design a parking lot" — into a tight list of features the design must support, plus a list of things you're explicitly punting on? Candidates who skip this step always design the wrong system. The good move sounds like: "Top 3 functional features I'll focus on: (a) park a car, (b) calculate the bill on exit, (c) reserve a spot from an app. Out of scope: payment processing, valet integration, multi-tenant operators. Sound right?"

What it looks like: the candidate produces 5 functional + 3 non-functional requirements in the first 3 minutes, names what's out of scope, and gets explicit interviewer buy-in before drawing anything.

② Domain Modelling

Can you take the vocabulary of the problem (cars, spots, tickets, gates) and translate it into a coherent class model — picking the right entities, the right relationships (composition vs aggregation vs inheritance), and the right level of abstraction? This is the heaviest weight in the rubric. A great class diagram is half the interview.

What it looks like: the candidate names 5–8 entities, explains why each one is its own class (vs a field on another class), and can defend their inheritance vs composition choices with a one-line reason rooted in "what changes independently?"

③ Pattern Application

Can you spot the variation points in the design — the places where future requirements are most likely to demand change — and apply the right GoF pattern there? The senior signal isn't "I memorized 23 patterns"; it's "I picked Strategy here because pricing rules will change every quarter, and I picked State here because the booking goes through 6 distinct lifecycle stages."

What it looks like: 2–4 patterns named, each one tied to a specific class in the design, each one justified by a concrete future-change scenario the interviewer can imagine.

④ Communication & Trade-offs

Can you narrate why you're making each choice, respond to interviewer pushback without getting defensive, and articulate the trade-offs of every decision in one sentence? The interviewer is also scoring "would I want this person on my code review?" Candidates who design silently — heads down, drawing for 20 minutes — fail this pillar even when their design is correct.

What it looks like: the candidate thinks aloud, asks "is this the depth you want?" at every milestone, and when challenged with "why composition not inheritance?" answers in one sentence: "A car's engine isn't an 'is-a' — it's a 'has-a'. If we ever need a hybrid (gas + electric), inheritance forces multiple inheritance; composition just adds another field."

Rough weighting: 20 / 35 / 20 / 25. Domain Modelling is the heaviest because it's the hardest to fake — interviewers can immediately tell if your class diagram is coherent or held together with tape. Communication is the silent killer — most candidates lose loops not because their design was wrong but because the interviewer couldn't follow their reasoning. Patterns are surprisingly low-weight: dropping the right pattern name without justifying it is worse than not naming it at all.
The Format

Anatomy of a 45-Minute LLD Loop

An LLD interview isn't a free-form chat — it has phases, and good candidates can feel the phase change without being told. Here's the shape of the conversation, minute by minute. We'll go deeper on each step in the framework page; this is the helicopter view.

gantt title LLD Interview — 45 to 60 Minute Timeline dateFormat X axisFormat %s section Setup Step 1 — Requirements :crit, s1, 0, 5m Step 2 — Core Entities :s2, after s1, 5m section Design Step 3 — Class Diagram :crit, s3, after s2, 10m Step 4 — Patterns and Sequence :crit, s4, after s3, 10m section Code Step 5 — Java Code :crit, s5, after s4, 12m section Buffer Q and A and Trade-offs :s6, after s5, 5m

Step 1 · ~5 min

Requirements. Functional + non-functional. Top 3 user actions. Explicit out-of-scope list. Get interviewer sign-off.

Step 2 · ~5 min

Core Entities. List 5–8 nouns with one-sentence responsibility each. No fields yet.

Step 3 · ~10 min

Class Diagram. UML with fields, methods, and relationships (inheritance/composition/association).

Step 4 · ~10 min

Patterns + Sequence. Identify variation points, apply 2–4 GoF patterns. Sequence diagram for the primary flow.

Step 5 · ~12 min

Java Code. Enums → interfaces → entity classes → service → main(). One end-to-end happy path that compiles in your head.

Buffer · ~5 min

Trade-offs & Q&A. Cross-questions on extension points, concurrency, and "what would you change?"

The phase boundaries matter. If you're still talking about requirements at minute 15, you're going to run out of time before the code. If you start coding at minute 10, you'll write a class for an entity you haven't named yet and get tangled. The framework isn't optional — it's the only way to fit five distinct activities into 45 minutes without one of them eating the others.
Foundations

SOLID — The Spine of Every LLD Answer

Before you walk into the interview, the five SOLID principles need to be loaded into RAM, not on the disk. They are the vocabulary the interviewer expects you to think in — every design decision you make should map back to one of them. Here they are in plain English, with the one-sentence test that tells you whether you're following them.

S — Single Responsibility

Every class has one reason to change. The Invoice class shouldn't know how to print itself; that's the printer's job.

The test: can you describe what the class does in one sentence without using "and"? If not, split it.

O — Open/Closed

Open for extension, closed for modification. Adding a new payment method shouldn't require editing the existing payment processor.

The test: can you add a new variant by writing a new file (not editing an old one)? If not, you're missing an interface.

L — Liskov Substitution

A subclass must be usable wherever its parent is, without surprises. If Square extends Rectangle and setting width changes height, you've broken Liskov.

The test: can the caller use any subclass without checking instanceof? If they need if (obj instanceof Square), the hierarchy is wrong.

I — Interface Segregation

Many small interfaces beat one fat one. Don't force JsonReader to implement writeXml() just because it sits in the same hierarchy.

The test: does any implementation throw UnsupportedOperationException? You've combined unrelated capabilities — split the interface.

D — Dependency Inversion

Depend on abstractions, not concretions. The OrderService shouldn't new MySQLOrderRepo() — it should accept a OrderRepository interface in its constructor and let the wiring decide which implementation to inject.

The test: can you swap MySQL for an in-memory store in the unit tests without changing OrderService? If yes, you're inverted. If you have to mock the database driver, you're not.

The narrative move. When the interviewer asks "why did you put pricing behind an interface?" the answer is "Open/Closed — pricing rules change every quarter, and I want a new strategy to be a new file, not a new if." That kind of answer — where every design choice is named with a SOLID principle — is what separates a senior signal from a junior one. You're not just building a thing; you're building it according to a stated principle, and you can quote the principle at any moment.
The Question Bank

Common LLD Question Types — A Field Guide

LLD prompts cluster into a handful of recognisable shapes. Once you know the shape, you know which patterns to reach for and which traps to avoid. Here's the field guide — keep it loaded in your head before the interview so you can categorise the prompt within ten seconds of hearing it.

Shape Examples Reach For The Trap
State Machine Vending Machine, Elevator, ATM, Order/Booking lifecycle State pattern, enums for events, transition table If/else chains in every method instead of one State class per state
Resource Allocation Parking Lot, Hotel, Movie Booking, Library Strategy for allocation rules, Singleton for the registry, locks on the spot/seat Race condition: two users booking the same spot — answer this before being asked
Game / Rules Engine Snake & Ladders, Tic-Tac-Toe, Chess, Poker Strategy for moves, Observer for game events, Command for undo Hard-coding the rules into the Game class instead of Piece subclasses
Marketplace / Aggregator Swiggy, Uber, MakeMyTrip, Splitwise, Stack Overflow Factory for vendor adapters, Decorator for surge/discount, Observer for notifications Forgetting that the matchmaking algorithm is itself a Strategy
Pub-Sub / Notification Notification Service, Logger, Event Bus, Stock-price ticker Observer, Chain of Responsibility, Strategy per channel Synchronous fan-out blocking the producer — must mention async/queue
Data Structure as a System LRU Cache, In-memory File System, URL Shortener (LLD), Rate Limiter Composite for trees, custom doubly-linked-list-plus-hashmap, concurrency primitives Skipping straight to code without naming the responsibilities of each class
Pattern-recognition is the cheat code. Hearing "design a parking lot" should immediately summon "resource allocation → Strategy + Singleton + race-condition discussion". Hearing "design a vending machine" should summon "state machine → State pattern + enum events". The first 30 seconds of the interview is silently classifying the prompt; the next 44 minutes is executing the playbook for that class.
Anti-patterns

What You'll Get Wrong (If You Don't Read Part 2)

Every interviewer has a mental list of red flags. Most of them aren't about technical knowledge — they're about process and tone. Here are the six that kill more LLD loops than any other.

🚨 Diving into code at minute 5

Candidate hears "design an elevator" and starts writing class Elevator { ... } without naming the requirements, the entities, or the relationships. The result is always the same: 30 minutes in, you realise you needed a Request queue but you've already wired Elevator to take a floor directly, and now you're refactoring on the whiteboard.

Fix: nothing gets written until Step 4. The first four steps are diagrams and lists.

🚨 Pattern-dropping for points

Candidate name-drops "I'll use the Visitor pattern, the Memento pattern, and the Bridge pattern" for a vending machine that needs none of them. The interviewer asks "why Visitor?" and the candidate folds. Naming a pattern you can't justify is worse than not naming one.

Fix: two to four patterns, max. Each one tied to a specific class and a specific reason in one sentence.

🚨 Inheritance-everywhere

Every relationship becomes a class hierarchy. Car extends Vehicle, SUV extends Car, HybridSUV extends SUV. By depth four nothing is overrideable without breaking a sibling. Inheritance is a one-way door — composition is reversible.

Fix: default to composition. Use inheritance only for genuine "is-a" relationships where the subclass adds behaviour, not just fields.

🚨 Forgetting concurrency

Two users hit "book this seat" at the same millisecond. Both succeed. The interview is over.

Fix: any time you have a shared mutable resource (a parking spot, a movie seat, an inventory count), say out loud — "this needs synchronisation; I'll use a per-row lock / atomic CAS / optimistic concurrency" — even if the interviewer doesn't ask.

🚨 Designing in silence

Candidate goes head-down for 20 minutes, draws a beautiful UML diagram, then turns around. The interviewer has no idea why any of those choices were made and can't grade the reasoning. It doesn't matter how good the design is — silence fails the communication pillar.

Fix: narrate every decision. "I'm putting Spot behind an interface because the parking lot has bike, car, and truck spots and they have different size constraints."

🚨 Boilerplate-heavy code

With 12 minutes for code, the candidate writes 4 minutes of getter/setter boilerplate, leaves no time for the actual logic. The interviewer learns nothing about how you'd implement parkVehicle().

Fix: say "I'll skip getters/setters and Lombok this in production." Use Java records or just write public fields on the whiteboard. Spend the time on the methods that matter.

The pattern under the patterns. Five of these six failures are about process — order of operations, narration, and time allocation — not about technical depth. That's why a framework matters more than memorising 23 GoF patterns. The framework is what stops you from making the process mistakes.
Where Next

Up Next — From Theory to Playbook

This page told you what LLD is and why the four pillars matter. The next two pages turn that into a usable playbook: a 5-step framework you can run on any prompt, and a pattern catalogue you can pull from when you spot a variation point.

The bigger arc. Part 1 (this page) gives you the vocabulary. Part 2 gives you the verbs — the actions in order. Part 3 gives you the toolbox — the named tools you'll point at during Step 4. Read them in order, then run the framework on three problems from the question bank above. By the third problem, the framework will feel like muscle memory.