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
ML System Design
Machine Learning Engineer
Square
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Hard

0

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
delayed labels
feature store
gradient boosted trees
threshold optimization
counterfactual evaluation
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions