LLD Cheat Sheet
Intermediate · 12 min read · Low-Level Design, Revision
Principles, patterns, concurrency tools and case-study one-liners on one page.
A one-page revision sheet for LLD rounds. Every entry links to its full lesson.
The round
Requirements (use cases + variation points + concurrency) → entities & relationships (noun–verb) → class diagram with interfaces at variation points → core flows → working code first → extensions, concurrency, tests. (Framework)
OOP essentials
Principles
(SOLID, Core principles)
Patterns in one line each
Creational
Concurrency toolkit
Never hold a lock across slow external calls (payments, network). (Concurrency)
Code-quality checklist
Packages (model / strategy / repository / service / exception) · value objects & enums · validate at boundaries · specific exceptions · small methods, intention-revealing names · inject dependencies and Clock · unmodifiable collections · runnable demo · a few tests. (Interview-grade code, Code smells & refactoring)
Schema checklist
Entities → tables · value objects → columns · enums → CHECKed text · composition → ON DELETE CASCADE · invariants → CHECK, UNIQUE, partial unique ("one active"), exclusion (no overlapping ranges) · claim with a conditional UPDATE and check the row count · lock rows in id order · indexes from queries (equality columns…
Case-study one-liners
Key takeaways
- Clarify the requirements first, then entities, a class diagram with interfaces at the variation points, the core flows, and code.
- Strategy and State solve most machine-coding problems; name the requirement each pattern serves.
- Guard shared state explicitly: atomic claims, consistent lock ordering, short critical sections.
- Model money as integers, time with an injected Clock, and illegal states as impossible through value objects and enums.
- Get a clean core running early, then extend it; a working, well-structured core beats an ambitious half-finished design.