Real-Time Fraud Scoring for Card-Not-Present Seller Payments
Last updated: November 29, 2026
Quick Overview
Design an ML system that scores online and invoice payments for fraud in under 100 ms at authorization time, learning from chargebacks that arrive weeks later, across millions of small sellers with very different baselines.
Square
November 29, 20260
0
0 solved
Design an ML system that scores online and invoice payments for fraud in under 100 ms at authorization time, learning from chargebacks that arrive weeks later, across millions of small sellers with very different baselines.
Square processes payments for sellers ranging from a single dog groomer to large restaurant groups, and card-not-present channels (Square Online, Invoices, payment links) carry most of the fraud loss. The interviewer probes label delay, seller-relative features, online/offline feature parity and how scores turn into actions.
What the Interviewer Expects
- Define labels and handle 30 to 120 day chargeback delay
- Build seller-relative and velocity features with point-in-time correctness
- Meet a strict latency budget with a feature store
- Translate scores into actions with cost-weighted thresholds
- Plan evaluation with dollar-weighted metrics and holdouts
- Monitor drift and feedback loops from blocking
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
- Blocked payments never get labels; how do you still evaluate and retrain?
- How do you score a brand-new seller with no history?
- How do you keep fraud rings from adapting to your thresholds?
- When would you use a graph model, and on what edges?
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 card-not-present authorization in p99 under 100 ms inside the payment path. Actions: allow, step up (3-D Secure or extra verification), hold the payout, decline. Objective: minimize fraud ...
High-Level Design
Online: the payment service calls a scoring service with payment, card fingerprint, device, IP and seller ids. The scorer pulls precomputed features from a low-latency feature store (Redis or a key-va...