Why this matters
- Creation logic scattered → Factory or Abstract Factory
- Incompatible interface → Adapter
- Algorithm varies → Strategy
- Do not name five patterns in the first five minutes
- Patterns are forces and solutions — name the force before the pattern.
Creational
Factorychoose implementation
Builderstep-by-step assembly
Structural
Decoratorstack behaviour
Facadesimple entry point
Behavioral
Strategyswap algorithm
Observernotify subscribers
Statebehaviour by mode
Overview
A decision guide — not a catalogue to memorise. Study each section below in order — every list is interview-ready reference material.
Creational forces
Points to cover
- Creation logic scattered → Factory or Abstract Factory
- Many optional constructor params → Builder
- Exactly one instance needed → Singleton (prefer DI scope instead)
- Family of related products → Abstract Factory
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 3 sections
- Structural forces
- Behavioral forces
- Anti-pattern: pattern fever
Test yourself
Answer these before moving on — recall is what makes it stick.