KatInterview

Shipping a Fraud Scoring Model: Rollout, Observability, 50 ms Tail

System DesignModel answer
MediumModel answerSystem Designmlopsmodel-deploymentmonitoring

Last updated

Plan how to release a fraud classifier to production, watch it over time, and bring its online p99 latency under 50 ms without giving up much accuracy.

Your team has trained a fraud classifier for card transactions and now has to run it in production. The model will be called synchronously during payment authorization, so it must answer quickly and reliably.

Answer the three parts below as you would in a system design discussion. State any assumptions you make (traffic, label delay, fallback behavior).

Part 1: Release

  • How do you get the model into production?
  • Which artifacts do you version, and how do you make rollouts safe and rollbacks fast?

Part 2: Observability

Once the model is live, how do you keep track of it? Describe what you measure for each of these areas:

  • service health
  • input data quality and drift
  • model quality
  • business outcomes

Part 3: Tail latency

The scoring endpoint currently misses its target of p99 latency under 50 ms.

  • How would you find out where the time goes?
  • Which concrete changes would you consider in the feature layer, the model, the infrastructure, and the serving stack to meet the target without an unacceptable drop in accuracy?

A strong answer covers the end-to-end flow, trade-offs between options, and the risks specific to fraud (delayed labels, class imbalance, adversaries, feedback loops).

Hints

Hint 1

Start by listing requirements: request rate, how long the authorization budget is, what happens when scoring fails, how late labels arrive, and how rare fraud is. These drive every later choice.

Hint 2

For release safety, think in stages: offline checks, shadow traffic, gradual canary with automatic guardrails, and a previous version kept warm. Remember that thresholds and rules can be versioned separately from the model.

Hint 3

For latency, measure before optimizing. Trace each stage of a request and look at the slowest 1%. Feature lookups are often the dominant cost, so look at batching, parallelism, co-location, timeouts with defaults, and async logging before touching the model itself.