System design / 8 simulations
Payment System Design
How money moves: authorise, capture, ledgers, UPI and reconciliation.
Open the lab → Change the load, break a part, watch what happens. Free, no sign-up.
All topics: payments
- Design a payment gatewayIntermediate · 7 min
Authorise, capture, expire and refund. Watch holds run out before shipping and webhooks retry while the merchant is down.
- Design a digital wallet: ledgers and racesIntermediate · 6 min
Concurrent transfers with read-then-write create and destroy money. Locks or a double-entry ledger keep the books balanced.
- How a UPI payment worksBeginner · 6 min
Your app, NPCI and two banks. Make the shop’s bank slow or down and see pending payments, late credits and auto-reversals.
- Design a reconciliation systemIntermediate · 5 min
Match our payments against the bank settlement file each day. Late settlements clear themselves; lost webhooks and fee differences are real breaks.
- Sagas: one order across many servicesAdvanced · 6 min
Order, stock, payment and courier in four services. When a step fails, compensating actions undo the rest, newest first.
- Flash sale: inventory holdsIntermediate · 5 min
Ten phones, hundreds of buyers. Check-then-write oversells; holds on Buy reserve a unit and release it if the buyer abandons.
- Offline payments: store and forwardIntermediate · 5 min
Shops keep taking small payments while offline and sync later. An offline limit caps the loss from customers who overspend.
- Fraud detection: rules, scores and thresholdsIntermediate · 5 min
Risk scores from simple signals. Move the block and review lines and trade fraud caught against honest customers refused.