QA
🔑
Core Engineering

Authentication & Authorization Interview Questions

Identity management, single sign-on (SSO), refresh token rotation, cross-domain cookies, WebAuthn passkeys, and authorization policy engines.

🎯 Ready to test your knowledge?

Take Authentication & Authorization Skill Assessment Quiz

First prepare from the 100 learning questions below, then test your skills with 15 random MCQs categorized into Beginner, Intermediate, and Senior levels.

Launch 15-MCQ Quiz →
Experience Level:

Showing 100 Questions

Beginner LevelAuthentication & Authorization

1. Compare JWT Token Authentication versus Stateful Sessions, and explain OAuth 2.0 PKCE flow.

❓ Context: Detail security trade-offs of storing JWTs in httpOnly cookies vs localStorage, token revocation strategies, and OAuth 2.0 PKCE for SPAs.

1. Stateful Sessions vs Stateless JWTs:

•
Stateful Sessions: Stored in server memory or Redis with a session ID sent via 'httpOnly' cookie. Easy to revoke instantly on the server, but requires a shared session store across microservices.
•
Stateless JWTs: Self-contained signed tokens containing claims. Great for decoupled microservices, but invalidating them before natural expiration requires token blacklists or short TTLs.

Storage Security Trade-Offs:

Storing tokens in 'localStorage' makes them accessible to client-side JavaScript, leaving them vulnerable to Cross-Site Scripting (XSS). The gold standard pattern is storing access tokens in memory and long-lived refresh tokens in 'httpOnly, Secure, SameSite=Strict' cookies.

OAuth 2.0 PKCE Flow:

Proof Key for Code Exchange (PKCE) replaces client secrets for public clients (SPAs, mobile apps). It generates a dynamic cryptographically random code verifier and code challenge per authorization attempt, preventing authorization code interception attacks.

typescript
// Express.js secure httpOnly cookie configuration for refresh tokens
res.cookie('refreshToken', token, {
  httpOnly: true,     // Blocks JavaScript document.cookie XSS access
  secure: true,       // Enforces HTTPS transmission only
  sameSite: 'strict', // Prevents Cross-Site Request Forgery (CSRF)
  maxAge: 7 * 24 * 60 * 60 * 1000 // 7 Days TTL
});
💡Express.js secure httpOnly cookie configuration for refresh token storage.
🎯 Interview Key Takeaway

Store refresh tokens in httpOnly SameSite=Strict cookies to protect against XSS and CSRF attacks.

#Authentication#JWT#OAuth#Security#Beginner
Permalink
Beginner LevelAuthentication & Authorization

2. What is the fundamental difference between Authentication (AuthN) and Authorization (AuthZ)?

Beginner LevelAuthentication & Authorization

3. Why should passwords never be stored in plain text and how do bcrypt and Argon2id work?

Beginner LevelAuthentication & Authorization

5. What are the 3 parts of a JSON Web Token (JWT) and how is the signature validated?

Beginner LevelAuthentication & Authorization

6. What is the difference between Access Tokens and Refresh Tokens?

Beginner LevelAuthentication & Authorization

7. What are the 4 core roles in the OAuth 2.0 Framework (RFC 6749)?

Beginner LevelAuthentication & Authorization

8. What is Single Sign-On (SSO) and what are its core architectural benefits?

Beginner LevelAuthentication & Authorization

9. What is Role-Based Access Control (RBAC) and how do Roles and Permissions map?

Beginner LevelAuthentication & Authorization

10. How does Two-Factor Authentication (2FA) using TOTP (Time-based One-Time Passwords) work?

Beginner LevelAuthentication & Authorization

12. Compare HTTP Basic Authentication versus Bearer Token Authentication.

Beginner LevelAuthentication & Authorization

13. What is OpenID Connect (OIDC) and how does it extend OAuth 2.0 for Identity?

Beginner LevelAuthentication & Authorization

14. What are Passkeys (WebAuthn / FIDO2) and how do they eliminate passwords?

Beginner LevelAuthentication & Authorization

15. What is Attribute-Based Access Control (ABAC) and how does it compare to RBAC?

Beginner LevelAuthentication & Authorization

16. Why must Access-Control-Allow-Credentials: true be configured carefully with CORS?

Beginner LevelAuthentication & Authorization

18. What are API Keys and when are they appropriate for service-to-service authentication?

Beginner LevelAuthentication & Authorization

19. What is a Session Fixation attack and how do you prevent it during login?

Beginner LevelAuthentication & Authorization

20. Why are the exp (Expiration Time), iat (Issued At), and nbf (Not Before) claims critical in JWTs?

Beginner LevelAuthentication & Authorization

21. How do you implement Logout for Stateful Sessions versus Stateless JWTs?

Beginner LevelAuthentication & Authorization

22. How do Cross-Domain SSO redirects exchange authentication tokens safely?

Beginner LevelAuthentication & Authorization

23. What is HMAC Request Signing and how does it prevent API payload tampering?

Beginner LevelAuthentication & Authorization

24. What is SAML 2.0 (Security Assertion Markup Language) and where is it used?

Beginner LevelAuthentication & Authorization

26. Why are Account Lockout and Login Endpoint Rate Limiting necessary?

Beginner LevelAuthentication & Authorization

27. What are OAuth 2.0 Scopes and how do they restrict API access boundaries?

Beginner LevelAuthentication & Authorization

28. How does Social Login (Sign in with Google/GitHub) work via OAuth 2.0 and OIDC?

Beginner LevelAuthentication & Authorization

29. Why are Security Questions considered insecure compared to TOTP or Hardware Security Keys?

Intermediate LevelAuthentication & Authorization

31. How do you implement OAuth 2.0 PKCE (Proof Key for Code Exchange) step-by-step?

Intermediate LevelAuthentication & Authorization

32. What is the difference between Symmetric (HS256) and Asymmetric (RS256/ES256) JWT signing?

Intermediate LevelAuthentication & Authorization

33. How do JWKS (JSON Web Key Sets) endpoints enable zero-downtime key rotation?

Intermediate LevelAuthentication & Authorization

34. What is Open Policy Agent (OPA) and how does it decouple authorization policy from application code?

Intermediate LevelAuthentication & Authorization

35. What is Relationship-Based Access Control (ReBAC) and the Google Zanzibar model?

Intermediate LevelAuthentication & Authorization

36. How do you design a High-Availability Distributed Session Store using Redis Cluster?

Intermediate LevelAuthentication & Authorization

37. How do WebAuthn Registration and Authentication Ceremonies work technically?

Intermediate LevelAuthentication & Authorization

38. What is the OAuth 2.0 Device Authorization Grant (Device Flow / RFC 8628)?

Intermediate LevelAuthentication & Authorization

39. How does the OAuth 2.0 Client Credentials Grant work for Machine-to-Machine (M2M) microservices?

Intermediate LevelAuthentication & Authorization

40. What is Step-Up Authentication and how do you require re-authentication for high-risk actions?

Intermediate LevelAuthentication & Authorization

41. What is OAuth 2.0 Token Exchange (RFC 8693) and how does it handle microservice delegation?

Intermediate LevelAuthentication & Authorization

42. What is DPoP (Demonstrating Proof-of-Possession / RFC 9449) and how does it prevent token theft?

Intermediate LevelAuthentication & Authorization

43. How does Mutual TLS (mTLS) Client Certificate Authentication bind identity to TCP connections?

Intermediate LevelAuthentication & Authorization

44. How do you tune Argon2id parameters (memory cost m, time cost t, parallelism p)?

Intermediate LevelAuthentication & Authorization

45. How do you securely implement User Impersonation for customer support teams?

Intermediate LevelAuthentication & Authorization

47. How does Hierarchical RBAC implement role inheritance across permission trees?

Intermediate LevelAuthentication & Authorization

48. How does Contextual Risk-Based Authentication adjust security policies based on IP/Location/Device?

Intermediate LevelAuthentication & Authorization

49. What is XML Signature Wrapping (XSW) in SAML 2.0 and how do you defend against it?

Intermediate LevelAuthentication & Authorization

50. How does the OIDC /userinfo endpoint supply additional identity claims?

Intermediate LevelAuthentication & Authorization

51. What is Single Logout (SLO) in SAML and OIDC and how are back-channel notifications sent?

Intermediate LevelAuthentication & Authorization

52. How do you design a Multi-Tenant Auth system supporting custom Enterprise IdPs per tenant?

Intermediate LevelAuthentication & Authorization

53. What is SCIM (System for Cross-domain Identity Management) 2.0 protocol?

Intermediate LevelAuthentication & Authorization

54. How do you handle authentication securely in Next.js App Router Server Actions and Middleware?

Intermediate LevelAuthentication & Authorization

55. What was the JWT "none" algorithm vulnerability and how do modern libraries defend against it?

Intermediate LevelAuthentication & Authorization

56. How do you detect and mitigate Session Hijacking attempts?

Intermediate LevelAuthentication & Authorization

57. What is Cross-Site Script Inclusion (XSSI) and how do JSON prefixes prevent payload leaks?

Intermediate LevelAuthentication & Authorization

58. How does Refresh Token Reuse Detection automatically revoke compromised token families?

Intermediate LevelAuthentication & Authorization

59. How do Referrer-Policy headers prevent Authorization Bearer token leakage in GET requests?

Intermediate LevelAuthentication & Authorization

60. What is Keycloak and how does it act as an open-source Identity and Access Management (IAM) server?

Intermediate LevelAuthentication & Authorization

61. What is OAuth 2.0 Token Introspection (RFC 7662) and when should Resource Servers use it?

Intermediate LevelAuthentication & Authorization

62. What is a Nested JWT (JWE containing a signed JWS) and when is it required?

Intermediate LevelAuthentication & Authorization

63. How do custom Authorization header schemes (Authorization: Signature ...) function?

Intermediate LevelAuthentication & Authorization

64. Compare storing tokens in sessionStorage vs IndexedDB vs Web Workers.

Intermediate LevelAuthentication & Authorization

65. How do you design a secure "Remember Me" persistent authentication feature?

Intermediate LevelAuthentication & Authorization

66. How do you enrich JWT payloads with custom authorization claims without bloating token size?

Intermediate LevelAuthentication & Authorization

67. How do you design a secure Password Reset token generation and verification flow?

Intermediate LevelAuthentication & Authorization

68. Why should login Rate Limiting evaluate both IP address AND targeted User Account?

Intermediate LevelAuthentication & Authorization

69. Why must the sub (Subject) claim in JWTs be an immutable static user ID?

Intermediate LevelAuthentication & Authorization

70. What security attributes must be captured in Authentication Audit Logs?

Senior LevelAuthentication & Authorization

71. How does Google Zanzibar achieve global consistency and microsecond authorization checks using Zookies?

Senior LevelAuthentication & Authorization

72. How do Continuous Adaptive Risk and Authorization Assessment (CARTA) and Zero-Trust Architectures operate?

Senior LevelAuthentication & Authorization

73. What is GNAP (Grant Negotiation and Authorization Protocol) and how does it succeed OAuth 2.0?

Senior LevelAuthentication & Authorization

74. How do you validate FIDO2 Authenticator Attestation Statements (TPM, Android SafetyNet, Apple WebAuthn)?

Senior LevelAuthentication & Authorization

75. What is Token Binding (RFC 8471) and how does TLS Exporter bind security tokens to underlying TLS keys?

Senior LevelAuthentication & Authorization

76. How do SPIFFE / SPIRE establish Workload Identity in cloud-native Kubernetes clusters?

Senior LevelAuthentication & Authorization

77. What is OAuth 2.0 Pushed Authorization Requests (PAR / RFC 9126) and why does it enhance security?

Senior LevelAuthentication & Authorization

78. What is OAuth 2.0 Rich Authorization Requests (RAR / RFC 9396) for complex financial transactions?

Senior LevelAuthentication & Authorization

79. What is the Financial-grade API (FAPI 2.0) Security Profile and how does it secure Open Banking APIs?

Senior LevelAuthentication & Authorization

80. How do you design a High-Throughput Cryptographic Nonce Verification Engine to prevent replay attacks?

Senior LevelAuthentication & Authorization

81. How do you architect a Custom Identity Federation Engine supporting multi-protocol translation (SAML to OIDC to JWT)?

Senior LevelAuthentication & Authorization

82. Compare Multi-Device Synced Passkeys (iCloud Keychain / Google Password Manager) vs Hardware-Bound Keys (YubiKey).

Senior LevelAuthentication & Authorization

83. How do Hardware Security Modules (HSMs) and Cloud KMS manage master JWT signing keys?

Senior LevelAuthentication & Authorization

84. What is the Cedar Policy Language and how does AWS Verified Permissions evaluate fine-grained authorization?

Senior LevelAuthentication & Authorization

85. How do you execute Sub-Second Distributed Session Invalidation across globally distributed edge regions?

Senior LevelAuthentication & Authorization

86. How do you resolve HTTP Header Bloat caused by large JWTs using compression or claim pruning?

Senior LevelAuthentication & Authorization

87. How do Secure Enclaves (Apple SE, ARM TrustZone) isolate biometric authentication private keys?

Senior LevelAuthentication & Authorization

88. How do you implement a Custom OAuth 2.0 Grant Type in an enterprise Authorization Server?

Senior LevelAuthentication & Authorization

89. What is HAWK HTTP Authentication and how does MAC-based request signing work without public key crypto?

Senior LevelAuthentication & Authorization

90. How do Zero-Knowledge Proofs (ZKP / zk-SNARKs) enable Privacy-Preserving Authentication?

Senior LevelAuthentication & Authorization

91. How do you apply STRIDE Threat Modeling to identify security vulnerabilities in Authentication Architecture?

Senior LevelAuthentication & Authorization

92. How will Post-Quantum Cryptography (NIST ML-KEM / ML-DSA) impact digital signatures and TLS handshakes?

Senior LevelAuthentication & Authorization

93. How does the SAML 2.0 Attribute Query Profile allow Service Providers to query Identity Providers out-of-band?

Senior LevelAuthentication & Authorization

94. How do COOP (Cross-Origin-Opener-Policy) and COEP headers impact popup-based OAuth authentication flows?

Senior LevelAuthentication & Authorization

95. What is the Continuous Access Evaluation Protocol (CAEP / Shared Signals Framework)?

Senior LevelAuthentication & Authorization

96. What are OAuth 2.0 Resource Indicators (RFC 8707) and how do they bind tokens to specific API target audiences?

Senior LevelAuthentication & Authorization

97. How do you write Constant-Time String Comparison functions to defend against Timing Side-Channel Attacks?

Senior LevelAuthentication & Authorization

98. How do you design Multi-Tenant JWT Signing Key Isolation for enterprise SaaS platforms?

Senior LevelAuthentication & Authorization

99. How do TLS Session Tickets (RFC 5077 / TLS 1.3) execute stateless TLS session resumption?

Senior LevelAuthentication & Authorization

100. What is the future trajectory of Authentication & Authorization (Universal Passkeys, Decentralized Identity, Agentic IAM)?

How to Prepare for Authentication & Authorization Technical Interviews in 2026

When interviewing for software engineering positions that utilize Authentication & Authorization, hiring managers look for a combination of fundamental syntax proficiency, architectural understanding, code optimization techniques, and practical debugging skills.

🌱 Beginner FocusCore syntax, default configurations, standard API definitions, and avoiding common basic errors.
⚡ Intermediate FocusAsync execution patterns, performance profiling, component lifecycle, and state management.
🏆 Senior FocusInternal runtime mechanics, memory leaks, scalability bottlenecks, system design trade-offs, and security mitigation.