Skip to content
Sharp

Software Architecture · interview question

Which design pattern is most appropriate for managing a set of related algorithms that can be changed at runtime in a Java application?

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

Correct answer

A. Strategy Pattern

Why

The Strategy Pattern is ideal for managing a family of algorithms and enabling them to be swapped at runtime without altering the client code. This pattern encapsulates each algorithm in its own class, making them interchangeable.

Test yourself on Software Architecture

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

Start free test
All Software Architecture questions →