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.

About 130 minutes · 18 exam questions · 14 interview questions · 2 code labs

What you will learn

  1. How patterns are scored in an LLD round: smell first, pattern second
  2. Strategy and Factory / Abstract Factory: replacing the type switch
  3. Builder, and Singleton (and why DI beats it)
  4. Observer / pub-sub: decoupling side effects without losing them
  5. State: making illegal transitions impossible
  6. Command: undo, redo and idempotent actions
  7. Decorator, Adapter, Facade (and Proxy): four wrappers, four intents
  8. Chain of Responsibility and Template Method: ordered steps, two ways
  9. Repository with optimistic versioning: the machine-coding storage seam
  10. Anti-patterns: god class, anaemic model, over-patterning
  11. Races in in-memory stores: async-mutex, lock granularity and lock ordering
  12. Producer–consumer with a bounded queue: backpressure in one process
  13. Thread-safe singletons and lazy initialisation (the Java questions, and Node's version)
  14. Event loop vs worker_threads vs multiple pods: when an in-process lock stops being enough

Previous: OOP, SOLID & Modelling for LLD · Next: LRU Cache: Implementation & The Follow-up Ladder