We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design and AI Engineering, by Roni Das. 989 interactive lessons.
Start LearningSystem design interview guide
Short answer
Stripe system design is a payments API built for correctness first. Every write request carries an idempotency key, so a retry never charges twice. Card numbers go to a separate vault, and other services see only tokens. Each money movement is written to an append-only double-entry ledger. Merchants hear the result through signed webhooks, retried for up to three days.
in this guide
8 parts open to everyone · 3 with a free account · 3 with the course
You can read 8 of 14 parts. A free account opens the deep dive; the course opens all of it.
Design Stripe forces you to talk about idempotency seriously, the double-entry ledger, webhook delivery guarantees, PCI scope reduction, fraud signals, and global card network interaction. It is the cleanest test of whether a candidate can design a system where correctness matters more than throughput.
This page is the free part.
₹1,111 in India$25 everywhere elseonce, for the whole course
The System Design course covers the Stripe design across a run of lessons, not one page. These 4 alone are about 113 minutes of step-by-step reading, 1 of them with code you run in the browser, all with a quiz.
Always clarify these in the first 5 minutes of the interview. Do not start drawing boxes until both lists are agreed.
This guide is built on these 6 lessons. Each one teaches one piece of the Stripe design above, step by step.
Lifetime access for ₹1,111 in India or $25 elsewhere. Interactive diagrams, quizzes, and 20 capstone projects to practise on.
This one question is not enough for the interview.
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (268 diagrams in all). A PDF you keep, junior to staff level.
Two courses by the author of this page:
770 lessons · 18 free to read
₹1,111 in India · $25 elsewhere, once
Get System DesignYou own this course
219 lessons · 10 free to read
₹1,333 in India · $35 elsewhere, once
Get Generative AI and Agentic AIYou own this course
Save your progress and get the interview checklist PDF
Businesses on Stripe moved $1.9 trillion in 2025, up from $1 trillion in 2023 (Stripe annual letters). Over Black Friday to Cyber Monday 2025, Stripe handled more than 578 million transactions, peaking above 152,000 a minute, with API uptime above 99.9999%. Every one of those charges has to happen exactly once, even when the merchant's request times out and is retried.
Designing Stripe means designing a payment system from the API down to a double-entry ledger. The defining concerns are correctness (charge exactly once), durability (no charge is ever lost), regulatory compliance (PCI DSS scope, KYC), and global reach (multiple currencies and payment methods). It is the canonical system design problem where consistency dominates speed.
Where it shows up
Commonly asked at Stripe, PayPal, Adyen, Square, and any fintech. Also asked at FAANG, especially Amazon (for the order pipeline) and Google (for Google Pay).
Spec sheetStripe
worked through below, with the maths
The hard parts of this design are taught step by step in the System Design course: Idempotency, Saga Pattern and Message Queues.
Why some operations are safe to retry and others charge you twice, and how to make everything safe.
Long-lived transactions without distributed locking, orchestration vs choreography for microservices.
Decouple producers from consumers with a buffer that holds messages until they're processed.
Splitting a database across multiple servers, the nuclear option for scaling writes, and the architecture behind Instagram, Uber, and YouTube.
all part of
System Design Masterclass
770 lessons · about 290 hours · 18 free to read
₹1,111in India, by UPI
$25everywhere else, by PayPal
You own this course
Continue with Idempotencypay once,
yours for life
Every payment system rests on the same few ideas: an idempotency key so a retry never charges twice, a double-entry ledger so no money appears or vanishes, and daily reconciliation against the bank. These guides show those ideas inside real products.
Lessons these guides rest on
Terms in one paragraph
Live from the course bench
Real interview questions, live diagrams and measured lab results, pulled at random from the lessons. A new set every time you come back.
Show your math. Pulling numbers from thin air signals you have not thought about the load.
Annual payment volume
$1.9T (2025)
Stripe's 2025 annual letter (24 Feb 2026): $1.9 trillion in total volume, up 34% from 2024. It was $1 trillion in 2023. Used to size ledger storage and reconciliation jobs.
Transactions per minute (peak)
152,000+
Stripe's published Black Friday to Cyber Monday 2025 peak (2 Dec 2025). That is about 2,500 a second. Design the charge path for this, plus headroom.
API requests per second
50K
Interview estimate, not a Stripe figure. Includes reads (charge lookups, customer fetches) and writes. Reads outnumber writes 5:1.
Database queries per second
5M+
Published by Stripe in June 2024: its DocDB database service serves over five million queries a second across more than 2,000 shards.
Ledger events per day
5B
Published by Stripe in February 2024: its Ledger sees five billion events a day, and 99.99% of dollar volume is verified within four days.
Webhooks per day
100M
Interview estimate. Multiple events per charge (succeeded, captured, dispute opened). At-least-once delivery with retries amplifies this further.
Ledger storage per year
5 to 20 TB
Interview estimate. Double-entry rows per charge plus partial refunds and disputes. Append-only and partitioned by time.
Client (merchant or hosted checkout) calls the Public API. The API Gateway terminates TLS, authenticates the API key, and routes to the appropriate service. The Charge Service is the heart of the system: it validates the request, looks up or creates the customer, dedupes by idempotency key (Redis with strong consistency, falls back to a sharded SQL idempotency_keys table), writes a pending charge to the canonical Postgres store, and submits to the appropriate card network gateway. On network response, the Charge Service updates the charge state, writes corresponding rows to the double-entry Ledger, and emits a state-change event. The Webhook Service consumes events and delivers them to merchant endpoints with at-least-once retry. A Fraud Service runs synchronously on the request path to score and optionally block. A Reconciliation Service runs nightly to compare the ledger against bank statements. Two rules hold the whole design together. A network timeout leaves the charge pending, never failed, until its real status is known. And the ledger rows and the outgoing event are written in one database transaction, through an outbox table, so a crash can never leave a charge that nobody was told about.
In a real interview, sketch this on the whiteboard before diving into any single box.
One card payment through the design above, from the checkout page to the merchant's bank. The steps follow Stripe's public PaymentIntent API.
The customer types the card into a field served by Stripe (Elements or Checkout). The card number goes to Stripe's vault. The merchant's server only gets a token.
The merchant's server sends POST /v1/payment_intents with an Idempotency-Key header. If the call times out, it retries with the same key.
A key seen before returns the saved result of the first call, even if that was an error. The same key with different parameters is rejected.
The Charge Service writes the payment before calling the card network. If a server dies now, the record survives and a job can finish it.
The Fraud Service scores the payment on the request path and returns allow, review or block before any money moves.
The request goes through Visa or Mastercard to the customer's bank. If the bank wants 3D Secure, the PaymentIntent moves to requires_action until the customer confirms.
On success the status becomes succeeded. Balanced ledger rows and an outbox event are written in the same transaction. A decline sends the PaymentIntent back to requires_payment_method.
Stripe sends payment_intent.succeeded to the merchant's endpoint, signed and retried for up to three days. The merchant fulfils the order from the webhook, not the browser redirect.
Card networks settle in batches, and Stripe pays out to the merchant's bank. Reconciliation matches the ledger against network and bank reports.
Walk through each service. The interviewer wants to hear what each one owns, not just the names.
Authenticates API keys, enforces rate limits, validates request schemas, and routes to internal services. Logs every request for audit. Exposes /v1/charges, /v1/customers, /v1/refunds, and so on.
Owns the charge lifecycle. Dedupes by idempotency key. Writes the canonical charge record. Calls the card network gateway. Updates state on response. Emits events.
Redis with strong consistency for fast dedup, fallback to a sharded SQL table for durability. Key is the idempotency_key plus API key. Value is the status code and body of the first call, whether it succeeded or failed: Stripe documents that it saves even 500 errors, and rejects a reused key sent with different parameters.
Talks to Visa, Mastercard, and other card networks over ISO 8583 or modern APIs. Handles 3D Secure flows, tokenization, and authorization vs capture distinction.
Double-entry bookkeeping. Every charge writes two rows: a credit to merchant balance and a debit to customer's card account (in Stripe's books). All rows are append-only.
Consumes state-change events from a durable queue. Delivers to merchant URLs with HMAC signing. Retries with exponential backoff for up to 3 days. Stripe does not promise delivery order, so each event carries an ID the receiver uses to drop duplicates.
Synchronous risk scoring on the charge path. Inputs include card history, customer history, IP geolocation, and device fingerprint. Returns a block, review, or allow decision.
Nightly batch job comparing the internal ledger to settlement reports from card networks and partner banks. Flags discrepancies for ops investigation.
charges. Sharded by merchant_id. Idempotency key is indexed and unique per merchant. State transitions are immutable; new states are appended to a charge_events table.
Every table for Stripe, its keys, and which store fits it and why.
Idempotency: exactly-once on a retry-prone network. The internet is unreliable. A merchant's POST to /v1/charges might time out after the server has already created the charge. If the merchant retries, you cannot create a…
7 deep dives on the parts that break at scale: Idempotency: exactly-once on a retry-prone network; Double-entry ledger and balance correctness; Webhook delivery with at-least-once and ordering.
Fulfil the order on the webhook vs on the browser redirect. The redirect back to the merchant's site feels like the natural place to ship. But the customer can close the tab after paying and before the redirect. Stripe's docs…
6 decisions an interviewer expects you to defend, each with the alternative and why it loses here.
A merchant retries a charge with the same idempotency key 25 hours later, after the key has expired. What stops a double charge?
4 follow-up questions with model answers, the interview scorecard for this question, and a mock interview on Design Stripe with the AI tutor.
Stripe's API famously prioritizes correctness over speed, and the idempotency key pattern is now an industry standard largely because of Stripe. Here is what Stripe itself has published, with dates. Its API docs say an idempotency key can be up to 255 characters, that the first call's status code and body are saved even when it failed, and that a reused key with different parameters is rejected. Its webhook docs say live-mode events are retried for up to three days with exponential backoff, that order is not guaranteed, and that duplicates can arrive. Its Ledger (described in February 2024) is an immutable double-entry log that sees five billion events a day and verifies 99.99% of dollar volume within four days. Its product applications use DocDB, a database service built on MongoDB Community, which in June 2024 served over five million queries a second across more than 2,000 shards. Card data sits with a PCI Level 1 certified service, and merchants that use Stripe's hosted fields only see tokens. The fraud system, Radar, scores payments using data from across the Stripe network. For scale, Stripe reported $1.9 trillion in total volume for 2025, and a Black Friday 2025 peak above 152,000 transactions a minute with API uptime above 99.9999%. The internal component names in the design above (Charge Service, Webhook Service and so on) are this guide's interview design, not Stripe's published architecture.
Sources
If any of these topics are fuzzy, the interviewer will catch it. Each lesson is 15 to 60 minutes with diagrams, code, and a quiz.
Idempotency
foundation / core fundamentals
Saga Pattern
advanced / distributed systems core
Message Queues
intermediate / messaging event systems
Database Sharding
foundation / database fundamentals
Capstone: Design Payment System
capstone / capstone
Idempotency Keys
intermediate / api design protocols
Transactional Outbox Pattern
intermediate / messaging event systems
Idempotent Consumer
intermediate / messaging event systems
interview readiness
Three questions from this guide. Answer them without scrolling up, the way you would have to in the room.
India: UPI, cards or netbanking through Razorpay. Elsewhere: card or PayPal. Download at once from My packs.
NEWSystem Design Hands-On
Postgres Sharding: Complete Hands-On (PgBouncer + Citus). 2 h 36 min and 20 chapters: one PostgreSQL loaded until it breaks, then four shards behind a router you write, PgBouncer and Citus, with the 139-page slide deck. The first 15 minutes are free to watch.
Free PDF · 79 pages
25 real tech interview questions, answered in full
Five from each of our AI, GenAI, Inference, Maths for ML and Forward Deployed packs. Each with a diagram and a model answer. Free by email.
free tool
Check these numbers yourself
Put in your own guesses for Stripe and see requests per second, storage, bandwidth and servers, with every sum written out.
Open the Capacity EstimatorIt is really nice and good Please join the course