Skip to content
Sharp

Design patterns · interview question

In what way does the Decorator pattern differ from the Adapter pattern?

Multiple choiceMediumchapter-13-curatedpremiumdesign-patternsdecorator-pattern
Choose one answer
Answer and explanation

Correct answer

A. Decorator adds behavior, Adapter changes interface

Why

The Decorator pattern adds new behavior to objects without changing their interface, while the Adapter pattern allows incompatible interfaces to work together by converting one interface into another.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →