Multi-factor authentication

DesignMedium35 minMicrosoft and Google style

Your task

Design the multi-factor authentication and account-recovery subsystem for a 200M-user identity provider supporting TOTP authenticator apps, SMS/voice OTP, and hardware security keys, with brute-force and credential-stuffing protection, and a recovery flow for users who lose their second factor. The login path peaks at 100K verifications/sec. Walk through how factors are enrolled and stored, how verification stays fast and abuse-resistant, and the security trade-offs in account recovery.

It covers

  • Mfa
  • Account recovery
  • Rate limiting