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.

HardSystem Design
61 practiced

Lay out the authentication and authorization model for internal data APIs that must enforce fine-grained access controls per dataset, integrate with corporate SSO, audit all accesses, and support service-to-service auth with rotating credentials. Discuss token lifetimes, caching auth decisions, centralized policy engines (OPA), and audit log design for compliance.

MediumSystem Design
57 practiced

You need to implement rate-limited, audited access to an internal model endpoint for external contractors. Specify the OAuth flow, token scopes, per-call logging, and how you would detect suspicious use patterns that might indicate data exfiltration.

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
51 practiced

You're building a secure webhook receiver for third-party partners. Requirements: authenticate payloads, prevent replay attacks, support retries while ensuring idempotency, scale to high volume, and allow secret rotation. Describe signing schemes (HMAC vs asymmetric), replay defenses (timestamps, unique IDs), idempotency handling and operational patterns for secret rotation.

EasyTechnical
55 practiced

Explain the differences between input validation, schema/contract validation (OpenAPI/JSON Schema), and output encoding. Give concrete examples of how each prevents different attack classes such as SQL injection, XSS, and parameter pollution, and list common developer mistakes that lead to validation bypasses.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.