Pattern Design Cheat Sheet 2026
The 30 highest-yield Pattern Design facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
- The Factory Method pattern delegates object creation to: → Subclasses
- The 'Spaghetti Code' anti-pattern results from: → Lack of structure, excessive control flow jumps, and unclear responsibilities
- The Composite pattern is most useful for representing: → Tree-structured hierarchies of objects
- The 'Poltergeist' anti-pattern describes classes that: → Have very limited roles and are instantiated only to invoke methods on another class
- A behavioral object-level pattern is the ___ pattern. → Strategy
- The Builder pattern is most useful when: → An object requires many optional parameters to construct
- Extract Method refactoring is applied when: → A code fragment can be grouped and named as its own method
- The Decorator pattern differs from inheritance because it: → Adds behavior dynamically at runtime
- In Abstract Factory, adding a new product variant requires: → Adding a new method to all factory interfaces and concrete factories
- In concurrent programming, what is a Future (also called a Promise)? → A placeholder object representing a result that will be available asynchronously
- Establishes an interface for object creation but leaves it up to the subclasses to choose the class to instantiate. It let subclasses' instantiations to vary. → Factory Method
- Facade pattern differs from Adapter in that Facade: → Simplifies an interface rather than converting one interface to another
- Lazy initialization in the Singleton pattern means: → The instance is created only when first requested
- What problem does the Singleton pattern primarily solve? → Uncontrolled instantiation of a class
- A virtual proxy is used to: → Delay creation of an expensive object until it is actually needed
- In the Mediator pattern, a potential drawback is: → The mediator can become a God object that is too complex
- The 'Feature Envy' code smell describes a method that: → Seems more interested in the data of another class than its own
- The Decorator pattern must implement the same interface as the component it decorates because: → Clients must be able to use decorated and undecorated objects interchangeably
- Which pattern uses a shared queue to pass work items between threads that produce data and threads that consume it? → Producer-Consumer
- Technical debt most commonly accumulates from: → Deliberate shortcuts taken to meet deadlines that are never paid back
- The Backend for Frontend (BFF) pattern creates: → A dedicated API layer tailored for each specific frontend client
- The Unit of Work pattern tracks: → All changes to objects during a business transaction and writes them in one batch
- Dynamically assign extra responsibilities to an object. It offers a versatile substitute for subclassing when it comes to extending functionality. → Decorator
- When should you prefer the Bridge pattern over simple inheritance? → When both abstraction and implementation need to be extensible independently
- The 'Golden Hammer' anti-pattern occurs when: → A familiar solution is applied to every problem regardless of fit
- Which technique used in concurrent data structures divides the structure into independent segments, each guarded by its own lock, to reduce contention? → Lock Striping
- The 'Dead Code' anti-pattern refers to: → Code that is never executed because it is unreachable
- The Builder pattern's fluent interface style allows: → Chaining method calls for readable object construction
- In a Composite pattern, the Component interface typically defines: → Operations common to both leaf and composite objects
- The Strangler Fig pattern is used in software architecture to: → Incrementally replace a legacy system by routing traffic to new code
Turn these facts into recall: