Skip to content
Sharp

Software Architecture · interview question

A developer uses a single abstract class to define multiple unrelated behaviors in a checkout system. Which design pattern could improve this design?

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

Correct answer

D. Strategy Pattern

Why

The Strategy Pattern allows defining a family of algorithms, encapsulating each one, and making them interchangeable. This design pattern would improve the system by separating unrelated behaviors into distinct classes.

Test yourself on Software Architecture

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

Start free test
All Software Architecture questions →