Skip to content
Sharp

Design patterns · interview question

Classify each design pattern.

Matrix / gridMedium

Choose for each row.

Choose one option per row
ItemCreationalStructuralBehavioral
Factory Method
Adapter
Observer
Builder
Decorator
Strategy
Answer and explanation

Correct answer

  • Factory Method: Creational
  • Adapter: Structural
  • Observer: Behavioral
  • Builder: Creational
  • Decorator: Structural
  • Strategy: Behavioral

Why

Creational patterns abstract object creation; structural patterns compose classes and objects; behavioral patterns distribute responsibility and communication between objects.

References

  • Gamma, Helm, Johnson & Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software (1994)

Test yourself on Design patterns

A free test with instant, explained results. No account needed.

Start free test
All Design patterns questions →