Interview questions

API Testing Interview Questions

16 API testing interview questions on HTTP methods, status codes, auth, contract tests and automation, with model answers for testers and interviewers.

API Testing Interview Questions

What's here

16 API Testing interview questions, grouped into 4 areas: http and rest fundamentals, test design, tools and automation and non-functional testing. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.

  • Give the candidate an endpoint specification and ask them to list test cases in ten minutes
  • Ask them to automate one request with assertions in the team's tool or language
  • Probe authorisation testing with an ID-swapping scenario
For hiring teams

Cohesyve finds, contacts and tests API Testing candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.

Preparing for this interview yourself? Practise it free →

API testing interview questions come up for QA engineers, automation testers, SDETs and backend developers. Testing at the API level is faster and more stable than testing through the UI, and it catches problems in business logic, data and security that screens can hide. These questions cover HTTP fundamentals, test design, automation and non-functional testing. Candidates can use the 'what to look for' notes as model answers; interviewers can use them as a scoring guide.

HTTP and REST Fundamentals

The knowledge every API tester needs before writing a single test.

  1. 1

    What is the difference between GET, POST, PUT, PATCH and DELETE?

    Why ask it

    Basic knowledge that shapes what to test.

    What to look for

    GET retrieves a resource; POST creates or triggers processing; PUT replaces a resource; PATCH partially updates it; DELETE removes it. Strong candidates know which methods are safe and idempotent: under RFC 9110, GET, HEAD, OPTIONS and TRACE are safe, and PUT, DELETE and the safe methods are idempotent. POST is neither, and PATCH is not idempotent by definition.
  2. 2

    What does idempotent mean, and how would you test it?

    Why ask it

    Idempotency matters for retries and duplicate requests.

    What to look for

    Sending the same request several times has the same intended effect on the server as sending it once. Test by repeating a PUT or DELETE and checking the resource state and responses stay consistent; for POST endpoints that support idempotency keys, check that a repeated key does not create duplicates.
  3. 3

    Which HTTP status codes do you check most, and what do they mean?

    Why ask it

    Status codes are the first assertion in most API tests.

    What to look for

    2xx success (200 OK, 201 Created, 204 No Content), 3xx redirects, 4xx client errors (400 Bad Request, 401 when authentication is missing or invalid, 403 when the user is authenticated but not allowed, 404 Not Found, 409 Conflict, 422 for validation errors in many APIs, 429 Too Many Requests), and 5xx server errors. A good tester checks that errors use the right code and a helpful body.
  4. 4

    What is the difference between REST and SOAP, and where does GraphQL fit?

    Why ask it

    Testers meet several API styles.

    What to look for

    REST uses resources, HTTP methods and usually JSON; SOAP is a protocol with XML envelopes and a WSDL contract; GraphQL exposes a single endpoint where clients ask for exactly the fields they need, so testing focuses on queries, mutations, field-level permissions and error responses that often return with a 200 status.
For hiring teams

Before the API Testing interviews, see who can do the work

Cohesyve finds and contacts API Testing candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.

Test Design

What to test and how the candidate thinks about coverage.

  1. 5

    How would you design tests for a new endpoint that creates a user?

    Why ask it

    Shows how complete the candidate's test thinking is.

    What to look for

    Positive cases (valid payload returns 201 and the created resource), validation (missing required fields, wrong types, boundary lengths, invalid email), duplicates, authentication and authorisation, response schema, side effects (the user can be fetched, events or emails triggered), and headers. Clean-up of created data.
  2. 6

    What do you validate in an API response beyond the status code?

    Why ask it

    Checking only status codes misses most bugs.

    What to look for

    Response body values against expected data, the schema (fields, types, required properties), headers (content type, caching, security headers), response time, and the state change in the system or database. Error responses should be checked as carefully as successes.
  3. 7

    How do you test authentication and authorisation in an API?

    Why ask it

    Access control flaws are among the most serious API bugs.

    What to look for

    Requests without credentials, with expired or tampered tokens, and with valid credentials for a user who should not have access, including accessing another user's resource by changing an ID in the URL. Check that responses do not leak data in error messages.
  4. 8

    What is contract testing, and how does it differ from integration testing?

    Why ask it

    Contract testing is common in microservice teams.

    What to look for

    Contract testing checks that a provider's API meets the expectations (the contract) of its consumers, often consumer-driven, without running the whole system. Integration tests exercise real services together. Contract tests catch breaking changes early and run fast; integration tests catch environment and wiring problems.
  5. 9

    How do you handle test data for API tests?

    Why ask it

    Data management decides whether a suite is reliable.

    What to look for

    Create data through the API or fixtures in setup, use unique values so tests can run in parallel, avoid depending on data other tests create, and clean up afterwards. Seeded test environments or mocks for third-party services where needed.

Tools and Automation

How the candidate builds and runs API tests.

  1. 10

    Which tools have you used for API testing, and how did you choose?

    Why ask it

    Shows hands-on experience.

    What to look for

    Exploratory tools such as Postman or Insomnia, code-based frameworks such as REST Assured (Java), pytest with requests (Python) or JavaScript test runners, plus schema validation and reporting. The choice should match the team's language and CI. A good answer explains how exploratory collections became automated tests.
  2. 11

    How do you chain requests, for example using a token or ID from one response in the next?

    Why ask it

    A routine need in real suites.

    What to look for

    Extract values from responses into variables (environment variables in Postman, local variables in code), pass them to later requests, and keep tests independent where possible by setting up their own data. Tokens handled through a shared auth helper.
  3. 12

    How do you run API tests in a CI pipeline?

    Why ask it

    Automated tests add most value when they run on every change.

    What to look for

    Tests run on each merge or deployment against a test environment, configuration per environment through variables, secrets stored in the CI secret store, fast smoke tests first, reports and failure notifications. Flaky tests are fixed rather than ignored.
  4. 13

    When would you mock or stub an API dependency?

    Why ask it

    Tests the balance between isolation and realism.

    What to look for

    When a third-party service is slow, costly, rate-limited or unavailable in test, or to simulate error cases and timeouts. Mocks must be kept in line with the real contract, and some tests should still hit the real integration.

Non-Functional Testing

Performance, security and resilience at the API level.

  1. 14

    How would you approach performance testing an API?

    Why ask it

    APIs often fail under load before they fail functionally.

    What to look for

    Agree targets for response time and throughput first, then load, stress and soak tests with a tool such as JMeter, k6 or Gatling, realistic data and traffic patterns, and monitoring of server resources. Report percentiles, not only averages.
  2. 15

    What security checks would you include in API testing?

    Why ask it

    API security testing is a growing part of QA work.

    What to look for

    Broken object-level authorisation (changing IDs), authentication flaws, input validation and injection, excessive data in responses, rate limiting, HTTPS only, and sensible error messages. Mentions of the OWASP API Security Top 10 (2023 edition, where broken object level authorisation is ranked first) as a checklist show awareness.
  3. 16

    How do you test rate limiting and error handling for timeouts?

    Why ask it

    Resilience is easy to forget.

    What to look for

    Send requests above the limit and check for 429 with any retry guidance headers; simulate slow or failing dependencies with mocks and check the API returns a clear error within a reasonable time and does not hang.

Running the interview well

  • 1Give the candidate an endpoint specification and ask them to list test cases in ten minutes
  • 2Ask them to automate one request with assertions in the team's tool or language
  • 3Probe authorisation testing with an ID-swapping scenario
  • 4Check that they validate response bodies and side effects, not only status codes
  • 5Ask how their API tests run in CI and how they handle test data
  • 6Include one non-functional question for senior roles

Common questions

What are the most common API testing interview questions?

HTTP methods and idempotency, status codes, what to validate in a response, testing authentication and authorisation, REST versus SOAP, contract testing, test data, tools such as Postman and REST Assured, and how API tests run in CI.

What is the difference between API testing and UI testing?

API testing sends requests directly to the service and checks responses and data, without a user interface. It is faster and more stable, so most checks belong at this level. UI tests cover critical user journeys end to end.

Do I need coding skills for API testing roles?

Many roles expect some coding to automate tests, usually in Java, Python or JavaScript. Tools like Postman allow scripting too. Manual API testing roles exist, but automation skills widen your options.

How should I prepare for an API testing interview?

Pick a public practice API, write test cases for a few endpoints, automate them in Postman and in code, add schema checks and run them from the command line. Be ready to explain status codes, idempotency and how you test authorisation.

Is Postman enough for API testing interviews?

Postman is a good start and is widely used. For automation roles, also show a code-based framework in the language the team uses, since many suites live in code alongside the application.

For hiring teams

Save these questions for the API Testing candidates who can do the work

Cohesyve takes your API Testing job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.

1,500+

assessments completed

50%

faster time-to-hire

5 min

from JD to assessment

14-day free trial · 10 candidates · Not charged until the trial ends

For job seekers

Preparing for an API Testing interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.

Practise an API Testing interview free →

See Cohesyve in action

Free 30-min walkthrough

See it on your role