Skip to content
Sharp

Design patterns · interview question

Before choosing the Strategy Pattern, what question should you ask first?

Multiple choiceEasychapter-13-curatedpremiumdesign-patternsstrategy-pattern
Choose one answer
Answer and explanation

Correct answer

B. Which algorithm varies independently behind one stable role?

Why

Strategy is appropriate when multiple algorithms fulfill the same responsibility and change on their own schedule. Identifying that stable role and varying behavior is what justifies the pattern.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →