Skip to content
Sharp

Design patterns · interview question

How can the Strategy Pattern help in reducing the complexity of a checkout system?

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

Correct answer

A. By delegating different pricing strategies to separate classes

Why

The Strategy Pattern helps reduce complexity by delegating different pricing strategies to separate classes, allowing for cleaner, more manageable code and easier maintenance.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →