Bird
0
0

What is the main benefit of using the Payment Strategy Pattern in a payment system?

easy📝 Conceptual Q11 of 15
LLD - Design — Online Shopping Cart
What is the main benefit of using the Payment Strategy Pattern in a payment system?
AIt allows switching between different payment methods without changing the main code.
BIt forces all payment methods to use the same currency.
CIt stores all payment data in a single database table.
DIt encrypts payment information automatically.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of the Payment Strategy Pattern

    The pattern is designed to let the system switch payment methods easily without modifying the main logic.
  2. Step 2: Analyze the options

    Only It allows switching between different payment methods without changing the main code. describes this benefit correctly. Other options describe unrelated features.
  3. Final Answer:

    It allows switching between different payment methods without changing the main code. -> Option A
  4. Quick Check:

    Payment Strategy Pattern = Switch payment methods easily [OK]
Quick Trick: Focus on flexibility to switch payment methods without code changes [OK]
Common Mistakes:
  • Confusing strategy pattern with data storage or encryption
  • Thinking it enforces currency or database rules
  • Assuming it handles security automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes