Skip to content
Sharp

Software Architecture · interview question

Which design pattern is most appropriate for creating shipping algorithms that can be swapped easily in an e-commerce application?

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

Correct answer

C. Strategy

Why

The Strategy pattern is ideal for defining a family of algorithms, encapsulating each one, and making them interchangeable. This allows the client to choose which algorithm to use at runtime.

Test yourself on Software Architecture

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

Start free test
All Software Architecture questions →