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.

HardTechnical
67 practiced

Build automated tests to detect field level authorization bypass in a GraphQL service where some schema fields should only be visible to certain roles. Provide a practical test script example (for instance in Python or JavaScript) that: 1) enumerates accessible fields for an admin user, 2) repeats the same queries for a low privilege user, and 3) asserts unauthorized fields are absent or redacted. Explain how to handle schema introspection differences between environments.

HardSystem Design
55 practiced

You need an automated emergency revocation and credential rotation plan for compromised client credentials affecting thousands of clients. What would you build? Include detection triggers, mass-revocation mechanics, phased rotation, client notification strategies, fallback modes to preserve critical functionality, and automated rollback if revocations cause unintended outages.

HardTechnical
61 practiced

How would you handle authentication token lifecycle and rotation for long-lived API clients such as IoT devices? Include token issuance, refresh, rotation, revocation, offline device handling, heartbeat strategies, secure storage on device, and methods for detecting and responding to token compromise.

HardSystem Design
68 practiced

Propose a policy-as-code solution (for example using Open Policy Agent - OPA) to enforce attribute-based access control across APIs. Describe where policies should evaluate (sidecar, gateway, service), policy distribution/versioning, performance strategies (caching/compile-time optimizations), CI testing of policies, and how to secure attribute sources and mitigate stale attributes.

MediumTechnical
59 practiced

Propose detection and mitigation strategies for credential stuffing and automated account takeover attempts on login endpoints. Propose telemetry signals (IP velocity, failed-login patterns, device fingerprinting), anomaly detection heuristics, progressive throttling and challenge mechanisms (CAPTCHA, MFA step-up), and techniques to minimize false positives while blocking automated abuse.

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.