Skip to content
Tech Interview Prep
Technical interview guide

Multi-Factor Authentication Design

Combining independent authentication factors, and why some MFA methods are meaningfully stronger than others.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v6
Editorial status
Reviewed

Scope: NIST SP 800-63B-4, WebAuthn Level 3, FIDO passkey guidance, TOTP/HOTP, CISA, and OWASP guidance current 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Multi-Factor Authentication Design

In one line

Combine factors that fail independently so a stolen password alone never signs anyone in, and rank methods by whether they resist phishing and relay. Reach for it on every login, and require phishing-resistant WebAuthn for administrators and high-impact actions.

Key definitions

  • Factor independence: each factor's compromise path shares no channel with the others (email, phone number, password vault, helpdesk).
  • AAL2 / AAL3: NIST SP 800-63B assurance levels. AAL2 needs two different factor types. AAL3 needs a hardware-based authenticator with verifier-impersonation resistance.
  • Relay: a proxy forwards a typed code or confirmation to the real service in real time.
  • RP ID: the WebAuthn relying-party identifier. The authenticator scopes its signature to it, so it is the security boundary, not the URL.
  • Step-up: a fresh factor bound to one user, session and action, demanded before a sensitive request.
  • Phishing resistance: the response is bound to the origin and RP ID, so a copy of the site cannot reuse it.

Formulas and complexity

rpIdHash=SHA-256(RP ID)(32 bytes)\mathrm{rpIdHash} = \mathrm{SHA\text{-}256}(\text{RP ID}) \quad (32\ \text{bytes}) TOTP space per attempt window=106 codes (6 digits)\text{TOTP space per attempt window} = 10^{6} \text{ codes (6 digits)} Consecutive failed attempts per account, SP 800-63B cap=100\text{Consecutive failed attempts per account, SP 800-63B cap} = 100

How it works

The user proves the first factor, and the verifier issues a challenge for the second. The authenticator signs that challenge together with the origin and RP ID it actually saw. The server checks the signature, rpIdHash, origin, type, and the UP or UV flags against policy, then issues a session at the assigned AAL. A proxy page changes the origin, so the signature fails at the real site.

Password verified Server issues fresh challenge Authenticator signs challenge with origin and RP ID Server checks signature, rpIdHash, origin, type, UV Session at assigned AAL

When to use and when not to

MethodUse it forAvoid it for
SMS or voice OTPRestricted fallback where risk allowsAdmins, high-impact actions, any strong-assurance flow
TOTP (RFC 6238)Transitional or fallback factorAnything where real-time relay is a credible threat
Push with number matchingConsumer login with rate limits and denial handlingBlind approval, flows with no transaction context
Synced passkeyBroad user base, recovery through the sync providerAAL3 actions (SP 800-63B bars syncable authenticators from AAL3)
Hardware-bound WebAuthn with UVAdmins, payouts, key rotation, privilege changesUsers who cannot enroll a key and have no accessible alternative

Traps interviewers probe

  1. Calling TOTP phishing resistant. The secret never travels, but the typed code can be relayed inside the window. Fix: use WebAuthn for sensitive flows and say where TOTP remains acceptable.
  2. Recovery that bypasses the login. A helpdesk call or email reset can remove MFA entirely. Fix: treat recovery as an authentication path at equal or higher assurance, with a delay and notification.
  3. Two factors on one channel. Email reset plus email OTP is one factor. Fix: audit each factor's compromise path and show they do not overlap.
  4. Push without context. An unsolicited prompt becomes a session once someone taps approve. Fix: number matching, transaction context, rate limits, and stopping the flow after repeated denials.
  5. Accepting the wrong ceremony type. A registration response with type webauthn.get is not a registration. Fix: reject it, and verify type, origin, challenge and rpIdHash on every ceremony.

Interview tips

Open with "What are we defending against?" then walk the threat table, and let the threat pick the method. Expect these follow-ups: how you would take over this account (walk login, recovery, helpdesk, sync provider and session theft); why TOTP is not phishing resistant; what happens when the only device is lost; how you roll out without locking out half the users; and whether the server stores a fingerprint (it does not, the biometric only unlocks the local key).

30-second outline: Name the threat. Assign AAL to the action. Pick WebAuthn for admins and high-impact actions, and say why the signature is bound to the RP ID. Name the fallback and its limit. Close by naming the recovery path, since that is where most designs fail.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.