Home › Blog › API Testing Interview Questions (2026): 32 Questions With Answers, Postman to Contracts

API Testing Interview Questions (2026): 32 Questions With Answers, Postman to Contracts

API testing interviews check that you can test a service without its UI: methods and status codes, positive, negative and boundary cases, authentication, schema and contract checks, test data, mocking, performance and security basics, and automating all of it in CI. Tools come up by name, usually Postman, REST Assured or a code-first stack, so know one well.

API testing interviews check that you can test a service without its UI: methods and status codes, positive, negative and boundary cases, authentication, schema and contract checks, test data, mocking, performance and security basics, and automating all of it in CI. Tools come up by name, usually Postman, REST Assured or a code-first stack, so know one well. Below are 32 questions by level with concise answers, five scenarios and how interviews test API skills; the security questions use the OWASP API Security Top 10, 2023 edition.

Status codes API testers should know

CodeMeaningWhat to test
200 / 201 / 204OK / Created / No Content201 returns the new resource or a Location header; 204 has no body
400Bad RequestMalformed JSON, wrong types, missing required fields
401 / 403Not authenticated / authenticated but not allowedMissing or expired token versus wrong role or another user's data
404 / 409Not Found / ConflictUnknown ids; duplicates and version conflicts
422Unprocessable ContentWell-formed input that breaks a business rule (some APIs use 400)
429Too Many RequestsRate limits, ideally with a Retry-After header
500 / 503Server error / Service UnavailableShould never leak stack traces; 503 signals a retry may work

Fundamentals

  1. What is API testing, and why test below the UI? Checking requests, responses, business rules, data and errors directly at the service layer. It is faster and more stable than UI testing, runs earlier, and covers integrations the UI never exercises.
  2. Which methods are safe and which are idempotent? Safe methods, such as GET, HEAD and OPTIONS, don't change state. Idempotent methods are the safe ones plus PUT and DELETE: repeating them leaves the same state. POST is not idempotent, and PATCH is not guaranteed to be. Test by repeating the call and checking state.
  3. PUT, PATCH or POST? POST creates or triggers an action, PUT replaces a whole resource at a known URL, and PATCH changes part of it. Test that PUT without a field clears it and PATCH without a field keeps it, if that is the documented behaviour.
  4. What do you check in a response? The status code, headers such as Content-Type, Location and caching, body values and types, the schema, response time, and side effects in the database or downstream services.
  5. How do you design test cases for one endpoint? Happy path; required and optional fields; boundary values; wrong types and formats; missing auth, wrong role and another user's ids; unknown ids; duplicates; oversized payloads; pagination; concurrent updates.
  6. Path, query, header or body parameters? Path parameters identify a resource, query parameters filter, sort and page, headers carry metadata such as auth and content type, and the body carries the payload. Test each for missing, empty, invalid and oversized values.
  7. Which authentication types do you test? API keys, Basic auth, bearer tokens such as JWTs, and OAuth 2.0 flows, for example client credentials between services and authorization code with PKCE for users. Test expired, malformed and tampered tokens and missing scopes.
  8. What is schema validation? Checking structure, types and required fields against a JSON Schema or OpenAPI definition. In Postman: pm.response.to.have.jsonSchema(schema). In REST Assured: matchesJsonSchemaInClasspath("order.json").
  9. How do you write a Postman test? In the request's script: pm.test("created", () => pm.response.to.have.status(201));. Collections group requests, environments hold variables per stage, and the collection runner iterates over data files.
  10. How do you run Postman collections in CI? Newman runs exported collections, for example newman run orders.json -e staging.json. Postman's docs now say Newman won't receive updates or fixes and recommend moving pipelines to the Postman CLI.
  11. What is the difference between 401 and 403? 401 means the caller is not authenticated: no token, or an invalid or expired one. 403 means the caller is authenticated but not allowed. Mixing them up is a common defect to report.

Intermediate

  1. Show a REST Assured test. given().auth().oauth2(token).when().get("/orders/42").then().statusCode(200).body("status", equalTo("PAID")); The given, when, then structure keeps setup, action and assertions apart.
  2. How do you chain requests? Extract a value from one response into a variable, for example pm.collectionVariables.set("orderId", pm.response.json().id), use it in the next request, and delete the data you created at the end.
  3. How do you test pagination? First, middle, last and empty pages; page-size limits and the maximum enforced; stable sorting; and, for cursor pagination, that inserts during paging don't cause duplicates or gaps.
  4. How do you test rate limiting? Exceed the limit and expect 429 with Retry-After, confirm requests succeed again after the window, and check whether the limit is per key, user or IP address as documented.
  5. What are mocks and service virtualization for? Replacing dependencies, using tools such as WireMock or a mock server generated from an OpenAPI file, so you can test timeouts, error codes and edge cases a real dependency won't produce on demand.
  6. What is contract testing? Consumer-driven contracts, as in Pact: consumer tests record the requests and responses they rely on, and the provider's pipeline verifies them before deploying. It catches breaking changes earlier than shared end-to-end environments.
  7. How is GraphQL testing different? One endpoint, queries and mutations in the body, and errors often returned in an errors array with HTTP 200. Test field-level authorization, query depth and cost limits, and whether introspection is enabled in production. See our GraphQL interview questions.
  8. How do you test asynchronous APIs and webhooks? Poll with a timeout instead of sleeping, run a webhook receiver in the test environment, verify signatures, and check that retries are processed idempotently.
  9. What is an idempotency key, and how do you test it? A client-generated key sent with a POST, often in an Idempotency-Key header, so a retried request doesn't create a second order or charge. Repeat the call with the same key and body and expect one result; reuse the key with a different body and expect an error.
  10. When do you check the database directly? When the API response can't prove a side effect, such as an audit record or a soft delete. Use read-only queries, and prefer verifying through another API call where one exists.

