Pattern Architect — Design Patterns

Architect software patterns: 12 levels of Singleton, Factory, Observer and Strategy. A classic design patterns game for senior developers.

What you learn in this game

Welcome, Pattern Architect. Design patterns are proven solutions to recurring software design problems. Each level shows a scenario, and your job is to pick the pattern that fits it best.

Factory creates objects without the client needing to know the concrete class. The client says "make me an email notification", and the factory decides the class. This reduces coupling between creator and product.

Strategy defines a family of algorithms, encapsulates each one, and makes them swappable. The client picks a strategy without knowing its implementation details.

State vs Strategy: both swap behavior, but State has orderly transitions (Draft→Paid→Shipped) while the client picks a Strategy freely.

What the levels ask

  1. Read the scenario, then pick the design pattern that fits best.
  2. Pick the pattern for creating objects based on a type.
  3. Pick the pattern for an event system.
  4. Pick the pattern for algorithms that can be swapped.
  5. Pick the pattern for adding features without changing the original class.
  6. The old system and the new system have different interfaces. Which pattern?
  7. Pick the pattern for building a complex object step by step.
  8. A complex system needs an interface that's easy to use. Which pattern?
  9. An object whose behavior changes depending on its state. Which pattern?
  10. A request has to pass through several handlers before being processed. Which pattern?
  11. Treat a group of objects and an individual object the same way. Which pattern?
  12. What pattern does a big e-commerce system need for its checkout flow?

And more, 17 levels in all.