ITPEC FE Subject A April 2026 Question 36
Which of the following is a structural design pattern that allows classes with incompatible interfaces to work together?
Explanation
Adapter — a structural pattern that lets classes with incompatible interfaces work together.
The adapter wraps an existing class and exposes the interface the client expects, translating each call into the wrapped class's own methods. Neither the client nor the existing class has to change, so a class with the wrong signature can still be reused.
The GoF patterns fall into three groups: creational (how objects are created), structural (how classes and objects are composed) and behavioural (how objects interact and share responsibilities).
Answer (a)
Why not others:
- •(b) Factory — creational: decides which class to instantiate, not how to bridge interfaces
- •(c) Iterator — behavioural: traverses the elements of a collection without exposing its internal structure
- •(d) Singleton — creational: guarantees a class has only one instance
Key rule: Know each pattern's group: Adapter, Composite, Decorator, Facade and Proxy are structural; Factory Method, Abstract Factory, Builder and Singleton are creational; Iterator, Observer, Strategy and Template Method are behavioural.
System Development Technology · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.