Behavioral Patterns
Concerned with algorithms and the assignment of responsibilities between objects. Describe patterns of communication between objects allows us to shift focus from the flow of control, to the way objects are interconnected.
Dated Sep 28, 2021; last modified on Wed, 16 Sep 2026
Concerned with algorithms and the assignment of responsibilities between objects. Describe patterns of communication between objects allows us to shift focus from the flow of control, to the way objects are interconnected.
| Random Link ¯\_(ツ)_/¯ | ||
| Oct 3, 2026 | » | State Machine
1 min; updated Oct 3, 2026
MotivationUse it when an object’s behavior changes based on its internal state and you have complex state transition rules. It’s the antidote to scattered conditionals checking current state. Each state know which state comes next and what actions are valid. Sample CodeReferences
|
| Oct 3, 2026 | » | Strategy
1 min; updated Oct 3, 2026
MotivationStrategy is the single most common pattern in LLD interviews. Whenever you see conditional logic based on type, then that’s a strategy pattern waiting to happen. Strategy replaces conditional logic with polymorphism. Sample Code… where |
| Sep 28, 2021 | » | Observer
8 min; updated Sep 16, 2026
Rant: some of willchan’s thoughts on WeakPtr, for those who care to read criticizes the observer pattern for murking dependency chains. Investigate more in this regard. IntentA one-to-many dependency between object so that when one object (subject) changes, all its dependents (observers) are notified and update automatically. ... |
notes that , the primary source, glosses over nitty-gritties. e.g. the “message queue” server. Maybe reading through these will provide a larger perspective to design decisions made in Chromium regarding observers.