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.

  1. The Factory Method pattern delegates object creation to: Subclasses
  2. The 'Spaghetti Code' anti-pattern results from: Lack of structure, excessive control flow jumps, and unclear responsibilities
  3. Which behavioral pattern defines a one-to-many dependency so that when one object changes state, all its dependents are notified automatically? Observer
  4. The Composite pattern is most useful for representing: Tree-structured hierarchies of objects
  5. The 'Poltergeist' anti-pattern describes classes that: Have very limited roles and are instantiated only to invoke methods on another class
  6. A behavioral object-level pattern is the ___ pattern. Strategy
  7. The Command pattern converts requests into objects primarily to support which feature? Undo/redo operations
  8. In the Proxy pattern, which variant is used to defer the creation of an expensive object until it is actually needed? Virtual Proxy
  9. The Builder pattern is most useful when: An object requires many optional parameters to construct
  10. Extract Method refactoring is applied when: A code fragment can be grouped and named as its own method
  11. In the Observer pattern, what problem arises if observers are not properly deregistered? Memory leaks occur because the subject holds references to stale observers
  12. The Decorator pattern differs from inheritance because it: Adds behavior dynamically at runtime
  13. In Abstract Factory, adding a new product variant requires: Adding a new method to all factory interfaces and concrete factories
  14. In concurrent programming, what is a Future (also called a Promise)? A placeholder object representing a result that will be available asynchronously
  15. What problem does the Flyweight pattern primarily solve? Reducing memory usage by sharing common state among many objects
  16. 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
  17. 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
  18. Facade pattern differs from Adapter in that Facade: Simplifies an interface rather than converting one interface to another
  19. Lazy initialization in the Singleton pattern means: The instance is created only when first requested
  20. What problem does the Singleton pattern primarily solve? Uncontrolled instantiation of a class
  21. 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)
  22. Which pattern separates an algorithm's skeleton from its specific steps so subclasses can override individual steps? Template Method
  23. A virtual proxy is used to: Delay creation of an expensive object until it is actually needed
  24. In the Mediator pattern, a potential drawback is: The mediator can become a God object that is too complex
  25. The 'Feature Envy' code smell describes a method that: Seems more interested in the data of another class than its own
  26. 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
  27. In the Mediator pattern, what role does the mediator object play? It centralizes communication between colleague objects
  28. Which pattern uses a shared queue to pass work items between threads that produce data and threads that consume it? Producer-Consumer
  29. Technical debt most commonly accumulates from: Deliberate shortcuts taken to meet deadlines that are never paid back
  30. The Backend for Frontend (BFF) pattern creates: A dedicated API layer tailored for each specific frontend client
Was this helpful?