Design Login Attempt Throttling to Stop Credential Stuffing on Facebook
Last updated: November 29, 2026
Quick Overview
Design a system that throttles suspicious login attempts on Facebook to stop credential stuffing and brute-force attacks while keeping legitimate users, including people behind shared carrier IPs, able to log in.
Meta
November 29, 20260
0
0 solved
Design a system that throttles suspicious login attempts on Facebook to stop credential stuffing and brute-force attacks while keeping legitimate users, including people behind shared carrier IPs, able to log in.
Meta's integrity and security infrastructure teams ask this because login is attacked constantly by botnets using leaked password lists. The interviewer wants to see layered limits on several keys, awareness that IP-based limits hurt mobile users on carrier NAT, and escalation to challenges instead of hard blocks.
What the Interviewer Expects
- Limit on multiple dimensions: account, IP, IP subnet, device, and password hash fingerprint
- Prefer graduated responses (delay, CAPTCHA, checkpoint) over flat blocks
- Account for carrier-grade NAT and shared IPs
- Keep the check fast and fail safely
- Feed outcomes into risk models and allow quick rule updates
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you detect a slow, distributed attack that stays under every per-IP limit?
- How would you avoid letting attackers lock out a victim by failing logins on purpose?
- What data would you store, and for how long, given privacy constraints?
- How do you measure false positives on real users?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: count failed and total login attempts per account, per IP, per /24 or ASN, per device id, and per attempted-password fingerprint (a keyed hash, never the password). When thresholds are...
High-Level Design
Login requests go through the auth service, which calls a login risk service. It reads counters from a low-latency in-memory store (sharded counters with TTLs) and combines them with signals: devi...