← Questions

Design an account takeover detection system

0
StripeAI/ML designLast asked Oct 2025

An AI/ML design interview question asked in Stripe's system design round, last asked Oct 2025. It tests fraud, anomaly detection and real-time ml.

Design a system that spots logins and sensitive account changes made by someone other than the account's owner, for example after stolen credentials or a hijacked session. Score each event in real time and decide whether to allow it, challenge the user (a one-time code, a passkey), or block it.

Requirements

  • Functional: score login attempts and sensitive actions (changing email, password, payout bank account, adding an API key); return allow, challenge or block; notify the owner of risky events; let a support team review and recover accounts; feed confirmed takeovers back as labels.
  • Non-functional: decisions in tens of milliseconds; very few real users challenged; strong protection for the highest-risk actions, such as changing where money is paid out.

Clarifying questions

  • Which events must be scored: logins only, or also session activity and account changes?
  • What signals exist: device fingerprints, IP and location, login history, password-breach data, behavior after login?
  • How are takeovers confirmed, and how long does that take?
  • What challenges can we ask for, and how much friction do they cost?
  • Are the accounts businesses with several team members, or individual users?

What a strong answer covers

  • Framing: scoring an event against the account's own history (is this the usual device, network, location, time, behavior?) as well as population-level risk.
  • Features: new device or browser, IP reputation and distance from usual locations, impossible travel, failed-attempt velocity per account and per IP, credentials found in breach lists, session behavior after login, the sensitivity of the action.
  • Labels: confirmed takeovers from support and owner reports, with delays; challenge outcomes (passed or failed) as weaker labels; the bias that challenged events are the ones you learn about.
  • Models: rules for clear attacks (credential stuffing from one IP), plus a gradient-boosted model, with per-account anomaly features.
  • Policy: thresholds that depend on the action (a payout change needs more certainty to allow than a page view), step-up authentication as the middle path, and notifying the owner.
  • Evaluation and monitoring: takeover rate, challenge rate and pass rate, false blocks reported to support, and drift as attackers shift.

Follow-ups

  • Attackers steal session cookies instead of passwords, so no login happens. What do you detect instead?
  • A user travels abroad and gets locked out. How do you reduce that friction?
  • How do you protect a business account where several employees log in from different places?

Where it's asked

What it tests

fraud · anomaly detection · real-time ml

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing