All Posts

Low-Level Design Guide: Your Complete Learning Roadmap

Navigate 8 LLD problems in the right order: which OOP skills each one builds, what interviewers evaluate, and how Phase 1 feeds Phase 2.

Abstract AlgorithmsAbstract Algorithms
Β·Β·20 min read
Share
Share on X / Twitter
Share on LinkedIn
Copy link

TLDR

TLDR: LLD interviews ask you to design classes and interfaces β€” not databases and caches.This roadmap sequences 8 problems across two phases: Phase 1 (6 beginner posts) builds your core OOP vocabulary through increasingly complex domains; Phase 2 (2 advanced posts) stress-tests that vocabulary with production-grade implementations and multi-pattern systems. Read in order, not randomly.


πŸ“– LLD vs HLD: Why These Two Interview Types Test Completely Different Skills

LLD interviews trip up engineers because they study for the wrong thing. Walk into an LLD round armed with Redis eviction policies and Kafka partition strategies, and you will spend 45 minutes answering a question the interviewer never asked.

Low-Level Design (LLD) asks you to model a single system component in objects. The deliverable is a class diagram, interface contracts, SOLID justification, and a clear explanation of which OOP patterns you chose and why. The interviewer is evaluating your ability to decompose a domain into cohesive classes with the right relationships and responsibilities.

High-Level Design (HLD) asks you to architect a system across services, data stores, and networks. Databases, caches, queues, and load balancers are all on the table. HLD evaluates breadth of systems thinking; LLD evaluates depth of OOP fluency.

DimensionLow-Level Design (LLD)High-Level Design (HLD)
Primary deliverableClass diagram + interface contractsArchitecture diagram + data flow
OOP required?Yes β€” it is the core evaluation criterionRarely; services and storage dominate
SOLID principlesExplicitly mapped to specific classesNot typically evaluated
Databases and cachesOut of scopePrimary topic
Design patternsRequired (State, Strategy, Observer, etc.)Optional and high-level
Typical interview duration45–60 min on one component45–60 min on a full distributed system
Example questionDesign an LRU Cache classDesign a distributed caching layer

The single most important mindset shift: in LLD, you are building a software model, not an infrastructure blueprint. Every minute you spend discussing horizontal scaling in an LLD round is a minute you did not spend showing OOP mastery.


πŸ” The Four OOP Pillars Every LLD Interview Evaluates

Interviewers do not ask "name the four pillars" β€” they evaluate whether your design demonstrates them. Each LLD problem in this series is chosen because it makes one or more pillars visible and non-trivial to implement.

Encapsulation β€” Internal state is hidden behind methods. An ElevatorCar should expose requestFloor(int floor), not a public stop queue. When your classes leak implementation details through public fields, interviewers notice.

Abstraction β€” Interfaces and abstract classes expose what a component does, not how. A ParkingSpot abstraction lets the allocation strategy remain independent of whether the spot is for a motorcycle, car, or truck.

Inheritance β€” Shared behavior is factored into base classes; subclasses specialize without duplicating. A Vehicle hierarchy (Car, Truck, Motorcycle) captures this naturally. Overusing inheritance β€” particularly for code reuse rather than IS-A relationships β€” is a common interview mistake.

Polymorphism β€” The same interface behaves differently depending on the concrete type. ElevatorState.handle(event) resolves differently for IdleState, MovingUpState, and DoorOpenState. This pattern recurs across almost every LLD problem in Phase 1.

OOP PillarPrimary LLD problem where it is centralWhat the interviewer evaluates
EncapsulationLRU Cache, Parking LotPrivate state, public API contract
AbstractionElevator System, Movie BookingInterface breadth and naming clarity
InheritanceParking Lot, Tic-Tac-ToeIS-A vs HAS-A decisions
PolymorphismElevator System, Ride Booking AppState transitions, strategy selection

βš™οΈ How This Two-Phase Roadmap Sequences Your LLD Practice

The eight posts in this series are not interchangeable. Each problem reinforces a specific OOP concept, and later problems build on patterns introduced earlier. Reading them out of sequence creates gaps that surface in interviews as vague answers and incomplete designs.

Phase 1 introduces OOP fundamentals through six beginner-level systems. Each system is narrow enough that you can complete a full class diagram in 45 minutes, but rich enough to reveal real design trade-offs. By the end of Phase 1, you have a working vocabulary: state machines, encapsulation contracts, polymorphic dispatch, eviction policies, vehicle hierarchies, seat-locking concurrency primitives.

Phase 2 gives that vocabulary a stress test. The two advanced posts β€” a full Java Spring Boot parking lot implementation and the Uber/Lyft ride booking system β€” introduce multi-pattern designs, concurrent state management, and production edge cases that Phase 1 problems abstract away. If you attempt Phase 2 without Phase 1, you will encounter design decisions that feel arbitrary. With Phase 1 complete, those decisions have rationale.

PhasePost countComplexity levelPrimary learning outcome
Phase 16 posts🟒 BeginnerBuild OOP vocabulary problem by problem
Phase 22 postsπŸ”΄ AdvancedApply vocabulary under production-grade constraints

🧠 Deep Dive: What a Complete LLD Answer Looks Like Under the Hood

Knowing the vocabulary is not enough. Interviewers are evaluating the structure of your answer β€” in what order you deliver information, how precisely you name things, and whether your design decisions are traceable to explicit principles.

The Internals of a Strong LLD Answer: Class Diagrams, SOLID, and Interface Contracts

A complete LLD answer has four identifiable layers:

1. Requirements and scope clarification. Before drawing anything, state what the system must do and explicitly acknowledge what is out of scope. In a Movie Booking system, "I'm modeling seat selection and booking state β€” payment processing and notification delivery are out of scope for this session" is a strong opening. It shows you distinguish LLD boundaries from full product scope.

2. OOP pillar mapping. Walk through the domain and identify where each OOP pillar appears naturally. For each class or interface, name which pillar it primarily demonstrates. This gives the interviewer a structured window into your design thinking.

3. SOLID principle application. Map at least three SOLID principles to specific design decisions. Single Responsibility (each class has one reason to change), Open/Closed (add new vehicle types without modifying the allocator), Liskov Substitution (any ParkingSpot subtype can be used wherever a ParkingSpot is expected), Interface Segregation (separate Bookable from Reservable rather than one fat interface), Dependency Inversion (depend on the DispatchStrategy interface, not a concrete implementation).

4. Interface contracts. For every interface in your design, state its purpose, its key methods, and the invariant it enforces. "The EvictionPolicy interface has one method β€” evict(cache) β€” and its contract is that it always removes exactly one entry and leaves the cache internally consistent."

Answer layerWhat the interviewer hears if absent
Requirements clarification"Does not understand scope boundaries"
OOP pillar mapping"Knows the terms but cannot apply them"
SOLID mapping"Has heard of SOLID but cannot design to it"
Interface contracts"Produces a class diagram, not a design"

Performance Analysis: How to Allocate Your 45 Minutes

Time management is a non-trivial skill in LLD interviews. Most engineers either sketch everything at the surface level (no depth) or go deep on one class and run out of time (no breadth).

A reliable allocation:

  • 0–5 min: Clarify requirements, state scope, name the key entities
  • 5–15 min: Sketch the class diagram β€” all classes, key relationships, interface names
  • 15–30 min: Walk through OOP pillar mapping and SOLID decisions out loud
  • 30–40 min: Drill into one or two complex classes in detail (state machine, eviction policy, concurrency primitive)
  • 40–45 min: Summarize trade-offs and mention what you would add with more time

This structure applies to every problem in the series. As you work through Phase 1, practice this allocation explicitly β€” not just the design, but the pacing.


πŸ“Š The Full Learning Path Visualized: Phase 1 to Phase 2

The diagram below shows the complete learning sequence. Each Phase 1 node names the primary OOP skill it teaches. Phase 2 nodes show which Phase 1 skills they build on.

