Interview Q&A · questions with model answers
Authentication Interview Questions
Part of the study plan for: Backend Engineer · Full Stack Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked Explain the OAuth 2.0 Authorization Code flow with PKCE.
The client redirects the user to the authorization server with a code challenge; after login and consent, the server redirects back with a one-time authorization code, which the client exchanges…
-
Most asked How do refresh tokens work, and how do you secure them?
A refresh token is a longer-lived credential used only at the token endpoint to obtain new short-lived access tokens without re-login. Secure it with rotation (each use issues a new one and…
-
Most asked How should passwords be stored?
Never store plaintext or reversible encryption; store a slow, salted, adaptive hash using Argon2id (preferred), scrypt or bcrypt, and verify with the library's constant-time comparison. Rehash when…
-
How do services authenticate to each other?
Common options are OAuth 2.0 client credentials (a service gets a short-lived access token from the IdP using its own credentials), mutual TLS (both sides present certificates, often via a service…
-
How should mobile apps handle authentication?
Use the Authorization Code flow with PKCE via the system browser (ASWebAuthenticationSession / Custom Tabs), store tokens in the secure OS keystore (Keychain/Keystore), use short-lived access tokens…
-
How does JWKS-based key rotation work for JWTs?
The issuer publishes its public keys at a JWKS endpoint; each token header has a kid identifying the signing key. Verifiers cache the JWKS and pick the key by kid, so the issuer can introduce a new…
-
How does authentication change in multi-tenant B2B applications?
Users may belong to multiple tenants (organizations), each tenant may require its own SSO (SAML/OIDC) and MFA policy, and every token or session must carry the active tenant so authorization can…