Skip to content
Sharp

Software Architecture · interview question

How does the Adapter pattern differ from the Decorator pattern in terms of functionality?

Multiple choiceHardchapter-13-curatedpremiumsoftware-architecturepattern-abuse
Choose one answer
Answer and explanation

Correct answer

B. Adapter changes interface, Decorator adds behavior

Why

The Adapter pattern is designed to change the interface of an existing class to match another, while the Decorator pattern is used to add new behavior or responsibilities to objects dynamically, without changing their interface.

Test yourself on Software Architecture

A free test with instant, explained results. No account needed.

Start free test
All Software Architecture questions →