graph TD
    A([πŸš€ Start Here]) --> B[Phase 1: OOP Fundamentals]

    B --> C["1. Elevator System\nβ€” State Machine Β· Dispatcher Pattern"]
    B --> D["2. LRU Cache\nβ€” HashMap + Doubly Linked List Β· Eviction Policy"]
    B --> E["3. Parking Lot System\nβ€” Vehicle Hierarchy Β· Allocation Strategy"]
    B --> F["4. URL Shortener\nβ€” Encoding Β· Collision Handling Β· Expiry"]
    B --> G["5. Tic-Tac-Toe\nβ€” Board Abstraction Β· Win Detection Β· Extensibility"]
    B --> H["6. Movie Booking System\nβ€” Seat Locking Β· Booking States Β· Concurrency"]

    C & D & E & F & G & H --> I([Phase 1 Complete:\nOOP Vocabulary Established])

    I --> J[Phase 2: Production-Grade LLD]

    J --> K["7. Parking Lot: Full Java Implementation\nβ€” Spring Boot Β· Edge Cases Β· Full OOP Model"]
    J --> L["8. Ride Booking App\nβ€” Driver–Rider Matching Β· Trip State Machine Β· Pricing Strategy"]

    K & L --> M([βœ… LLD Interview Ready])

    style A fill:#4ade80,color:#000
    style I fill:#60a5fa,color:#000
    style M fill:#f59e0b,color:#000

The six Phase 1 problems are independent of each other in terms of domain, but collectively they cover the full OOP surface area the interviewer will probe. Complete all six before moving to Phase 2. Skipping any Phase 1 post leaves a gap in a specific OOP concept that Phase 2 will expose.


🌍 Real-World Application: The Eight LLD Problems in This Series

Phase 1 β€” Building Your OOP Vocabulary (Beginner)

Each post is a standalone design exercise. Work through them in order; the skills column shows exactly what you gain.

#PostOOP Skills BuiltKey Design PatternNext Up
1LLD for Elevator System: Designing a Smart LiftState machine design Β· OOP fundamentals Β· Dispatcher patternState Pattern, Strategy PatternLRU Cache
2LLD for LRU Cache: Designing a High-Performance CacheDoubly linked list + HashMap Β· Eviction policy as interfaceDecorator conceptParking Lot
3LLD for Parking Lot System: Designing a Smart GarageVehicle type hierarchy Β· Spot type abstraction Β· Allocation strategyFactory Pattern, Strategy PatternURL Shortener
4LLD for URL Shortener: Designing TinyURLEncoding schemes Β· Collision handling Β· TTL and expiry logicTemplate Method, BuilderTic-Tac-Toe
5LLD for Tic-Tac-Toe: Designing an Extensible OOP GameBoard abstraction Β· Win condition detection Β· Extensibility via interfacesCommand Pattern, ObserverMovie Booking
6LLD for Movie Booking System: Designing BookMyShowSeat locking primitive · Booking state transitions · Concurrency guardsState Pattern, Template Method→ Phase 2

Phase 2 β€” Stress-Testing Your Vocabulary (Advanced)

Phase 2 posts assume Phase 1 OOP vocabulary is solid. They introduce full implementations, multiple concurrent patterns, and production edge cases.

#PostBuilds OnNew Skills IntroducedComplexity Bump
7Implement LLD for Parking Lot: Code WalkthroughPhase 1 Parking Lot designFull Java Spring Boot implementation Β· Edge case coverage Β· Unit test designπŸ”΄ Advanced
8LLD for Ride Booking App: Designing Uber/LyftPhase 1 Elevator (State) + Parking Lot (Strategy)Driver–rider matching algorithm Β· Multi-state trip machine Β· Dynamic pricing strategyπŸ”΄ Advanced

OOP Concept Coverage Across the Full Series

The table below maps every major OOP concept to the posts that treat it most directly. Use this as a quick-reference when you know the concept you need to drill.

OOP ConceptPrimary post(s)Secondary post(s)
State machine designElevator SystemRide Booking App
Encapsulation contractsLRU CacheMovie Booking System
Inheritance hierarchiesParking Lot SystemImplement Parking Lot
Interface segregationURL ShortenerTic-Tac-Toe
Strategy PatternElevator SystemRide Booking App
Observer PatternTic-Tac-ToeRide Booking App
Concurrent state managementMovie Booking SystemImplement Parking Lot
Full OOP domain modelImplement Parking LotRide Booking App

βš–οΈ Trade-offs and Failure Modes: Which Problems to Prioritize by Timeline

Not everyone has time to work through all eight posts before an interview. The guidance below helps you make smart trade-offs between coverage depth and breadth depending on how much time you have.

The core failure mode in LLD preparation is conflating coverage with readiness. Reading eight post summaries without designing anything is not preparation β€” it is trivia accumulation. One problem fully internalized (class diagram drawn from memory, OOP mapping articulated aloud, SOLID decisions justified) is more valuable than eight problems skimmed.

TimelinePriority postsTrade-off accepted
1 dayElevator System + LRU CacheDeep on State Pattern and encapsulation; weak on allocation strategies and concurrency
3 daysPosts 1–3 (Elevator, LRU, Parking Lot)Solid fundamentals; limited exposure to extensibility patterns and concurrent booking
1 weekAll 6 Phase 1 postsFull vocabulary coverage; no Phase 2 production depth
2 weeksAll 8 postsFull series completion; can reason about edge cases and production constraints

Where engineers go wrong on timeline:

  • Starting with Phase 2 because the problems sound more impressive. Phase 2 without Phase 1 produces surface-level answers that collapse under follow-up questions.
  • Spending 80% of time on domains they enjoy. The Movie Booking system feels approachable but its primary value is the concurrency primitive β€” not the booking flow itself.
  • Treating the series as reading material rather than practice. For each post, draw the class diagram independently before reading the solution. Compare, identify gaps, redraw.

🧭 Decision Guide: Which Post to Read First

SituationRecommendation
First LLD interview, no prior OOP design experienceStart with Elevator System β€” it is the most complete introduction to state machines and the Dispatcher pattern
Comfortable with OOP but weak on data-structure-backed designsGo straight to LRU Cache β€” HashMap + DoublyLinkedList is the most commonly tested LLD pattern
Interview at a company known for parking/fleet/logistics domainsPrioritize Parking Lot System (Phase 1) + Implement Parking Lot (Phase 2) back to back
Interview at a mobility or marketplace company (Uber, Lyft, Grab)Prioritize Ride Booking App after completing Elevator System for State Pattern grounding
One week, comprehensive preparationFollow the full Phase 1 sequence in numbered order, then Phase 2
Returning for a re-attempt after a failed LLD roundRead the LLD Interview Checklist in this post, identify which layer was weak in your answer, then target the corresponding post

πŸ§ͺ The LLD Interview Checklist: What Examiners Actually Look For

Use this checklist before and after every practice session. Examiners are running through a mental version of this list while you design.

Requirements and Scope (first 5 minutes)

  • [ ] Named the key entities before drawing anything
  • [ ] Explicitly stated what is out of scope
  • [ ] Asked at least one clarifying question before proceeding

OOP Pillars (visible in the class diagram)

  • [ ] Encapsulation: all mutable state is private; public API is minimal and intentional
  • [ ] Abstraction: interfaces name what not how; interface names are domain-meaningful
  • [ ] Inheritance: used for IS-A relationships only; composition preferred for HAS-A
  • [ ] Polymorphism: at least one interface has multiple implementations; dispatch is runtime, not conditional

SOLID Principles (articulated out loud during the walk-through)

  • [ ] Single Responsibility: each class has one reason to change; named that reason explicitly
  • [ ] Open/Closed: extension points identified; concrete implementations replaceable without modifying callers
  • [ ] Liskov Substitution: no subclass breaks the contract of its parent; overrides strengthen, not weaken, guarantees
  • [ ] Interface Segregation: no fat interfaces; clients implement only what they use
  • [ ] Dependency Inversion: high-level classes depend on abstractions; concrete wiring happens at construction

Class Diagram Completeness

  • [ ] All major classes present and named
  • [ ] Relationship types labeled: extends, implements, has-a, uses
  • [ ] Cardinalities shown where relevant (1-to-many, many-to-many)

Design Patterns (named and justified)

  • [ ] At least one pattern named explicitly with rationale for choosing it
  • [ ] Described what problem the pattern solves in this specific domain

Closing Summary

  • [ ] Stated key trade-offs in the design (e.g., simplicity vs. extensibility)
  • [ ] Named one thing you would add with more time

πŸ“š Lessons Learned from the Most Common LLD Interview Mistakes

