HardDesign: Payment System (Stripe/PayPal)
Two concurrent requests with the same idempotency key arrive simultaneously. How do you handle this?
— Tests your understanding of this concept.
Answer Options
AProcess both, take the first result
BUse Redis SETNX to acquire a lock — only one request processes, the other waits and returns the cached result
CReturn error to both
DProcess both and reconcile later
Want to see the correct answer?
Get the answer with a detailed explanation, plus practice 22+ more Design: Payment System (Stripe/PayPal) questions with adaptive quizzes and timed interviews.
See the Answer on Guru Sishya →This question is from the Design: Payment System (Stripe/PayPal) topic (System Design Cases).
More Design: Payment System (Stripe/PayPal) Questions
What is an idempotency key in payment processing?
HardWhy should monetary amounts be stored as integers (cents) rather than floats?
HardWhat is double-entry bookkeeping and why is it used in payment systems?
HardThe payment gateway times out after 10 seconds. You don't know if the charge succeeded. What do you do?
HardWhat does PCI DSS require regarding storage of credit card numbers?
Hard