Design a service that scores card transactions for fraud in real time. You’ll be judged on reasoning and collaboration rather than product trivia.
Answer
Model answer, written in a candidate's voice
In short
- Clarify requirements first: latency budget, throughput, availability, consistency, and what the decision is allowed to do
- Architecture: ingestion stream -> feature lookup -> scoring -> decisioning -> feedback loop
- Failure modes and fallbacks: degrade gracefully when features, model, or store are unavailable
- Bottlenecks at scale: feature lookup, inference, hot keys, and the feedback path
- ML issues: feature freshness, training/serving skew, delayed labels
- Collaborate: ask the interviewer what matters most, invite pushback, and iterate
In full
I’d start by asking you what the latency budget, throughput, availability target, and consistency expectations are, and what the decision is allowed to do — block, step-up auth, or just flag — because that shapes everything. Roughly, I’d design a streaming ingest path into a feature lookup layer, a scoring service that runs the model, a decisioning step that applies policy, and a feedback loop that captures outcomes and retrains. I’d also want to know how much we can afford to be wrong, since that determines whether we fail open or closed. On failure modes, I’d make the scoring path time-boxed and fall back to a safe default — e.g., a simpler rule or a step-up challenge — if features or the model are unavailable, rather than blocking every transaction. At scale, the bottlenecks are feature freshness and lookup latency, inference throughput, and hot keys on popular cards, so I’d watch those and keep the hot path minimal. On the ML side, I’d worry about feature freshness, training/serving skew between offline and online features, and delayed labels, since fraud outcomes arrive days later and the model can drift before we see them. I’d also want to hear what you think matters most — latency, accuracy, or explainability — and adjust the design with you rather than presenting a fixed answer.
What a strong answer covers
- Clarifies requirements: latency, throughput, availability, consistency
- Clean architecture: ingest, feature lookup, scoring, decisioning, feedback loop
- Failure modes and fallbacks
- Bottlenecks at scale
- ML-specific issues: feature freshness, training/serving skew, delayed labels
- Works with the interviewer
Common mistakes
- Jumping straight to named tools
- Going silent and skipping failure handling