Design a CAPTCHA Service

System Design
Medium
Microsoft
22.5K views

Design a system to protect against bots (like Google reCAPTCHA). Focus on the challenge generation, validation, and evolving techniques to stay ahead of automated attacks.

Why Interviewers Ask This

Interviewers at Microsoft ask this to evaluate your ability to design secure, scalable systems that balance user experience with robust bot mitigation. They specifically look for your understanding of the adversarial nature of CAPTCHA, where attackers constantly evolve to bypass simple challenges while legitimate users require frictionless access.

How to Answer This Question

1. Clarify requirements: Define scale (requests per second), latency constraints, and specific bot types to target (e.g., credential stuffing vs. scraping). 2. Outline core components: Propose a generation service for challenges, a validation engine, and a threat intelligence database. 3. Discuss challenge evolution: Explain how you move beyond static images to behavioral analysis, device fingerprinting, and risk-based scoring. 4. Address scalability: Detail how to use caching layers like Redis for fast token verification and sharding for high-throughput generation. 5. Plan for security: Describe rate limiting, anomaly detection algorithms, and a feedback loop to retrain models based on false positives or new attack vectors.

Key Points to Cover

  • Implementing a risk-based scoring system to minimize friction for legitimate users
  • Designing an adaptive challenge generator that supports multiple modalities
  • Utilizing distributed caching for high-throughput, low-latency validation
  • Incorporating behavioral biometrics and device fingerprinting for stealth detection
  • Establishing a continuous feedback loop to retrain models against new threats

Sample Answer

To design a CAPTCHA service similar to Microsoft's approach, I would first focus on a risk-based architecture rather than showing challenges to every user. We start by analyzing request metadata like IP reputation, geolo…

Common Mistakes to Avoid

  • Focusing only on static image challenges without addressing modern AI bypass techniques
  • Ignoring the user experience impact by suggesting challenges for every single request
  • Overlooking the need for a centralized threat intelligence database to share bot signatures
  • Failing to discuss how to scale the validation service during massive DDoS-like attacks

Sound confident on this question in 5 minutes

Answer once and get a 30-second AI critique of your structure, content, and delivery. First attempt is free — no signup needed.

Try it free

Related Interview Questions

Browse all 190 System Design questionsBrowse all 107 Microsoft questions