Bird
0
0

You need to design a payment system that supports multiple payment methods (cards, wallets, bank transfers) and ensures transaction atomicity. Which design approach best fits this requirement?

hard📝 Trade-off Q8 of 15
LLD - Design — Parking Lot System
You need to design a payment system that supports multiple payment methods (cards, wallets, bank transfers) and ensures transaction atomicity. Which design approach best fits this requirement?
AUse a single monolithic service handling all payment types synchronously
BStore all payment data in client-side cookies for quick access
CProcess payments asynchronously without tracking transaction states
DImplement microservices for each payment method with a central coordinator for transaction management
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirement for multiple methods and atomicity

    Supporting many payment types needs modular design; atomicity requires coordination to ensure all-or-nothing transactions.
  2. Step 2: Evaluate options

    Monolithic service is hard to scale and maintain. Client-side storage is insecure. Asynchronous without tracking risks inconsistent states. Microservices with central coordinator enable modularity and atomic transactions.
  3. Final Answer:

    Implement microservices for each payment method with a central coordinator for transaction management -> Option D
  4. Quick Check:

    Microservices + coordinator = scalable, atomic payments [OK]
Quick Trick: Microservices plus coordinator ensure atomic multi-method payments [OK]
Common Mistakes:
MISTAKES
  • Choosing monolithic for complex multi-method systems
  • Storing sensitive data client-side
  • Ignoring transaction state tracking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes