Real-Time Fraud Scoring for UPI Payments with Delayed Labels
Last updated: November 29, 2026
Quick Overview
Design an ML system that scores every PhonePe UPI payment for fraud risk within tens of milliseconds, decides allow, step-up or block, and keeps learning even though confirmed fraud labels arrive days or weeks later.
PhonePe
November 29, 20260
0
0 solved
Design an ML system that scores every PhonePe UPI payment for fraud risk within tens of milliseconds, decides allow, step-up or block, and keeps learning even though confirmed fraud labels arrive days or weeks later.
Social-engineering scams, mule accounts and account takeover are the main fraud patterns in Indian UPI, and PhonePe's risk team has to block them without adding friction to hundreds of millions of honest payments. The interviewer checks feature freshness under latency limits, handling of delayed and biased labels, and how model scores turn into business decisions.
What the Interviewer Expects
- Frame the decision with costs: fraud loss vs friction and false declines
- Design real-time features (velocity, device, payee graph) with an online feature store
- Explain label sources and delay, and how training handles them
- Account for selection bias from blocked transactions
- Describe serving, fallback and monitoring for drift
- Combine rules and model sensibly
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How would you detect a brand new scam pattern before labels exist?
- Many victims authorize the payment themselves. How do your features differ from card fraud features?
- How do you choose block and step-up thresholds, and who owns them?
- How do you evaluate a new model safely in production?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
Score every payment (P2P and P2M) inline with a budget of about 20 to 30 ms at p99. Outputs: allow, step-up (warning screen, cooling period, extra confirmation), or block. Optimize expected cost: $\te...
High-Level Design
The payment service calls a Risk service with the transaction context. Risk runs deterministic rules (hard blocks, regulatory limits) and a model. Features come from three tiers: request features (amo...