Roadmap › 0. Fundamentals › Step 6
LLD
Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#
How to turn requirements into classes — the LLD interview approach, identifying entities and responsibilities, UML class and sequence diagrams, applying SOLID and design patterns, designing APIs and database tables, concurrency in object design, and complete C# designs for parking lot, library management, elevator, vending machine, LRU cache, rate limiter, splitwise/expense sharing and movie ticket booking.
What it is & where it is used
Low-Level Design (also called object-oriented design or machine coding) answers: which classes, interfaces, methods and relationships implement this feature cleanly? It sits between HLD (boxes and arrows) and code.
| HLD | LLD |
|---|---|
| Services, databases, caches, queues | Classes, interfaces, enums, methods |
| Scale, availability, data distribution | Responsibilities, extensibility, patterns, testability |
| Diagrams: architecture | Diagrams: UML class and sequence |
| "Booking service talks to Payment service via a queue" | "BookingService.Book() uses ISeatLockProvider and IPaymentGateway" |
Interviewers check: clear entities, single responsibilities, use of interfaces, correct relationships (composition vs inheritance), sensible patterns (Strategy, Factory, State, Observer, Singleton used correctly), handling of edge cases and concurrency, and working code.
Versions & history
| Year | Milestone |
|---|---|
| 1967–1980 | Simula and Smalltalk introduce objects and classes |
| 1994 | Design Patterns by the Gang of Four (23 patterns) |
| 1997 | UML 1.1 standardised by the OMG (Booch, Rumbaugh, Jacobson) |
| 2000 | SOLID principles described by Robert C. Martin |
| 2003 | Domain-Driven Design (Eric Evans) |
| 2005 | UML 2.0 |
| 2010s | "Machine coding" rounds become common at product companies |
| 2020s | LLD + HLD rounds standard for senior developer interviews |
Lifecycle
LLD interview approach (45–60 minutes):
- Clarify requirements — list use cases; agree on scope (e.g. "parking lot: multiple floors, vehicle types, tickets, payment; no reservations").
- Identify entities (nouns) — Vehicle, Spot, Floor, Ticket, Payment…
- Identify behaviours (verbs) — park, unpark, calculate fee, pay.
- Define relationships — has-a (composition/aggregation), is-a (inheritance), uses (dependency).
- Draw a class diagram — classes, key fields, methods, interfaces, enums.
- Apply principles & patterns — SOLID, Strategy for varying rules, Factory for creation, State for lifecycles, Observer for notifications.
- Write code for the core flow; keep it compilable and readable.
- Discuss extensibility (new vehicle type?), concurrency (two cars, one spot), testing, and persistence (tables).
Tools used to develop
- UML: draw.io, PlantUML, Mermaid (class/sequence diagrams in Markdown), Visual Studio class designer, Lucidchart.
- Code: Visual Studio / Rider / VS Code with C#; xUnit for quick tests.
- Reading: Head First Design Patterns, refactoring.guru (patterns with C# examples), Clean Architecture.