Recall & Review
beginner
What is the main purpose of the Adapter pattern?
The Adapter pattern helps two incompatible interfaces work together by converting one interface into another expected by the client.
Click to reveal answer
beginner
When should you use the Composite pattern?
Use the Composite pattern when you want to treat individual objects and compositions of objects uniformly, like a tree structure of parts and wholes.
Click to reveal answer
intermediate
What problem does the Proxy pattern solve?
The Proxy pattern controls access to an object, adding a placeholder that can add security, lazy loading, or logging before forwarding requests.
Click to reveal answer
intermediate
When is the Decorator pattern useful?
Use the Decorator pattern to add responsibilities to objects dynamically without changing their class, like adding features to a window or text.
Click to reveal answer
beginner
Why choose the Facade pattern?
The Facade pattern provides a simple interface to a complex subsystem, making it easier for clients to use without knowing all details.
Click to reveal answer
Which structural pattern would you use to allow incompatible interfaces to work together?
✗ Incorrect
Adapter converts one interface to another so incompatible interfaces can work together.
If you want to add features to an object dynamically without changing its class, which pattern fits best?
✗ Incorrect
Decorator adds responsibilities to objects dynamically.
Which pattern provides a simple interface to a complex system?
✗ Incorrect
Facade offers a simple interface hiding complex subsystem details.
To treat individual objects and groups of objects the same way, which pattern is appropriate?
✗ Incorrect
Composite lets clients treat single objects and compositions uniformly.
Which pattern controls access to an object, possibly adding security or lazy loading?
✗ Incorrect
Proxy acts as a placeholder controlling access to the real object.
Explain when and why you would use the Adapter, Decorator, and Facade patterns in a system design.
Think about how each pattern changes or hides complexity.
You got /3 concepts.
Describe the differences between Composite and Proxy patterns and give real-life examples for each.
Focus on structure vs access control.
You got /3 concepts.