Design a payment fraud detection system
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Stripe's system design round and at Uber, Nvidia and 2 more companies, last asked May 2026. It tests fraud, real-time ml and imbalanced data.
Design the machine learning system that scores every card payment for fraud on a large payments platform. Each transaction gets a decision before or right after authorization: approve, challenge (for example 3-D Secure), send to manual review, or block. Block too much and good customers are declined; block too little and the platform pays for fraud. Most fraud labels (chargebacks) arrive weeks later.
Requirements
- Functional: score each transaction and return a decision; choose thresholds per merchant or segment; send the uncertain band to review or a challenge; let models be updated without downtime; feed review outcomes, chargebacks and disputes back into training.
- Non-functional: the decision takes 50 ms or less end to end; at least 10,000 transactions per second, with spikes several times higher during big sales; the service stays up even if a dependency fails.
Clarifying questions
- Who bears the fraud loss: the platform, the merchant, or the card issuer?
- What is the cost of a false decline compared with a missed fraud, and does it vary by merchant?
- What data do we have at decision time: card, device, IP, email, merchant, amount, history across merchants on the platform?
- How long until a chargeback arrives, and what fraction of fraud is ever reported?
- Are there regulatory constraints on automated declines or on the features we may use?
What a strong answer covers
- Labels: chargebacks and confirmed fraud, with a maturity window before a transaction counts as legitimate; delayed and missing labels handled by training on mature data and monitoring early proxies.
- Features: velocity counts per card, device, IP and email over several windows; amount relative to the card's history; mismatches (billing versus IP country); merchant risk; device fingerprint; graph features linking cards, devices and accounts.
- Models: gradient-boosted trees as the workhorse, class imbalance handled with weighting or sampling plus recalibration, and graph or sequence models offline to find fraud rings.
- Serving: an online feature store with streaming aggregates, a model server with a strict timeout and a rules fallback, and canary or shadow deployment for new models.
- Thresholds from expected cost per decision, by segment, with a small random holdout of approvals to measure true fraud rates without bias.
- Monitoring: score and feature drift, approval and chargeback rates, latency; retraining as fraudsters adapt.
Follow-ups
- A fraud ring tests stolen cards with many $1 charges. Which features catch it, and how fast?
- How do you evaluate a new model when the old one's blocks hide what would have happened?
- A large merchant complains its good customers are being declined. How do you investigate?
Where it's asked
- Stripe · System design · Last asked May 202660 min · Design discussion in a shared document
- Uber · System design · Last asked May 202660 min · Whiteboard and discussion
- Nvidia · System design · Last asked Mar 2026Design discussion, often narrow and concrete
- Google · First round: coding · Last asked Jan 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI
- Amazon · Technical phone screen · Last asked Aug 202560 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI
What it tests
fraud · real-time ml · imbalanced data
Sign in to see the worked answer
The full answer, chapter by chapter, with what interviewers expect at each level. New accounts get 5 credits: each one unlocks a question for good.
What the labs asked this week
A weekly email of what OpenAI, Anthropic and the other top AI labs asked engineers, round by round.


