Fundamentals · Hard · Free
Name three design patterns freshers should know and when to use them.
FresherFundamentalsOOP & Language Fundamentals
Three patterns freshers should know
| Pattern | Problem | When |
|---|---|---|
| Factory | Hide concrete class choice | Multiple payment providers |
| Strategy | Swap algorithms at runtime | Shipping cost calculators |
| Observer | Notify many on state change | UI / event buses |
Patterns are vocabulary for recurring designs—not goals by themselves.
Always add cost: patterns add classes—use when pain is real.