Experienced and senior

  1. Which OWASP API Security risks do you test first? API1:2023 Broken Object Level Authorization: request another user's object id with your token and expect 403 or 404. Then broken authentication, broken object property level authorization, unrestricted resource consumption and broken function level authorization, the top five of the 2023 list.
  2. How do you test for mass assignment? Send fields the client should not control, such as a role or price, in a create or update request, and confirm the API ignores or rejects them. OWASP's 2023 list files this under object property level authorization.
  3. How do you structure an API test framework? A thin client layer, request builders, reusable assertions, test data factories, configuration per environment, secrets from the CI vault, reporting, and data unique enough to run in parallel.
  4. Where do API tests run in the pipeline? Contract and component tests on every merge, functional API tests against an ephemeral or shared test environment, and a short smoke suite after each deploy.
  5. How do you test a chain of microservices? Propagate a correlation or trace id, allow for eventual consistency with polling, stub third parties, and keep most coverage in service-level and contract tests. Architecture background: our microservices interview questions.
  6. How do you test backward compatibility? Run the previous client version's tests against the new API, check that changes are additive, and verify deprecation headers and dates. The design side is in our REST API interview questions.
  7. How do API tests become flaky? Shared data, order dependence, time zones, eventual consistency and unstable environments. Use unique data per test, poll with timeouts, isolate dependencies with mocks and keep environments owned.
  8. Which transport and header checks matter? HTTPS only, sensible CORS rules, no secrets or personal data in URLs, error messages without stack traces, and security headers where the API serves browsers.
  9. How do you test an API with no documentation? Capture real traffic with browser developer tools or a proxy, ask developers for the contract, write characterization tests of current behaviour, and turn them into a draft OpenAPI file.
  10. How do you check API performance? Set latency budgets per endpoint, check response time in functional tests as a smoke signal, and run proper load tests separately; see our JMeter interview questions.
  11. What do you report when you find an API defect? The exact request (method, URL, headers without secrets, body), the response, expected versus actual, environment, correlation id and timestamp, so a developer can reproduce it in one step.

Five scenarios interviewers give

How interviews test API skills

Companies don't publish question banks, but QA and SDET candidates commonly report a live task (test a public or demo endpoint in Postman or code), a test-design exercise from an endpoint description, a debugging exercise with a failing request, and questions on status codes, auth and security. For the strategy around it, see our QA engineer interview questions.

Where CoPilot Interview fits

CoPilot Interview is an AI interview assistant whose free AI mock interview builds API testing and QA questions from your résumé and the job description, reads them aloud and scores each spoken answer out of 10. The browser demo at /try has 145 practice questions in 10 tracks, scored out of 10, with no signup. The free plan gives 15 minutes a day of live help in sessions of up to 15 minutes, with AI mock interviews included; Standard costs $24.99 a month and Pro $39.99. For role-specific prep, see our guide to practicing QA engineer interviews with AI. Live coding tasks, take-homes and online assessments usually forbid outside help, so prepare for those; in any live interview, follow your employer's rules.

Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly.

Frequently asked questions

What is the difference between API testing and UI testing?

API tests call the service directly and check data, rules and errors; UI tests drive the interface as a user would. API tests are faster and more stable, so most coverage belongs there, with a thin UI layer on top.

Which API testing tool is best?

The one the team uses. Postman suits exploration and shared collections, REST Assured suits Java teams, and Python or JavaScript test runners with an HTTP client suit code-first teams.

Is Newman deprecated?

Postman's documentation says Newman won't receive updates or fixes and recommends the Postman CLI for running collections in scripts and CI.

Should a validation error return 400 or 422?

Either can be right if the API is consistent: 400 for malformed requests, and 422 Unprocessable Content when the request is well formed but breaks a rule. Test against the documented contract.

How do I prepare for an API testing interview?

Pick a public API, write a small suite with positive, negative, auth and schema checks, run it from the command line, and practice explaining your test design out loud.

Practice this interview before the real one

The AI mock interview builds questions from your resume and the job description, reads them aloud and scores each spoken answer out of 10. Included on the free plan.

Start a mock interview