All problems

Fraud Detection

Score every checkout in real time — before the payment ships.

hard~24 min Pro Simulator · +140 ptsTheory +43 pts
The build

Score every checkout inside the latency budget through a card-testing attack, a dead scorer, and a feature-store outage.

A fraud decision that arrives late is worse than useless — the payment ships unscored either way. The scoring path is synchronous and cache-fronted so a feature-store blip barely shows; a small slice of traffic mirrors into an async pipeline that keeps the model current without ever touching the hot path's latency budget.

Components in play

  • Checkout gatewayFields every checkout and routes it to a scorer — and mirrors a slice to the async pipeline.
  • Fraud scorersRuns the model against live features and returns allow/deny/review inside the latency budget.
  • Feature cacheServes the hot feature vectors so a scorer never waits on the feature store.
  • Feature storeDurable source of truth for account, device and velocity features.
  • Decision streamDurable log of scored decisions, off the synchronous hot path.
  • Model-refresh workersConsume the decision stream to retrain and refresh the live model.
  • Decision logDurable audit trail of every scoring decision.

Graded on these SLOs

  • ≥ 97.00%Checkouts get scored
  • ≤ 150 msDecision p99
  • ≥ 13k rpsSustain the checkout rate
  • ≤ 90%Headroom
  • ≤ 13Lean footprint
Base 13,000 rps45s run 4 scripted failures

The brief

Design a real-time fraud-scoring service that sits on every checkout. Given a live feature vector (account, device, velocity signals), the model has to return allow / deny / review inside a tight latency budget — a decision that arrives too late doesn't stop anything, because the payment ships unscored anyway.

Functional

  • Score every checkout against the live model and return a decision
  • Keep features (account, device, velocity signals) fresh and fast to read
  • Log every decision durably for audit and dispute resolution

Non-functional

  • A decision must land inside a tight latency budget (well under 150ms) or it's useless
  • Fraud rings launch sudden, spiky attacks (card-testing) — the scoring path can't fall over under one
  • Model refresh and decision logging must never slow down a live decision

Warm-up: design decisions

Optional theory to prime the calls a senior engineer would make before you build.

Pro

Solving is a Pro feature

Unlock the on-canvas AI design coach, per-run design reviews, the chaos simulator and all 12 problems for $15/month.

  • AI design coach on your canvas — pins failure points & over-engineering
  • Honest AI design review on every run
  • All 12 problems + unlimited chaos simulator
  • Points, levels & leaderboard
Get started