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.

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.

EasyTechnical
59 practiced

Write a small Express middleware in Node.js that checks for a bearer token in the Authorization header, rejects requests with a 401 JSON response when missing or invalid, and logs request id and path. Provide the middleware signature and briefly describe how you'd integrate it into the request pipeline and unit-test it.

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.

That is every published API Security, Authentication and Authorization question for AI Engineer so far. Browse the other topics in this category, or practice this one interactively.