Payment system: never twice, never lost
One strong interview answer to a marketplace payment backend: PSP tokens instead of card data, a timeout treated as unknown and resolved with the same idempotency key or a status query, one key per hop and guarded state transitions, state, ledger and outbox in one commit, a double-entry ledger in paise, and daily reconciliation with every provider.
01 · Did the money move?
IP-20 · Design a Payment System
"Pay ₹1,000." Timeout.
Pay, then a timeout
A customer taps Pay 1,000 rupees.
0:00 / 13:25