Skip to content
Sharp

Design patterns · interview question

What testing benefit do you gain by putting provider selection in a factory and provider quirks in adapters?

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

Correct answer

B. Checkout tests can target one stable PaymentGateway contract instead of every vendor SDK

Why

A clean boundary lets application tests exercise the checkout workflow against a stable interface, while smaller adapter tests focus on provider-specific request mapping and error handling.

Test yourself on Design patterns

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

Start free test
All Design patterns questions →