Interview question bank

API Testing Interview Questions and Answers

52 API Testing interview questions, each with a short answer you can say in the interview, a detailed explanation, a real-world example and an interview tip; 24 of them are marked as frequently asked. Freshers can start with the first section; experienced testers can jump to the harder questions.

API Testing interview questions for freshers

Beginner3 Years Frequently asked

1. What is the difference between PUT and PATCH? When do you test each?

Answer: PUT replaces the whole resource and is idempotent; PATCH applies a partial update. Both should be idempotent-safe, but PATCH bodies are diffs.

Detailed explanation, example and interview tip

Test PUT by omitting a field and verifying it is reset/removed; test PATCH by verifying untouched fields are preserved. Also test repeated calls: two identical PUTs must leave the same state.

Real-world example

A PATCH bug where updating a phone number silently wiped the billing address was caught by asserting untouched fields.

Interview tip

Always mention the idempotency check — most candidates only recite definitions.

Beginner3 Years Frequently asked

2. Which HTTP status codes must an API tester know cold, and what do you assert beyond them?

Answer: 200/201/202, 204, 301/302, 400, 401 vs 403, 404, 409, 422, 429, 500/502/503 — and beyond the code you assert body schema, headers, and side effects.

Detailed explanation, example and interview tip

The pairs that matter most are 401 (not authenticated) vs 403 (authenticated but not allowed), and 400 (malformed) vs 422 (well-formed but semantically invalid). A status code alone is a weak assertion: verify the response schema, the error contract (code, message, field), cache and content-type headers, and that the resource actually changed by re-reading it. 429 deserves explicit tests when the API is public — assert Retry-After. 5xx in a test should fail loudly rather than be retried away.

java
1given().auth().oauth2(readOnlyToken)
2 .body(newOrder)
3.when().post("/orders")
4.then()
5 .statusCode(403)
6 .body("code", equalTo("INSUFFICIENT_SCOPE"))
7 .body("message", not(emptyString()))
8 .header("Content-Type", containsString("application/json"));

Real-world example

An API returned 200 with an error object inside the body; asserting only the status code hid the bug for two sprints.

Interview tip

Say 'the status code is the weakest assertion in the response' — it reframes the whole answer.

Beginner3 Years Frequently asked

3. What is HTTP methods, and why does it matter in API Testing?

Answer: HTTP methods is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of HTTP methods should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used HTTP methods to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner5 Years Frequently asked

4. What is request bodies, and why does it matter in API Testing?

Answer: request bodies is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of request bodies should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used request bodies to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner7 Years Frequently asked

5. What is contract testing, and why does it matter in API Testing?

Answer: contract testing is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of contract testing should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used contract testing to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner10+ Years Frequently asked

6. What is caching, and why does it matter in API Testing?

Answer: caching is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of caching should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used caching to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner3 Years

7. How would you apply status codes in a production API Testing project?

Answer: Apply status codes through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that status codes controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused status codes check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing status codes.

Beginner3 Years

8. What is request headers, and why does it matter in API Testing?

Answer: request headers is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of request headers should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used request headers to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner3 Years

9. How would you apply path and query parameters in a production API Testing project?

Answer: Apply path and query parameters through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that path and query parameters controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused path and query parameters check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing path and query parameters.

Beginner5 Years

10. How would you apply authorization in a production API Testing project?

Answer: Apply authorization through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that authorization controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused authorization check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing authorization.

Beginner5 Years

11. What is pagination, and why does it matter in API Testing?

Answer: pagination is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of pagination should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used pagination to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner5 Years

12. How would you apply schema validation in a production API Testing project?

Answer: Apply schema validation through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that schema validation controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused schema validation check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing schema validation.

Beginner7 Years

13. How would you apply boundary testing in a production API Testing project?

Answer: Apply boundary testing through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that boundary testing controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused boundary testing check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing boundary testing.

Beginner7 Years

14. What is rate limiting, and why does it matter in API Testing?

Answer: rate limiting is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of rate limiting should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used rate limiting to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Beginner7 Years

15. How would you apply timeouts in a production API Testing project?

Answer: Apply timeouts through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that timeouts controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused timeouts check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing timeouts.

Beginner10+ Years

16. How would you apply eventual consistency in a production API Testing project?

Answer: Apply eventual consistency through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that eventual consistency controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused eventual consistency check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing eventual consistency.

Beginner10+ Years

17. What is webhooks, and why does it matter in API Testing?

Answer: webhooks is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of webhooks should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used webhooks to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

API Testing interview questions for experienced testers

Intermediate5 Years Frequently asked

18. How do you validate a response schema, and why is that better than field-by-field asserts?

Answer: Validate against a JSON Schema (or the OpenAPI spec) so types, required fields and enums are checked in one assertion that fails when the contract drifts.

Detailed explanation, example and interview tip

Field asserts only cover the fields you remembered; a schema covers everything, including a field that silently changed from number to string. Generate the schema from the OpenAPI document so the test fails when the implementation and spec diverge, which is the actual bug you want to catch. Combine schema validation (structure) with targeted business assertions (values), and keep additionalProperties strict on responses you own so new fields are reviewed deliberately.

java
1import static io.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchemaInClasspath;
2
3given().auth().oauth2(token)
4.when().get("/orders/{id}", orderId)
5.then()
6 .statusCode(200)
7 .body(matchesJsonSchemaInClasspath("schemas/order-schema.json"))
8 .body("status", oneOf("PENDING", "PAID", "SHIPPED"))
9 .body("total", greaterThan(0f));

Real-world example

A backend refactor changed total from a number to a formatted string; the schema test failed within minutes of the merge.

Interview tip

Say you generate schemas from OpenAPI rather than hand-writing them — that is the contract-testing mindset.

Intermediate5 Years Frequently asked

19. How do you handle OAuth2 / JWT authentication in an API suite?

Answer: Fetch a token once per run through the client-credentials or password grant, cache it until shortly before expiry, and attach it via a request specification — never hardcode tokens.

Detailed explanation, example and interview tip

Requesting a token per test is slow and can trip rate limits, so cache it with a small safety margin before exp and refresh transparently. Decode the JWT to assert claims (scope, roles, tenant) when authorisation itself is under test. Store credentials in CI secrets and read them from environment variables so nothing sensitive lands in git. Negative tests matter as much: expired token, wrong audience, missing scope, and a token from another tenant should all be rejected with the documented status.

java
1public final class TokenProvider {
2 private static String token;
3 private static Instant expiresAt = Instant.EPOCH;
4
5 public static synchronized String get() {
6 if (Instant.now().isBefore(expiresAt.minusSeconds(60))) return token;
7 Response r = given()
8 .formParam("grant_type", "client_credentials")
9 .formParam("client_id", System.getenv("CLIENT_ID"))
10 .formParam("client_secret", System.getenv("CLIENT_SECRET"))
11 .post("/oauth/token");
12 token = r.jsonPath().getString("access_token");
13 expiresAt = Instant.now().plusSeconds(r.jsonPath().getLong("expires_in"));
14 return token;
15 }
16}

Real-world example

A nightly API suite hit the identity provider 900 times per run; caching the token cut it to four calls and removed rate-limit failures.

Interview tip

List the negative auth cases — candidates who only fetch a happy-path token sound junior.

Intermediate3 Years Frequently asked

20. How would you apply HTTP methods in a production API Testing project?

Answer: Apply HTTP methods through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that HTTP methods controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused HTTP methods check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing HTTP methods.

Intermediate3 Years Frequently asked

21. How would you apply request headers in a production API Testing project?

Answer: Apply request headers through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that request headers controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused request headers check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing request headers.

Intermediate3 Years Frequently asked

22. What is content negotiation, and why does it matter in API Testing?

Answer: content negotiation is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of content negotiation should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used content negotiation to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate5 Years Frequently asked

23. How would you apply request bodies in a production API Testing project?

Answer: Apply request bodies through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that request bodies controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused request bodies check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing request bodies.

Intermediate5 Years Frequently asked

24. How would you apply pagination in a production API Testing project?

Answer: Apply pagination through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that pagination controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused pagination check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing pagination.

Intermediate5 Years Frequently asked

25. What is sorting and filtering, and why does it matter in API Testing?

Answer: sorting and filtering is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of sorting and filtering should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used sorting and filtering to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate7 Years Frequently asked

26. How would you apply contract testing in a production API Testing project?

Answer: Apply contract testing through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that contract testing controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused contract testing check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing contract testing.

Intermediate7 Years Frequently asked

27. How would you apply rate limiting in a production API Testing project?

Answer: Apply rate limiting through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that rate limiting controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused rate limiting check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing rate limiting.

Intermediate7 Years Frequently asked

28. What is retries, and why does it matter in API Testing?

Answer: retries is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of retries should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used retries to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate10+ Years Frequently asked

29. How would you apply caching in a production API Testing project?

Answer: Apply caching through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that caching controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused caching check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing caching.

Intermediate10+ Years Frequently asked

30. How would you apply webhooks in a production API Testing project?

Answer: Apply webhooks through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that webhooks controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused webhooks check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing webhooks.

Intermediate10+ Years Frequently asked

31. What is GraphQL testing, and why does it matter in API Testing?

Answer: GraphQL testing is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of GraphQL testing should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used GraphQL testing to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate5 Years

32. How do you chain requests and manage test data for API tests?

Answer: Create prerequisites through the API itself, extract ids from the response, pass them to the next call, and clean up in teardown — no dependence on pre-seeded records.

Detailed explanation, example and interview tip

Tests that rely on a magic record in staging break the moment someone edits it, so each test should create what it needs and delete it afterwards. Extract ids with JsonPath into typed variables rather than parsing strings, and keep the chain inside one test when the steps form a single business flow. When creation is expensive, use a fixture created once per suite and give each test a unique field (email, reference) so parallel runs do not collide. Clean up in a finally/teardown so failures do not leave residue.

java
1String customerId = given().body(new Customer(uniqueEmail())).post("/customers")
2 .then().statusCode(201).extract().path("id");
3
4String orderId = given().body(new Order(customerId, "SKU-9")).post("/orders")
5 .then().statusCode(201).extract().path("id");
6
7given().post("/orders/{id}/pay", orderId).then().statusCode(200);
8given().get("/orders/{id}", orderId).then().body("status", equalTo("PAID"));
9
10// teardown
11given().delete("/orders/{id}", orderId).then().statusCode(anyOf(is(204), is(404)));

Real-world example

Parallel API runs failed intermittently until every test generated its own customer email instead of sharing one fixture.

Interview tip

Say 'each test owns its data' — it is the phrase that signals suite-scale experience.

Intermediate3 Years

33. What is idempotency, and why does it matter in API Testing?

Answer: idempotency is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of idempotency should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used idempotency to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate5 Years

34. What is authentication, and why does it matter in API Testing?

Answer: authentication is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of authentication should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used authentication to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate7 Years

35. What is negative testing, and why does it matter in API Testing?

Answer: negative testing is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of negative testing should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used negative testing to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Intermediate10+ Years

36. What is ETags, and why does it matter in API Testing?

Answer: ETags is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of ETags should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used ETags to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced API Testing interview questions

Advanced3 Years Frequently asked

37. What is status codes, and why does it matter in API Testing?

Answer: status codes is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of status codes should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used status codes to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced5 Years Frequently asked

38. What is authorization, and why does it matter in API Testing?

Answer: authorization is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of authorization should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used authorization to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced7 Years Frequently asked

39. What is boundary testing, and why does it matter in API Testing?

Answer: boundary testing is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of boundary testing should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used boundary testing to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced10+ Years Frequently asked

40. What is eventual consistency, and why does it matter in API Testing?

Answer: eventual consistency is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of eventual consistency should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used eventual consistency to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced7 Years

41. How do you test idempotency and retries?

Answer: Send the same request twice with the same Idempotency-Key and assert one resource is created; GET, PUT and DELETE must be naturally idempotent, POST needs a key.

Detailed explanation, example and interview tip

Idempotency matters because clients and gateways retry: a double-charged payment is the classic production incident. The test sends the identical POST twice, expects 201 then 200 (or 201 with the same resource id), and verifies with a list query that only one record exists. For PUT, repeat the same body and assert the resource is unchanged; for DELETE, the second call should be 204 or 404 by contract, never 500. Also test the negative: same key with a different body must be rejected.

java
1String key = UUID.randomUUID().toString();
2
3Response first = given().header("Idempotency-Key", key).body(payment)
4 .when().post("/payments");
5Response second = given().header("Idempotency-Key", key).body(payment)
6 .when().post("/payments");
7
8assertThat(first.statusCode(), is(201));
9assertThat(second.jsonPath().getString("id"), equalTo(first.jsonPath().getString("id")));
10
11int count = given().queryParam("reference", payment.getReference())
12 .when().get("/payments").jsonPath().getList("items").size();
13assertThat(count, is(1));

Real-world example

A retry in the mobile client created duplicate orders; an idempotency test now runs on every build of the orders service.

Interview tip

Mention the same-key-different-body case — that is the test most teams forget.

Advanced3 Years

42. How would you apply idempotency in a production API Testing project?

Answer: Apply idempotency through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that idempotency controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused idempotency check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing idempotency.

Advanced3 Years

43. How would you apply content negotiation in a production API Testing project?

Answer: Apply content negotiation through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that content negotiation controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused content negotiation check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing content negotiation.

Advanced3 Years

44. What is path and query parameters, and why does it matter in API Testing?

Answer: path and query parameters is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of path and query parameters should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used path and query parameters to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced5 Years

45. How would you apply authentication in a production API Testing project?

Answer: Apply authentication through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that authentication controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused authentication check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing authentication.

Advanced5 Years

46. How would you apply sorting and filtering in a production API Testing project?

Answer: Apply sorting and filtering through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that sorting and filtering controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused sorting and filtering check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing sorting and filtering.

Advanced5 Years

47. What is schema validation, and why does it matter in API Testing?

Answer: schema validation is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of schema validation should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used schema validation to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced7 Years

48. How would you apply negative testing in a production API Testing project?

Answer: Apply negative testing through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that negative testing controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused negative testing check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing negative testing.

Advanced7 Years

49. How would you apply retries in a production API Testing project?

Answer: Apply retries through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that retries controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused retries check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing retries.

Advanced7 Years

50. What is timeouts, and why does it matter in API Testing?

Answer: timeouts is a core API Testing concept used to make testing decisions more accurate, repeatable, and aligned with product risk.

Detailed explanation, example and interview tip

A strong explanation of timeouts should cover its purpose, the problem it solves, when it is appropriate, and where it can mislead a team. In API Testing, use it deliberately rather than as a checklist item: connect it to observable behavior, choose clear pass/fail evidence, and record assumptions so another engineer can reproduce the result.

Real-world example

During release planning, the team used timeouts to focus validation on the most important behavior and to communicate residual risk before deployment.

Interview tip

Answer in four parts: definition, suitable use case, limitation, and a concrete project example.

Advanced10+ Years

51. How would you apply ETags in a production API Testing project?

Answer: Apply ETags through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that ETags controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused ETags check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing ETags.

Advanced10+ Years

52. How would you apply GraphQL testing in a production API Testing project?

Answer: Apply GraphQL testing through an explicit, repeatable design: define the expected behavior, automate the highest-risk path, capture useful diagnostics, and verify the result against a stable oracle.

Detailed explanation, example and interview tip

In a production API Testing project, start by identifying the risk that GraphQL testing controls and the evidence needed to prove the behavior. Keep setup, action, verification, and cleanup separate; parameterize environment-specific values; and make failures explain the business impact. Run the smallest relevant check on each change, broader coverage in the pipeline, and review flaky or slow results rather than hiding them with retries.

Real-world example

A team introduced a focused GraphQL testing check at the layer closest to the risk, attached diagnostics to failures, and used the result as a release signal instead of relying on manual confirmation.

Interview tip

Describe one trade-off, one failure mode, and one measurable outcome when discussing GraphQL testing.

Interview questions by subject

Want to search across every subject? Open the full question bank.