LLD / Machine Coding Fundamentals
Everything you need before tackling machine-coding problems. These concepts are what interviewers grade on โ not clever algorithms, but how well you organize code under time pressure.
Each topic below is a standalone guide with code in Java, C++, and Python, Mermaid diagrams, and links to the LLD problems that use it.
LLD Fundamentals โ Learning Tracker
Track your progress through all 20 topics. Sign in to save across devices.
The Round
| # | Concept | Deep Dive |
|---|---|---|
| 1 | Machine Coding Round (Format, Grading, Timing) | Read โ |
| 2 | The 5-Minute Design Sketch (How to Start Any Problem) | Read โ |
| 3 | UML Class Diagrams (Relationships, Notation) | Read โ |
| 4 | Over-Engineering and YAGNI (When NOT to Use Patterns) | Read โ |
Principles
| # | Concept | Deep Dive |
|---|---|---|
| 5 | SOLID Principles (SRP, OCP, LSP, ISP, DIP) | Read โ |
| 6 | Inheritance vs Composition (When to Use Which) | Read โ |
| 7 | Exception Handling (Custom Hierarchies, Best Practices) | Read โ |
Design Patterns
| # | Concept | Deep Dive |
|---|---|---|
| 8 | Strategy Pattern (Runtime Algorithm Swapping) | Read โ |
| 9 | State Pattern (Clean State Transitions) | Read โ |
| 10 | Observer Pattern (Event-Driven Notifications) | Read โ |
| 11 | Factory Pattern (Simple, Method, Abstract) | Read โ |
| 12 | Builder Pattern (Fluent Object Construction) | Read โ |
| 13 | Singleton Pattern (Thread-Safe, When to Avoid) | Read โ |
| 14 | Composite Pattern (Tree Structures, Uniform Treatment) | Read โ |
| 15 | Command Pattern (Undo/Redo, Action Queues) | Read โ |
| 16 | Decorator Pattern (Dynamic Behavior Wrapping) | Read โ |
| 17 | Template Method Pattern (Algorithm Skeletons) | Read โ |
Advanced Topics
| # | Concept | Deep Dive |
|---|---|---|
| 18 | Concurrency (Locks, Thread Pools, Race Conditions) | Read โ |
| 19 | State Machines (Enum FSM, Transition Tables, Guards) | Read โ |
| 20 | Money Handling (BigDecimal, Minor Units, Ledgers) | Read โ |
Recommended Reading Order
If you are starting from scratch, follow this path:
- Machine Coding Round โ understand the format
- SOLID Principles โ the evaluation criteria
- Strategy Pattern โ the most common pattern
- State Pattern โ the second most common
- The 5-Minute Design Sketch โ how to start
- Try Parking Lot (uses Strategy + Factory)
- Try Vending Machine (uses State)
- Pick up remaining patterns as you encounter them in problems
After that, move to the 22 LLD Problems โ each one references the fundamentals it uses.