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