Low Level Design
A comprehensive guide to Low Level Design (LLD) interview preparation — covering OOP fundamentals, design patterns, UML diagrams, concurrency, and 33 real-world LLD interview problems with implementations.
Source: Content curated from awesome-low-level-design by Ashish Pratap Singh.
How to Use This Guide
LLD interviews test your ability to design class-level architectures:
- Master OOP fundamentals first — They’re the building blocks for every LLD question
- Learn design patterns — Recognize which pattern solves which problem
- Practice UML diagrams — Be able to sketch class diagrams quickly on a whiteboard
- Solve LLD problems — Start with Easy, progress to Hard. For each problem, try designing before looking at the solution
Tip: In LLD interviews, focus on identifying the right entities, relationships, and design patterns. A clean class hierarchy beats clever code.
OOP Fundamentals
Core object-oriented programming concepts you must know before tackling any LLD problem.
| Concept | Description |
|---|---|
| Classes and Objects | Blueprints and instances — the foundation of OOP |
| Enums | Type-safe constants for fixed sets of values |
| Interfaces | Contracts that define behavior without implementation |
| Encapsulation | Bundling data with methods, controlling access |
| Abstraction | Hiding complexity, exposing only essentials |
| Inheritance | Code reuse through parent-child class hierarchies |
| Polymorphism | One interface, many implementations |
Class Relationships
| Relationship | Description |
|---|---|
| Association | Objects that know about each other (has-a, loosely) |
| Aggregation | Whole-part where parts can exist independently |
| Composition | Whole-part where parts cannot exist without the whole |
| Dependency | One class uses another temporarily |
Design Principles
| Principle | Description |
|---|---|
| DRY (Don’t Repeat Yourself) | Every piece of knowledge should have a single representation |
| YAGNI (You Aren’t Gonna Need It) | Don’t build what you don’t need yet |
| KISS (Keep It Simple, Stupid) | Simplicity should be a key goal in design |
| SOLID Principles with Pictures | Visual guide to S.O.L.I.D. |
| SOLID Principles with Code | Code examples for each SOLID principle |
Design Patterns
The 23 Gang of Four (GoF) patterns organized by intent.
Creational Patterns
How objects are created — abstracting the instantiation process.
| Pattern | Key Idea |
|---|---|
| Singleton | Exactly one instance, global access point |
| Factory Method | Defer instantiation to subclasses |
| Abstract Factory | Create families of related objects |
| Builder | Construct complex objects step by step |
| Prototype | Clone existing objects instead of creating new |
Structural Patterns
How classes and objects are composed to form larger structures.
| Pattern | Key Idea |
|---|---|
| Adapter | Convert one interface to another |
| Bridge | Separate abstraction from implementation |
| Composite | Treat individual objects and compositions uniformly |
| Decorator | Add responsibilities dynamically |
| Facade | Simplified interface to a complex subsystem |
| Flyweight | Share objects to support large numbers efficiently |
| Proxy | Placeholder that controls access to another object |
Behavioral Patterns
How objects interact and distribute responsibility.
| Pattern | Key Idea |
|---|---|
| Iterator | Sequential access without exposing internals |
| Observer | Notify dependents when state changes |
| Strategy | Swap algorithms at runtime |
| Command | Encapsulate requests as objects |
| State | Alter behavior when internal state changes |
| Template Method | Define algorithm skeleton, let subclasses fill steps |
| Visitor | Add operations without modifying classes |
| Mediator | Centralize complex communications |
| Memento | Capture and restore object state |
| Chain of Responsibility | Pass request along a chain of handlers |
UML Diagrams
| Diagram | Purpose |
|---|---|
| Class Diagram | Structure of classes, attributes, methods, and relationships |
| Use Case Diagram | System functionality from the user’s perspective |
| Sequence Diagram | Interaction between objects over time |
| Activity Diagram | Workflow and control flow of a system |
| State Machine Diagram | State transitions of an object |
LLD Interview Problems
33 problems organized by difficulty. Each links to a problem description with requirements, class diagram, and multi-language implementations.
Easy (7 problems)
| # | Problem | Key Concepts |
|---|---|---|
| 1 | Design Parking Lot | Singleton, Factory, Observer |
| 2 | Design Stack Overflow | Singleton, Composite, Facade |
| 3 | Design a Vending Machine | State Pattern, Singleton |
| 4 | Design Logging Framework | Singleton, Strategy |
| 5 | Design Traffic Signal Control System | Singleton, Observer |
| 6 | Design Coffee Vending Machine | Singleton |
| 7 | Design a Task Management System | Singleton |
Medium (15 problems)
| # | Problem | Key Concepts |
|---|---|---|
| 1 | Design ATM | Template Method, Facade |
| 2 | Design LinkedIn | Singleton |
| 3 | Design LRU Cache | HashMap + Doubly Linked List |
| 4 | Design Tic Tac Toe Game | OO Decomposition |
| 5 | Design Pub Sub System | Observer |
| 6 | Design an Elevator System | Controller, Concurrency |
| 7 | Design Car Rental System | Singleton, Strategy |
| 8 | Design an Online Auction System | Singleton |
| 9 | Design Hotel Management System | Singleton, Strategy |
| 10 | Design a Digital Wallet Service | Singleton, Polymorphism |
| 11 | Design Airline Management System | Singleton |
| 12 | Design a Library Management System | Singleton |
| 13 | Design a Social Network like Facebook | Singleton |
| 14 | Design Restaurant Management System | Singleton |
| 15 | Design a Concert Ticket Booking System | Singleton |
Hard (11 problems)
| # | Problem | Key Concepts |
|---|---|---|
| 1 | Design CricInfo | Singleton (multi-service) |
| 2 | Design Splitwise | Singleton, Polymorphism |
| 3 | Design Chess Game | Strategy, Polymorphism |
| 4 | Design a Snake and Ladder Game | Singleton, Threading |
| 5 | Design Ride-Sharing Service like Uber | Singleton |
| 6 | Design Course Registration System | Singleton, Observer |
| 7 | Design Movie Ticket Booking System | Singleton |
| 8 | Design Online Shopping System like Amazon | Singleton |
| 9 | Design Online Stock Brokerage System | Singleton, Polymorphism |
| 10 | Design Music Streaming Service like Spotify | Singleton (multi-service) |
| 11 | Design Online Food Delivery Service like Swiggy | Singleton |
Concurrency & Multi-threading
Concepts
Concurrency 101
| Topic | Description |
|---|---|
| Introduction to Concurrency | Why concurrency matters in modern systems |
| Concurrency vs Parallelism | Interleaving vs simultaneous execution |
| Processes vs Threads | Isolation vs shared memory trade-offs |
| Thread Lifecycle and States | New, Runnable, Blocked, Waiting, Terminated |
| Race Conditions and Critical Sections | When shared state goes wrong |
Synchronization Primitives
| Primitive | Description |
|---|---|
| Mutex | Mutual exclusion — one thread at a time |
| Semaphores | Counting-based access control |
| Condition Variables | Wait for a condition to become true |
| Coarse vs Fine-grained Locking | Lock granularity trade-offs |
| Reentrant Locks | Locks a thread can acquire multiple times |
| Try-Lock and Timed Locking | Non-blocking lock acquisition |
| Compare-and-Swap (CAS) | Lock-free atomic operation |
Concurrency Challenges
| Challenge | Description |
|---|---|
| Deadlock | Circular wait causing permanent blocking |
| Livelock | Threads keep changing state but make no progress |
Concurrency Patterns
| Pattern | Description |
|---|---|
| Signaling Pattern | One thread notifies another |
| Thread Pool Pattern | Reuse a fixed set of threads |
| Producer-Consumer Pattern | Decouple production from consumption |
| Reader-Writer Pattern | Multiple readers, exclusive writers |
Concurrency Problems
| Problem | Description |
|---|---|
| Print FooBar Alternately | Coordinate two threads to alternate output |
| Print Zero Even Odd | Three threads printing in sequence |
| Fizz Buzz Multithreaded | Four threads coordinating FizzBuzz |
| Building H2O Molecule | Barrier synchronization |
| Design Thread-Safe Cache with TTL | Concurrent access + expiration |
| Design Concurrent HashMap | Segment locking, CAS |
| Design Thread-Safe Blocking Queue | Producer-consumer foundation |
| Design Concurrent Bloom Filter | Probabilistic data structure + concurrency |
| Multi-threaded Merge Sort | Divide-and-conquer parallelism |
LLD Interview Framework
Step-by-Step Approach (45 min)
0-5 min: CLARIFY REQUIREMENTS
- What are the core use cases?
- What entities are involved?
- Any constraints (single/multi-threaded, scale)?
5-15 min: IDENTIFY CLASSES & RELATIONSHIPS
- List the main entities (nouns = classes)
- Identify actions (verbs = methods)
- Determine relationships (is-a, has-a, uses)
15-35 min: DESIGN & IMPLEMENT
- Draw UML class diagram
- Apply relevant design patterns
- Write key class interfaces and methods
- Handle edge cases
35-45 min: REVIEW & DISCUSS
- Walk through a use case end-to-end
- Discuss extensibility ("What if we add X?")
- Address concurrency if relevant
Common Patterns in LLD Interviews
| When you see… | Think about… |
|---|---|
| Multiple states for an object | State Pattern |
| Need to notify multiple objects | Observer Pattern |
| Multiple algorithms for same task | Strategy Pattern |
| Complex object construction | Builder Pattern |
| Only one instance needed | Singleton Pattern |
| Pass request through handlers | Chain of Responsibility |
| Undo/redo functionality | Command + Memento |
| Treat group same as individual | Composite Pattern |
Resources
- awesome-low-level-design (GitHub) — Source repository with implementations in Java, Python, C++, C#, Go, TypeScript
- AlgoMaster LLD Course — Comprehensive LLD interview course
- AlgoMaster Concurrency Course — Concurrency & multi-threading course
- Head First Design Patterns — Visual guide to design patterns
- Clean Code — Writing maintainable code
- Refactoring — Improving existing code design