Engineers who have worked through this series and then practiced mock LLD interviews consistently report the same failure modes before their preparation was complete:

Mistake 1: Jumping to the class diagram without naming entities first. The class diagram is the output of your thinking, not the starting point. Interviewers watch how you arrive at the diagram. Naming entities, grouping them by responsibility, and then drawing the structure shows systematic thinking. Drawing lines between boxes and naming them afterward looks like improvisation.

Mistake 2: Using inheritance where composition is more appropriate. The BookingManager does not extend SeatManager β€” it uses it. IS-A vs HAS-A confusion appears in almost every first-attempt LLD design. The Parking Lot system is the best exercise for building this instinct because ParkingLot, Floor, ParkingSpot, and Vehicle all have strong composition relationships that are tempting to model as inheritance.

Mistake 3: Generic interface names. IManager, IService, and IHandler tell the interviewer nothing. EvictionPolicy, DispatchStrategy, BookingStateMachine β€” these names reveal that you modeled the domain, not just the code structure.

Mistake 4: Not justifying SOLID. Most engineers include the SOLID acronym in their answer but do not map principles to specific classes. "This design is SOLID" is a claim. "The DispatchStrategy interface is the Open/Closed principle in practice β€” I can add NearestElevatorStrategy without touching ElevatorController" is a justification.

Mistake 5: Treating Phase 2 as a shortcut to Phase 1. The Ride Booking App answer depends on the State Pattern fluency that Elevator System builds, and on the Strategy Pattern precision that the Parking Lot introduces. Attempting the Ride Booking App first produces a design that mimics the structure without understanding the decisions.


πŸ“Œ Summary & Key Takeaways

  • LLD and HLD are distinct interview formats. LLD evaluates OOP design skill; HLD evaluates distributed systems thinking. Mixing up preparation for these two is the primary reason engineers underperform in LLD rounds.
  • The four OOP pillars β€” Encapsulation, Abstraction, Inheritance, Polymorphism β€” must be demonstrably present in your class diagram, not just named.
  • SOLID is evaluated through justification, not recitation. Map each applicable principle to a specific class or interface in your design.
  • Phase 1 (6 beginner posts) builds vocabulary. Phase 2 (2 advanced posts) applies that vocabulary under production-grade complexity. The order is a dependency, not a preference.
  • The LLD Interview Checklist in this post covers every layer examiners evaluate. Measure your practice sessions against it explicitly.
  • One problem fully internalized is worth more than eight problems skimmed. Draw the class diagram from memory, articulate the OOP mapping out loud, and justify SOLID decisions before checking the post's solution.
  • The single sentence to remember: In LLD, the class diagram is the proof of your thinking β€” not its starting point.

πŸ“ Practice Quiz: Which Post Covers Which OOP Concept?

Use this quiz to check whether you can map OOP concepts and design patterns to the right posts in the series. This is exactly the kind of associative recall an LLD interview tests.

  1. The Elevator System post introduces which design pattern to handle direction and door-open transitions?

    • A) Observer Pattern
    • B) State Pattern
    • C) Factory Pattern Correct Answer: B
  2. Which Phase 1 post is the most direct preparation for the Ride Booking App in Phase 2?

    • A) LRU Cache, because it covers the eviction policy interface structure
    • B) Movie Booking System, because it covers concurrent seat locking
    • C) Elevator System, because it establishes State Pattern and Strategy Pattern fluency that the Ride Booking App extends Correct Answer: C
  3. An interviewer asks you: "How does your Parking Lot design satisfy the Open/Closed Principle?" Which class or interface from the Phase 1 Parking Lot post is the correct answer anchor?

    • A) The ParkingLot class itself, because it manages all spot types
    • B) The AllocationStrategy interface, because new allocation algorithms can be added without modifying the lot's core logic
    • C) The Vehicle base class, because all vehicle types extend it Correct Answer: B
  4. Open-ended challenge: You have 48 hours before an LLD interview and have not studied OOP design before. Which two Phase 1 posts would you prioritize and what specific SOLID principle would you make sure you can justify for each? Explain your reasoning.


Abstract Algorithms

Written by

Abstract Algorithms

@abstractalgorithms