How to Answer "Design a Payment System" in a System Design Interview
3 views
Payment system design is a favorite interview question at fintech companies, marketplaces and large e-commerce platforms. It is different from many system design prompts because correctness matters more than raw scale: losing or double-charging money is far worse than a slow page. Here is a structure that helps you show the right priorities.
Clarify scope
Start by asking what "payment system" means here. Is it a checkout flow that calls an external payment service provider (PSP) such as a card processor, or a full internal ledger with payouts to sellers? Ask about expected transactions per second, supported payment methods, currencies, and whether refunds and chargebacks are in scope. A typical interview scope is: accept a payment for an order, call a PSP, record the result, and pay out sellers later.
Core components
A clean high-level design includes a Payment Service that receives payment requests, a Payment Executor that talks to the PSP, a Ledger that records every money movement using double-entry bookkeeping, and a Wallet or balance service for sellers. A reconciliation job compares internal records with PSP settlement files every day to catch mismatches.
Idempotency is the key idea
Networks fail and clients retry. If a retry charges a customer twice, you have a serious problem. Explain that every payment request carries an idempotency key (often the order ID or a client-generated UUID). The service stores the key with the result, and any repeated request returns the stored result instead of charging again. This single concept often impresses interviewers more than any diagram.
Consistency and state
Model each payment as a state machine: created, pending, succeeded, failed, refunded. Persist state transitions in a relational database with transactions, because strong consistency matters here. For calls to external PSPs, which you cannot wrap in a database transaction, discuss retries with exponential backoff, timeouts, and handling unknown outcomes by querying the PSP for status before retrying.
Asynchronous processing
Payouts and notifications can run asynchronously through a message queue. Mention dead-letter queues for messages that keep failing, and alerting so engineers can investigate.
Security and compliance
Briefly mention that card data should be tokenized by the PSP so your system never stores raw card numbers, reducing PCI DSS scope, and that all traffic should be encrypted.
Wrapping up
Close with trade-offs and failure scenarios: what happens if the ledger write succeeds but the PSP call times out? Walking through one failure case carefully shows strong engineering judgment.
Practice tip
Practice explaining idempotency and reconciliation in plain language. Some candidates also use Linkjob AI (https://linkjob.ai), which provides real-time help during live job interviews and technical interviews, to stay organized during the round. The most important thing is a clear, correctness-first story.