Hirestack
Hirestack
Chapter 20

Patterns frequency map across the 15 problems

📖 2 min read · 0 sections · May 2026

Notice how patterns recur:

PatternProblems where it appears
StrategyParking Lot (allocation, payment, pricing); Elevator (dispatch); ATM (transaction types); Splitwise (split types); Logger (appender); Rate Limiter (algorithm)
StateElevator; ATM; Vending Machine; BookMyShow (booking lifecycle)
ObserverLibrary (notify reservation holder); Pub-Sub (core); BookMyShow (notification on booking)
FactoryParking Lot (vehicles, spots); Vending Machine (items); File System (nodes)
CompositeFile System; Logger (multiple appenders)
DecoratorLogger (AsyncAppender wraps); Coffee customization
CommandATM (transactions); Splitwise (expense actions)
SingletonLogger factory; thread pool; rate limiter (often)
Chain of ResponsibilityLogger (level filtering)
Template MethodGame framework (Chess/TicTacToe shared structure)

Strategy is the most useful pattern in LLD — it shows up almost everywhere. State is the second-most common, anywhere a system has explicit phases. Observer covers most "notify many" cases. The rest are domain-specific.

The insight: recognise the pattern, then implement it; don't reach for a pattern just because you know it. Each pattern solves a specific problem. Use it when that problem appears; don't force-fit.