Design a payment system (like Stripe)
Merchants send us card payments through an API. We get each one approved by the customer's bank through the card networks and keep a ledger of who is owed what. A day or two later we collect the money and pay each merchant into her bank account. Every change reaches the merchant's server as a webhook. It's a bank's clearing desk that never closes and is never allowed to lose a cent.
It's also asked as "design Stripe", "design a payment gateway", "design Razorpay" or "design PayPal's checkout". The closest case study is Food delivery, which calls a payment provider; here we are that provider. Interviewers like it, and candidates report Stripe asking versions of it (prep sites, as of 2026), because every call can time out after acting. Two companies keep books on the same money, and a mistake means a customer charged twice or a merchant paid wrong. This page applies Moving money safely and Multi-step workflows without re-teaching them.
Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.
Step 1 · Clarify the features and cut the scope
Minutes 0–5 · How this step works
Interviewer: Design a payment system like Stripe.
You: Are we the processor merchants call, or a shop's checkout calling one?
Interviewer: The processor.
You: Cards only? And do merchants capture at once, or authorise now and capture later?
Interviewer: Cards. Capture at once by default, or later within seven days.
You: Refunds, disputes, and payouts to merchants?
Interviewer: Refunds, yes. Disputes arrive from the banks and you record them. Payouts daily.
You: And merchants hear about changes by webhook?
Interviewer: Yes, every state change.
You: Then I'll cover the payments API, authorisation and capture through our acquiring banks, refunds, the ledger, settlement, daily payouts and webhooks. Out: onboarding checks, fraud models, subscriptions and currency conversion. OK?
Interviewer: Go ahead.
Each answer shapes the design: a later capture makes the payment a workflow lasting days, and refunds and disputes are new entries. Payouts need settled money, and webhooks need an outbox and a sender that survives slow merchants.