Updated recently
Last updated:
Quick Answer: Key API testing interview topics: HTTP methods and status codes, REST vs SOAP vs GraphQL, authentication (OAuth, JWT, Bearer), Postman test scripts, Rest Assured BDD syntax, schema validation, and contract testing with Pact.
Basic API Testing Interview Questions
1. What is the difference between API testing and UI testing?
API testing validates backend logic by sending HTTP requests directly. UI testing validates the user interface by interacting with visible elements. API testing is faster and catches backend bugs earlier.
2. What are the main HTTP methods?
GET (read), POST (create), PUT (full update), PATCH (partial update), DELETE (remove).
3. What is the difference between 200, 201, and 204?
200 OK: succeeded. 201 Created: resource created. 204 No Content: succeeded but no response body.
4. What is the difference between REST and SOAP?
REST is lightweight, uses JSON, runs over HTTP. SOAP is XML-based, uses WSDL, supports WS-Security.
5. What is the difference between authentication and authorization?
Authentication verifies identity. Authorization determines permissions.
Intermediate API Testing Interview Questions
6. What is OAuth 2.0?
An authorization framework for third-party app access. Flows: Authorization Code (most secure), Client Credentials (machine-to-machine).
7. What is a JWT token?
JSON Web Token: compact, URL-safe token with claims (user ID, roles, expiry). Self-contained, no server lookup needed.
8. How do you validate API response schemas?
Use JSON Schema validation in Postman or Rest Assured (body(“$”, hasKey(“id”))).
9. What is contract testing?
Verifies API consumers and providers agree on data format using tools like Pact.
10. How do you test API performance?
Use k6, JMeter, or Artillery for concurrent requests and response time measurement.
Advanced API Testing Interview Questions
11. How do you test idempotency?
Send the same PUT/DELETE request twice and verify the second returns the same result without side effects.
12. How do you test rate limiting?
Send requests above the rate limit and verify 429 Too Many Requests response.
13. What is the difference between mocking and stubbing?
Stubbing returns predefined responses. Mocking simulates full behavior including state changes.
14. How do you test file uploads via API?
Use multipart/form-data content type. Verify 201 response and file metadata.
15. How do you handle API versioning?
Test against specific version endpoints (/api/v1/users). Maintain separate test suites per version.
Training Resources
Master API testing with SkilBrill API Testing Training.
FAQ
How do I prepare for an API testing interview?
Master HTTP fundamentals, Postman scripting, Rest Assured BDD, authentication (OAuth, JWT), and schema validation.
