KatInterview

Sub-50ms Payment Risk Scoring Service for Peak Traffic

System DesignModel answer
MediumModel answerSystem Designml-system-designlow-latencyfeature-store

Last updated

Architect an online scoring service that labels each card payment as approve, flag or block within 50 ms, handles 10k+ RPS and spikes, and ships new models with no downtime.

You are designing the risk-scoring layer for a payments platform that handles millions of card transactions per day. Each authorization request passes through this layer before it is completed.

Required behavior

  • Every transaction must receive one of three outcomes: Approve, Flag (let it through but trigger manual review or step-up authentication), or Block.
  • The full decision must come back within 50 ms per transaction.
  • The platform must sustain 10,000+ requests per second and still succeed at a high rate during sudden surges such as holiday sales.
  • Models must be replaceable without any service interruption.

What to cover in your answer

  1. Requirements and capacity estimates.
  2. Overall architecture and the request path.
  3. How features are produced, stored and served, both online and offline.
  4. Model choice and serving strategy.
  5. Scaling, fault tolerance and graceful degradation.
  6. Rollout of new models, monitoring and day-to-day operation.

State any assumptions you make, and explain the trade-offs behind your main decisions.

Hints

Hint 1

Start with numbers: translate 'millions per day' into average RPS, then compare it with the stated peak and a surge multiplier, and write a per-step latency budget that leaves headroom for tail latency.

Hint 2

Separate what must happen on the critical path (feature lookup, rules, inference, thresholding) from what can be asynchronous (logging, aggregate updates, case creation). Think about how features computed in a stream could lag behind a burst of attacks.

Hint 3

For model updates, think in stages: shadow traffic, then a canary split keyed consistently, then an atomic pointer swap with the old version kept warm. For overload, define an ordered degradation ladder rather than a single fallback.