InterviewStack.io LogoInterviewStack.io

API Testing Fundamentals Questions

Comprehensive coverage of testing application programming interfaces. Topics include HTTP methods and semantics, status codes, headers, payload formats such as JSON and XML, authentication and authorization mechanisms, request and response structure, and common API failure modes. Candidates should be able to design API test cases that include positive negative and boundary inputs, handle dynamic response data such as pagination and transient fields, and validate responses with assertions on status codes headers bodies schemas and response times. Additional areas include mocking and stubbing dependencies contract and schema validation, test data management and environment configuration, writing reusable programmatic API tests using tools such as Postman REST Assured and Python requests, and integrating API tests into continuous integration workflows for reliable automated verification.

MediumSystem Design
72 practiced
Describe how you would integrate API tests into a CI pipeline that requires environment configuration and secrets (API keys, certificates). Cover secure secret storage, parameterization of endpoints for different environments, choosing which suites run on PRs vs nightly runs, and how to avoid leaking secrets in logs.
EasyTechnical
56 practiced
Using Python requests, write a concise automated test that checks the health endpoint GET /health returns HTTP 200, Content-Type application/json, and a JSON body containing {"status": "ok"}. Assume base_url is provided. Include clear assertions and minimal error handling so the test is idempotent and suitable for CI (use pytest-style assertions).
MediumTechnical
64 practiced
Design automated tests to verify API rate limiting behavior and Retry-After header semantics without causing harm to production systems. Include the load patterns you would generate, safe test windows, how to assert both soft and hard limits, and how to make tests both reliable and non-invasive.
MediumTechnical
73 practiced
Explain how you would implement consumer-driven contract testing with Pact across microservices. Describe the typical workflow: consumer test creation that generates a pact, publishing to a broker, provider verification against provider builds, handling versioning and tagging, and how to avoid false positives/negatives in CI pipelines.
EasyTechnical
71 practiced
Explain how you would test caching semantics for an API resource that supports ETag and Last-Modified headers. Describe a sequence of automated requests and assertions to verify correct 304 Not Modified responses, ETag change after updates, and correct Cache-Control directives.

Unlock Full Question Bank

Get access to hundreds of API Testing Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.