Bird
Raised Fist0

Which of the following is a misunderstanding about the Adapter pattern?

medium📚 Background Knowledge Q7 of Q15
OOP & Design Patterns - Adapter vs Facade vs Proxy - Structural Pattern Comparison
Which of the following is a misunderstanding about the Adapter pattern?
AAdapter changes the interface of an existing class to make it compatible with another.
BAdapter adds new functionality to the existing class without changing its interface.
CAdapter allows classes with incompatible interfaces to work together.
DAdapter acts as a wrapper to translate one interface to another.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Adapter's purpose

    Adapter converts one interface to another without changing the original class.
  2. Step 2: Identify misconception

    Adapter does not add new functionality; it only adapts interfaces.
  3. Final Answer:

    Adapter adds new functionality to the existing class without changing its interface. -> Option B
  4. Quick Check:

    Adapter adapts interfaces, does not add features [OK]
Quick Trick: Adapter adapts interfaces, not functionality [OK]
Common Mistakes:
MISTAKES
  • Confusing Adapter with Decorator pattern
  • Assuming Adapter modifies original class behavior
  • Thinking Adapter adds features
Trap Explanation:
PITFALL
  • Option B confuses Adapter with Decorator, which adds functionality.
Interviewer Note:
CONTEXT
  • Tests understanding of Adapter's role in interface compatibility.
Master "Adapter vs Facade vs Proxy - Structural Pattern Comparison" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes