Chapter 1 · Lesson 1

What Is Low-Level Design?

Distinguish HLD from LLD, learn what interviewers actually score, and see how a typical LLD round unfolds.
Zooming from the High-Level Design altitude of services, databases, and queues down into the Low-Level Design of classes and interfaces inside one box. 10,000 FT · HIGH-LEVEL DESIGN API Gateway Matching service Trip service Database Queue Load balancer zoom in 100 FT · LOW-LEVEL DESIGN Matching service «interface» MatchingStrategy class MatchingService NearestDriverStrategy Trip
Two altitudes of the same feature: HLD arranges services, databases, and queues, then you zoom into one box and design its classes and interfaces.

Distinguish High-Level from Low-Level Design, understand what companies actually evaluate in an LLD round, and see how the typical interview unfolds.

🎯 Hook

You're 12 minutes into an interview. The interviewer says, "Design a parking lot." You start typing a main() method. Forty minutes later you have 200 lines of code, three nested if-ladders, and a panicked feeling that none of it is designed. You didn't fail because you can't code — you failed because nobody taught you what "design" actually means at this altitude. That's what this lesson fixes.

Concept: two altitudes of design

High-Level Design (HLD) is the 10,000-foot view: services, databases, queues, load balancers, network boundaries. It answers "how do the big boxes talk, and how does this scale to millions of users?"

Low-Level Design (LLD) is the 100-foot view: the classes, interfaces, methods, and relationships inside one of those boxes. It answers "how is this component structured so it's correct, readable, and easy to extend?" LLD is where object-oriented thinking, SOLID, and design patterns live.

AspectHigh-Level DesignLow-Level Design
Unit of thoughtServices & data storesClasses & interfaces
Key concernsScalability, availability, latencyExtensibility, readability, correctness
Typical artifactArchitecture diagramClass / sequence diagram + code
Example question"Design Twitter's timeline""Design the Tweet & Feed classes"

The two meet in the middle. In a full system-design interview you sketch the HLD, then the interviewer zooms into one box and says "now design this part properly" — and you're in LLD territory.

flowchart TD A["Product requirement<br/>(Design a ride-sharing app)"] --> B["HLD: services, DBs, queues"] B --> C["Zoom into one service<br/>(Matching service)"] C --> D["LLD: classes, interfaces,<br/>relationships, patterns"] D --> E["Clean, extensible code"]

Java in action: same feature, two altitudes

HLD says "a Matching service assigns drivers to riders." LLD turns that sentence into types with clear responsibilities — note how the strategy is an interface, so the matching rule can change without touching the service:

// LLD: the "inside" of the matching box, expressed as collaborating objects.
interface MatchingStrategy {
    Driver selectDriver(Rider rider, List<Driver> nearbyDrivers);
}

class NearestDriverStrategy implements MatchingStrategy {
    public Driver selectDriver(Rider rider, List<Driver> nearbyDrivers) {
        return nearbyDrivers.stream()
                .min(Comparator.comparingDouble(d -> distance(rider, d)))
                .orElseThrow(() -> new NoDriverAvailableException(rider.getId()));
    }
    private double distance(Rider r, Driver d) { /* haversine */ return 0; }
}

class MatchingService {
    private final MatchingStrategy strategy;          // depend on the abstraction
    MatchingService(MatchingStrategy strategy) { this.strategy = strategy; }

    Trip assign(Rider rider, List<Driver> nearby) {
        Driver driver = strategy.selectDriver(rider, nearby);
        return new Trip(rider, driver);
    }
}

This is what "good LLD" looks like at a glance: small types, one job each, and a seam (MatchingStrategy) where future change is expected. We'll build up every technique used here over the coming sections.

What companies actually evaluate

Interviewers are not grading whether your code compiles. They score signals:

  • Requirement handling — did you clarify before coding, or assume?
  • Abstraction — did the right classes and interfaces emerge?
  • Extensibility — can a new requirement be added without rewriting everything?
  • Communication — did you think out loud and justify trade-offs?
  • Pragmatism — did you avoid both under- and over-engineering?

The typical interview flow

sequenceDiagram participant I as Interviewer participant C as Candidate I->>C: "Design X" C->>I: Clarifying questions (scope, scale, features) I-->>C: Constraints & priorities C->>C: Identify entities & relationships C->>I: Sketch class diagram, explain choices C->>C: Code core classes I->>C: "What if requirement Y changes?" C->>I: Extend design, discuss trade-offs
✍️ Exercise

Take any app on your phone and write two sentences: one HLD sentence (the big boxes and how they connect) and one LLD sentence (name 3–4 classes inside one box and what each is responsible for). Example for Spotify → HLD: "Clients hit an API gateway that fans out to a catalog service, a streaming service, and a recommendation service backed by their own stores." LLD (catalog): "Track, Album, Artist, and a CatalogRepository that looks them up." Do this for three apps — it trains the altitude switch you'll need on demand.

🎤 Interview connection & traps
  • ⚠️ Trap: jumping to code. Spending the first minute typing instead of clarifying is the single most common reason strong coders fail LLD rounds.
  • ⚠️ Trap: answering HLD when asked LLD. If they say "design the classes for X," don't start talking about sharding and Kafka — zoom in.
  • ⚠️ Trap: silence. Unspoken good design scores lower than narrated decent design. The interviewer grades what they hear.
Lesson Summary
  • LLD is the class-level design inside one HLD box — its currency is interfaces, responsibilities, and relationships, not servers and queues.
  • Interviews grade signals, not syntax: clarifying, abstraction, extensibility, communication, and pragmatism.
  • The flow is predictable: clarify → model → diagram → code → extend. The rest of this course turns that flow into a repeatable framework.