Skip to content
Sharp

Design patterns · interview question

If an e-commerce platform needs to switch between different inventory management algorithms depending on the region, which pattern is most suitable?

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

Correct answer

A. Strategy Pattern

Why

The Strategy Pattern is best suited for cases where different algorithms need to be swapped depending on the region, as it allows each algorithm to be encapsulated and selected at runtime based on the region.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →