Structural Patterns «Prev Next»

Common Structural Patterns - Quiz

Each question is worth one point. Select the best answer or answers for each question.
1. Suppose you want to add responsibilities to an object. Which of the following patterns allows you to do that?
Please select the correct answer:
  A. Adapter
  B. Bridge
  C. Composite
  D. Decorator

2. Which of the following patterns controls access to an object by standing in for the object while providing the same interface?
Please select the correct answer:
  A. Adapter
  B. Proxy
  C. Composite
  D. Decorator

3. Suppose you want to provide a single, unified interface to a subsystem comprised of several interfaces. Which of the following patterns allows you to do that?
Please select the correct answer:
  A. Adapter
  B. Bridge
  C. Façade
  D. Decorator

4. Suppose you want to convert the interface of a class into a different interface that clients expect. Which of the following patterns allows you to do that?
Please select the correct answer:
  A. Adapter
  B. Bridge
  C. Composite
  D. Façade

5. Suppose you want to separate an abstraction from its implementation so that the two can vary independently. Which of the following patterns allows you to do that?
Please select the correct answer:
  A. Adapter
  B. Bridge
  C. Proxy
  D. Decorator

6. Suppose you want to compose objects into tree structures to represent part-whole hierarchies, and allow clients to treat individual objects and compositions of objects uniformly. Which of the following patterns allows you to do that?
Please select the correct answer:
  A. Façade
  B. Bridge
  C. Composite
  D. Flyweight