Skip to main content

ML System Design: Abuse Detection — Account Takeover, Bots, and Velocity Beyond Spam

Design a cross-product abuse platform distinct from content spam — credential stuffing, account takeover (ATO), synthetic accounts, scraping, and collusion rings. Covers device graphs, velocity features in Redis, challenge escalation (CAPTCHA, step-up auth), feedback loops when labels are delayed, and why Meta-style integrity teams separate abuse from policy-violating content classifiers.

56 min read 8 sections 6 interview questions
Abuse DetectionAccount TakeoverBot DetectionCredential StuffingVelocity FeaturesDevice GraphRisk ScoringStep-Up AuthenticationGraph Neural NetworkRedisFeedback LoopIntegrity Engineering

Abuse Is Behavioral and Graphy — Not Just Text

Spam classifiers score bodies of text or media. Abuse systems score actions over time — login failures, password resets, IP / ASN churn, device fingerprint reuse, headless signals, API rate anomalies. Labels are sparse, delayed (chargebacks, victim reports), and adversarial — attackers A/B your defenses.

Interviewers want latency budgets for pre-auth checks, post-auth async graph jobs, and human review queues with SLA.

IMPORTANT

Differentiation from Fraud and Spam

Fraud optimizes money loss with transaction context. Spam optimizes content policy. Abuse optimizes platform integrity — accounts, APIs, social graphs — metrics: ATO rate, fake signup %, scrape bandwidth.

Clarifying Questions

01

Abuse class

ATO vs scraping vs fake accounts — feature families differ.

02

Latency band

Login path vs async post-login — sub-20ms vs seconds.

03

User friction budget

Step-up auth rate cap — product will veto high FPR.

04

Global vs regulated markets

SMS OTP legality, data localization.

05

Label source

Support tickets, chargebacks, honeypots — bias audit.

Feature Families — Velocity, Device, Graph

Velocity: Counts per IP / device / user in rolling windows — Redis with TTL buckets (1m, 10m, 24h). Signals: failed logins, distinct accounts per device, geo velocity impossibility.

Device intelligence: Fingerprint stability, emulator flags, TLS fingerprint (JA3), header order anomalies for bots.

Graph: Shared phone across accounts, referral cycle motifs — offline GNN or union-find components for ring detection; online scoring uses cached embeddings.

Abuse Scoring Path — Sync Gate vs Async Graph

Rendering diagram...

Actions by Risk Tier

Risk score bandUser experienceEngineering cost
LowSilent allowBaseline traffic
MediumCAPTCHA or SMS step-upSupport tickets rise if miscalibrated
HighBlock plus cooldownFalse positives viral on social
Graph-confirmed ringBulk disable with appealLegal review
RecommendedCalibrated thresholds shadow mode firstIterate with PR curve
⚠ WARNING

Suppression and Delayed Labels

Blocking stops the negative label stream — models starve on hard positives. Use shadow scoring, honeypot credentials, and external breach intel as weak labels.

TIP

Interview Closer

"I'd combine sub-10ms velocity and device signals with a compact GBM in the request path, enqueue graph enrichers asynchronously for account clusters, calibrate thresholds on dollarized harm plus UX friction, and run shadow mode before tightening blocks."

Interview Questions

Click to reveal answers