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
- Which behavioral pattern defines a one-to-many dependency so that when one object changes state, all its dependents are notified automatically? → Observer
- 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 Command pattern converts requests into objects primarily to support which feature? → Undo/redo operations
- In the Proxy pattern, which variant is used to defer the creation of an expensive object until it is actually needed? → Virtual Proxy
- 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
- In the Observer pattern, what problem arises if observers are not properly deregistered? → Memory leaks occur because the subject holds references to stale observers
- 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
- What problem does the Flyweight pattern primarily solve? → Reducing memory usage by sharing common state among many objects
- 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
- The State pattern allows an object to alter its behavior when its internal state changes. How is this typically implemented? → Delegating behavior to a State object that changes at runtime
- 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
- In a multi-threaded environment, which technique makes a Singleton implementation thread-safe without synchronizing every access? → Eager initialization (creating the instance at class load time)
- Which pattern separates an algorithm's skeleton from its specific steps so subclasses can override individual steps? → Template Method
- 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
- In the Mediator pattern, what role does the mediator object play? → It centralizes communication between colleague objects
- 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
Turn these facts into recall:
Was this helpful?