Skip to content
RED SAGSkills
hardMachine Learning Engineer interview question

Design a real-time fraud detection system for card payments.

What the interviewer wants to hear

  • Extreme class imbalance and costly errors in both directions
  • Real-time features such as velocity counts from a streaming feature store
  • Low-latency model, often gradient boosting, plus rules
  • Thresholds set from business cost, not accuracy
  • Delayed labels, adversarial drift and frequent retraining
  • Time-based validation and shadow testing before rollout

Model answer

Fraud is rare, often well under 1% of transactions, and both missed fraud and blocked good customers are costly, so I optimise expected cost and use precision-recall metrics. The decision must happen in tens of milliseconds. Strong signals are behavioural, such as how many transactions a card made in the last hour, new device, or distance from usual locations, so I compute these in a streaming feature store that serves the same definitions online and offline. A gradient-boosted model scores each transaction, combined with hard rules for known patterns, and thresholds map scores to approve, challenge or block based on cost. Labels arrive late through chargebacks, and fraudsters adapt, so I validate on later time periods, retrain often and monitor score distributions and fraud rates. New models run in shadow mode before taking over.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Machine Learning Engineer questions