Skip to content
Sharp

Design patterns · interview question

What should the Strategy Pattern rely on to allow dynamic strategy selection at runtime?

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

Correct answer

B. Dependency injection or configuration

Why

The Strategy Pattern should rely on dependency injection or configuration to allow dynamic selection of strategies at runtime, ensuring flexibility and adherence to the Open/Closed Principle.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →