InterviewStack.io LogoInterviewStack.io

API Security, Authentication and Authorization Questions

Controlling who can call an API, what they may do, and defending it against abuse. Covers the access-control mechanics: API keys, OAuth 2.0 flows, OpenID Connect, JWT issuance/validation, session vs. token auth, scopes/roles for fine-grained authorization, token lifetime and refresh, mutual TLS, and machine-to-machine vs. user-delegated access. Also covers the adversarial hardening view: input validation, injection and deserialization risks, broken object-level authorization (BOLA), mass assignment, secrets handling, and the OWASP API Security Top 10, plus securing data in transit, preventing enumeration/scraping, and testing APIs for vulnerabilities.

MediumTechnical
49 practiced

Compare JWT-based stateless authentication and server-side session-based authentication stored in Redis. For a REST API expected to scale to millions of users, discuss trade-offs for scaling, token revocation, session invalidation, security implications of token theft, and complexity of implementation.

HardSystem Design
54 practiced

You're asked to architect a zero-trust setup for a hybrid environment exposing APIs to internal services, external partners, and mobile clients. Cover identity and access management, device posture checks, short-lived credentials, conditional access policies, service identity, TLS/mTLS, API gateway and enforcement points, and how to support clients in intermittent connectivity scenarios.

HardSystem Design
58 practiced

Architect a security model for a large-scale microservices platform (~1000 services) that uses a service mesh (e.g., Envoy/Istio) and an API gateway. Goals: enforce strong service-to-service authentication and authorization, minimize blast radius, centralize policy where sensible but avoid bottlenecks, ensure observability and incident response. Provide key components, identity model, policy enforcement points, rollout plan and scaling considerations.

HardSystem Design
66 practiced

Propose a policy and system to rotate and revoke long-lived API keys across 10,000 services and 1,000,000 keys with minimal client disruption. Describe centralized vs decentralized rotation, key versioning in the backend, publish/subscribe propagation of revocations, client notification strategies, and emergency revocation mechanisms.

MediumTechnical
50 practiced

A B2B customer integration needs strong authentication, auditability, and occasional offline batch transfers. Compare OAuth2 (confidential clients), mutual TLS, API keys, and JWT-based approaches for this scenario. Outline token lifecycle, rotation, scopes/least-privilege, revocation strategies, and developer ergonomics for each approach.

Unlock Full Question Bank

Get access to all 25 API Security, Authentication and Authorization interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.