Skip to content

API Security interview questions — Medium

347 medium-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 medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. "Hash-based signature proving request integrity and origin" — in API Security, this describes which of the following?

    • A. HMAC signature.correct
    • B. Bearer token.
    • C. MTLS.
    • D. Refresh token.

    Why: HMAC signature: Hash-based signature proving request integrity and origin.

  2. 2. "Authorized simulated attack to find exploitable weaknesses" — in API Security, this describes which of the following?

    • A. Token expiry (exp claim).
    • B. Refresh token.
    • C. Penetration testing.correct
    • D. OWASP API Security Top 10.

    Why: penetration testing: Authorized simulated attack to find exploitable weaknesses.

  3. 3. "Permission granted to a token limiting what it can do" — in API Security, this describes which of the following?

    • A. OWASP API Security Top 10.
    • B. IDOR.
    • C. Scope.correct
    • D. MTLS.

    Why: scope: Permission granted to a token limiting what it can do.

  4. 4. "Long-lived credential exchanged for new access tokens" — in API Security, this describes which of the following?

    • A. Refresh token.correct
    • B. HMAC signature.
    • C. IDOR.
    • D. Bearer token.

    Why: refresh token: Long-lived credential exchanged for new access tokens.

  5. 5. "Mutual TLS where client and server both present certificates" — in API Security, this describes which of the following?

    • A. Scope.
    • B. MTLS.correct
    • C. Refresh token.
    • D. HMAC signature.

    Why: mTLS: Mutual TLS where client and server both present certificates.

  6. 6. "Insecure Direct Object Reference: accessing others' data via IDs" — in API Security, this describes which of the following?

    • A. IDOR.correct
    • B. Penetration testing.
    • C. Bearer token.
    • D. Scope.

    Why: IDOR: Insecure Direct Object Reference: accessing others' data via IDs.

  7. 7. "Credential presented in the Authorization header to access an API" — in API Security, this describes which of the following?

    • A. Refresh token.
    • B. HMAC signature.
    • C. Penetration testing.
    • D. Bearer token.correct

    Why: Bearer token: Credential presented in the Authorization header to access an API.

  8. 8. Which of the following statements about API Security is TRUE?

    • A. API keys are stronger and more granular than OAuth user tokens in every case.
    • B. A JWT consists of a header, payload, and signature separated by dots.correct
    • C. JWT payloads are encrypted so their contents can never be read.
    • D. Storing passwords in a JWT payload is a recommended practice.

    Why: Signatures let servers verify tokens without a database lookup.

  9. 9. Which statement correctly describes API Security?

    • A. API keys are stronger and more granular than OAuth user tokens in every case.
    • B. A JWT consists of a header, payload, and signature separated by dots.correct
    • C. BOLA vulnerabilities are prevented automatically by using HTTPS.
    • D. OAuth 2.0 requires sharing the user's password with every client application.

    Why: Signatures let servers verify tokens without a database lookup.

  10. 10. Identify the accurate statement about API Security:

    • A. OAuth 2.0 requires sharing the user's password with every client application.
    • B. A JWT consists of a header, payload, and signature separated by dots.correct
    • C. Expired tokens should still be accepted for a grace period of several days by default.
    • D. JWT payloads are encrypted so their contents can never be read.

    Why: Signatures let servers verify tokens without a database lookup.

  11. 11. In API Security, which of the following is described as: "Industry list of the most critical API vulnerabilities"?

    • A. OWASP API Security Top 10.correct
    • B. Scope.
    • C. Penetration testing.
    • D. MTLS.

    Why: OWASP API Security Top 10: Industry list of the most critical API vulnerabilities.

  12. 12. Which API Security concept matches this description: "Long-lived credential exchanged for new access tokens"?

    • A. Refresh token.correct
    • B. Token expiry (exp claim).
    • C. Scope.
    • D. HMAC signature.

    Why: refresh token: Long-lived credential exchanged for new access tokens.

  13. 13. In API Security, which of the following is described as: "Long-lived credential exchanged for new access tokens"?

    • A. OWASP API Security Top 10.
    • B. Refresh token.correct
    • C. Token expiry (exp claim).
    • D. IDOR.

    Why: refresh token: Long-lived credential exchanged for new access tokens.

  14. 14. In API Security, which of the following is described as: "Authorized simulated attack to find exploitable weaknesses"?

    • A. HMAC signature.
    • B. Scope.
    • C. IDOR.
    • D. Penetration testing.correct

    Why: penetration testing: Authorized simulated attack to find exploitable weaknesses.

  15. 15. In API Security, which of the following is described as: "Mutual TLS where client and server both present certificates"?

    • A. Scope.
    • B. Bearer token.
    • C. MTLS.correct
    • D. IDOR.

    Why: mTLS: Mutual TLS where client and server both present certificates.

  16. 16. In API Security, which of the following is described as: "Permission granted to a token limiting what it can do"?

    • A. OWASP API Security Top 10.
    • B. MTLS.
    • C. Scope.correct
    • D. Token expiry (exp claim).

    Why: scope: Permission granted to a token limiting what it can do.

  17. 17. In API Security, which of the following is described as: "Hash-based signature proving request integrity and origin"?

    • A. HMAC signature.correct
    • B. Bearer token.
    • C. OWASP API Security Top 10.
    • D. MTLS.

    Why: HMAC signature: Hash-based signature proving request integrity and origin.

  18. 18. In the context of API Security, which of the following is a correct statement?

    • A. Storing passwords in a JWT payload is a recommended practice.
    • B. BOLA vulnerabilities are prevented automatically by using HTTPS.
    • C. A JWT consists of a header, payload, and signature separated by dots.correct
    • D. Rate limiting should respond with HTTP 200 when the limit is exceeded.

    Why: Signatures let servers verify tokens without a database lookup.

  19. 19. In API Security, which of the following is described as: "Insecure Direct Object Reference: accessing others' data via IDs"?

    • A. Penetration testing.
    • B. Token expiry (exp claim).
    • C. Refresh token.
    • D. IDOR.correct

    Why: IDOR: Insecure Direct Object Reference: accessing others' data via IDs.

  20. 20. Which API Security concept matches this description: "Authorized simulated attack to find exploitable weaknesses"?

    • A. Refresh token.
    • B. Bearer token.
    • C. IDOR.
    • D. Penetration testing.correct

    Why: penetration testing: Authorized simulated attack to find exploitable weaknesses.

Related API Testing topics