Polski

Design patterns – basics

Six questions about classic GoF patterns: groups, intent and differences.

Quiz · 10 XP

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.

  1. Which group does Builder belong to?

    • Creational
    • Structural
    • Behavioral
  2. Which pattern lets classes with incompatible interfaces work together?

    • Facade
    • Adapter
    • Proxy
    • Bridge
  3. Which pattern defines a family of interchangeable algorithms?

    • Template Method
    • State
    • Strategy
    • Command
  4. Which of these patterns are structural? (select all)

    • Decorator
    • Composite
    • Observer
    • Facade
  5. What does the subject in the Observer pattern notify observers about?

    • Changes of its state
    • Creation of a new class instance
    • Compilation errors
  6. 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