API Security interview questions — Hard
175 hard-level API Security questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.
What this covers
API Security appears throughout API Testing interviews. At hard level, interviewers are typically checking depth under pressure — edge cases, failure modes, performance characteristics, and the trade-offs you accepted. Work through these, then explain your answer out loud; the second part is what interviews actually test.
4 example questions
1. Which of the following statements about API Security is FALSE?
- A. A JWT consists of a header, payload, and signature separated by dots.
- B. OAuth 2.0 is an authorization framework where clients obtain access tokens to call APIs.
- C. Broken Object Level Authorization (BOLA) means users can access objects belonging to others by changing IDs.
- D. BOLA vulnerabilities are prevented automatically by using HTTPS.correct
Why: The selected statement is false. The other options are accurate statements about API Security.
2. Regarding API Security, which of the following is a false statement?
- A. BOLA vulnerabilities are prevented automatically by using HTTPS.correct
- B. Security tests should confirm sensitive data is never exposed in URLs or logs.
- C. API keys identify the calling application but are weaker than user-level OAuth tokens.
- D. SQL injection tests send crafted input to detect unsanitized query construction.
Why: The selected statement is false. The other options are accurate statements about API Security.
3. Identify the INCORRECT statement about API Security:
- A. JWTs are encoded, not encrypted: anyone can decode and read the payload.
- B. Expired tokens should still be accepted for a grace period of several days by default.correct
- C. The client credentials grant is used for machine-to-machine authentication without a user.
- D. Rate limiting protects APIs from abuse and should return 429 when exceeded.
Why: The selected statement is false. The other options are accurate statements about API Security.
4. Which statement about API Security is NOT correct?
- A. Security tests should confirm sensitive data is never exposed in URLs or logs.
- B. API keys are stronger and more granular than OAuth user tokens in every case.correct
- C. A JWT consists of a header, payload, and signature separated by dots.
- D. Rate limiting protects APIs from abuse and should return 429 when exceeded.
Why: The selected statement is false. The other options are accurate statements about API Security.