Design Payment Fraud Detection
On this page
Problem Description
In this interview, we're going to design the fraud detection inside an online payment platform, similar to Stripe Radar or Adyen's risk checks. Online shops (merchants) use the platform to take card payments from their customers. When a customer pays, the system decides, before any money moves, whether to approve the payment, ask the customer to confirm it with their bank, or block it, so stolen cards are stopped while real customers can still buy. Days or weeks later, the system learns how things turned out: a cardholder tells their bank a payment wasn't theirs, a merchant reports a payment as fraud, or a customer passes or fails the bank's check. The system records these outcomes and keeps learning from them. You can use existing building blocks: a payments service that moves the money and receives cardholders' disputes from the card networks, and the banks' own confirmation step (3-D Secure). This interview is about the decision, not about moving money.
Out of Scope
- Moving money, refunds and handling disputes – the payments service does this; we only receive the outcomes.
- Rules written by merchants ("block every payment over $1,000 from abroad") – a good follow-up question.
- Account takeover and login fraud – a different product with different signals.
- Fraud by merchants themselves (fake shops) – checked when a merchant signs up, a separate system.
- Building the bank's confirmation step – the banks run it; we only ask for it.
Good Clarifying Questions
- How many payments, and how bursty? – About 500 million payments a day across all merchants, with peaks two to three times the average during holiday sales. About 1 in 1,000 is fraud.
- What does each kind of mistake cost? – A missed fraud costs the merchant the goods plus a $15 dispute fee. Blocking a real customer loses the sale and often the customer. The bank's confirmation stops most fraud, but about 1 in 10 real customers give up when asked. The candidate decides how to weigh them.
- How fast must the decision be? – It sits inside checkout: under 100 ms at p99, including reading data.
- How fast do attacks move? – A stolen card is often tried at dozens of shops within a few minutes, and new fraud patterns appear every few weeks.
- What if the fraud system fails? – Payments must never stop. A simpler decision is fine for a while; an error is not.
Requirements
Functional Requirements
- Decide on Every Payment – Before a payment goes through, the system answers approve, verify (ask the customer to confirm with their bank) or block.
- Record Outcomes – The system records every decision and what happened afterwards: cardholder disputes, merchant fraud reports, and passed or failed bank checks.
- Keep Learning – The system trains a new model from these records every week and gives it to all payments only after it proves at least as good as the current one.
Non-Functional Requirements
- Scale – 500M payments a day: about 6K/s on average, 15K/s at peak.
- Latency – A decision in under 100 ms at p99, with about 20 ms for the model.
- Freshness – A card's new attempts affect the next decision within 5 seconds; daily history features every day; a new model every week.
- Availability – 99.99%. If the model or the feature store is down, every payment still gets a rule-based decision; never an error.
Try it yourself first
You have the full problem. Sketch your answer, then sign up free to read the complete walkthrough.
- The complete design, flow by flow, with pictures
- Deep dives into the hard parts
- What mid, senior and staff candidates are expected to say
- Full company question lists
Free forever. No card needed.