Design patterns – basics
Six questions about classic GoF patterns: groups, intent and differences.
Check that you recognize the most common patterns. Passing score 80% (5 of 6). XP is awarded for the first attempt – after every attempt you see the answers with explanations.
Which group does Builder belong to?
- Creational
- Structural
- Behavioral
Which pattern lets classes with incompatible interfaces work together?
- Facade
- Adapter
- Proxy
- Bridge
Which pattern defines a family of interchangeable algorithms?
- Template Method
- State
- Strategy
- Command
Which of these patterns are structural? (select all)
- Decorator
- Composite
- Observer
- Facade
What does the subject in the Observer pattern notify observers about?
- Changes of its state
- Creation of a new class instance
- Compilation errors
What does a Facade provide?
- A single instance of a class for the whole application
- A simplified interface to a complex subsystem
- A copy of an existing object
- An undo queue of operations
Topics: Adapter, Builder, Composite, Decorator, Facade, Observer, Strategy