Phase 12 · Low-Level Design (LLD) & Machine Coding
From HLD to classes: OOP, SOLID, patterns, concurrency, the LRU cache and classic LLD rounds.
- From HLD to LLD: The Bridge & The Machine-Coding Round: How HLD (high-level design) and LLD (low-level design) rounds differ and connect, the requirements → entities → class diagram → interfaces → patterns → concurrency → extensibility flow, a URL shortener taken from boxes to TypeScript classes, and how Indian product companies run and score 60–90 minute machine-coding rounds.
- OOP, SOLID & Modelling for LLD: The four pillars used for protecting invariants rather than as textbook vocabulary, composition over inheritance, interfaces vs abstract classes in TypeScript and Java, every SOLID principle as violation → fix, UML relationships in ASCII, cohesion and coupling, value objects and aggregates, and designing for testability with NestJS providers.
- Design Patterns & Concurrency for LLD: The thirteen patterns that actually appear in LLD and machine-coding rounds, each with when to use it, idiomatic TypeScript and the trap interviewers set, plus how to make an in-memory design safe under concurrency, from one event loop to worker_threads to many pods.
- LRU Cache: Implementation & The Follow-up Ladder: The most-asked LLD question, done properly: where an LRU sits in a real system, the hash map + hand-written doubly linked list with sentinels and its pointer moves, a generic TypeScript implementation and how to test it. Then every rung of the follow-up ladder: weight, TTL, thread safety, O(1) LFU, scan resistance, pluggable policies, stats, listeners, write-back and distribution.
- LLD Case Studies I: Parking Lot, Elevator, BookMyShow & Splitwise: The four most-asked machine-coding problems in Indian product companies, each done the way a strong senior does it: requirements and a thin HLD first, then entities, an ASCII class diagram and the patterns that earn their place, then the hard core in TypeScript (spot allocation and slab pricing, LOOK scheduling with State, TTL seat holds that survive many pods, debt simplification), concurrency, extensibility probes and a 90-minute build plan.
- LLD Case Studies II: Rate Limiter, In-memory Pub/Sub, Task Scheduler & a Game (Snake & Ladder / Chess): Four machine-coding favourites done HLD → LLD: a pluggable rate-limiter library, a Kafka-lite pub/sub with consumer groups, offsets, retries and a DLQ, a heap-based task scheduler with cron, retries and misfire handling, and Snake & Ladder with the Chess pivot — plus how to time-box the 90 minutes.