---Advertisement---

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

By Manisha

Published On:

---Advertisement---

Sample Test Cases

  1. Validate correct data in each field.
  2. Check API responses with missing payloads.
  3. Verify authentication failure returns 401 Unauthorized.
  4. Ensure 403 Forbidden is returned for unauthorized access.
  5. Validate API handles invalid characters and special symbols.
  6. Check pagination, filtering, and sorting in responses.
  7. Verify search functionality with partial/multiple word strings.
  8. Ensure correct language and locale-based representations.
  9. Test file upload/download API functionality.
  10. Validate compression using the Accept-Encoding: gzip header.

Interview Questions & Answers

Q1. What is the purpose of response headers in API testing?
A: They provide metadata (like content type, caching policies) about the response.

Q2. How do you test API security?
A: By testing authentication, authorization, input validation, and rate limiting.

Q3. What is content negotiation in REST APIs?
A: The process where the client specifies media type preferences via headers.

Q4. What is the difference between 401 and 403 status codes?
A: 401 is Unauthorized (no or invalid credentials), 403 is Forbidden (access denied).

Q5. How do you validate sorting and filtering in APIs?
A: By sending appropriate parameters and verifying the response data order.

👉The Next Questions-3: API TEST CASES

---Advertisement---

Leave a Comment