---Advertisement---

API Test Cases and Interview Question and Answers (Level-3)

By Manisha

Published On:

---Advertisement---

Sample Test Cases

  1. Validate nested object/array data representation.
  2. Test handling of concurrent requests.
  3. Verify custom headers and response on specific request headers.
  4. Validate API behavior with rate limiting, throttling, and retries.
  5. Ensure API handles redirects, cookies, and caching correctly.
  6. Validate API response under SSL/TLS encryption.
  7. Test resistance to SQL Injection, XSS, and CSRF attacks.
  8. Verify correct versioning behavior (v1, v2, etc.).
  9. Validate behavior on network failures, timeouts, and race conditions.
  10. Test for correct handling of batch requests and webhooks.

Interview Questions & Answers

Q1. How do you test the scalability of an API?
A: By load testing using tools like JMeter or Locust under varying user loads.

Q2. What is OAuth and how is it tested in APIs?
A: OAuth is an open standard for access delegation. Test using valid and expired tokens.

Q3. What are common API vulnerabilities?
A: SQL Injection, XSS, CSRF, broken authentication, insecure data storage.

Q4. How do you test API rate limits?
A: By sending requests rapidly and ensuring the server enforces rate limits with status code 429.

Q5. How do you handle API versioning?
A: By using URI versioning (/v1/), header versioning, or query parameters.

---Advertisement---

Leave a Comment