QAAnywhere

Remote QA & testing jobs, worldwide.

Guides

API testing interview questions, from HTTP basics to Postman and REST Assured

By Denis Bojkovski, Test Automation Architect · Published December 2, 2026

API skills sit next to UI automation

API testing rarely gets a listing to itself, but most automation roles expect it. On 1 December 2026, 13 open roles on QAAnywhere named Postman and 11 named REST Assured. Almost all of them asked for UI automation as well: 10 of the 13 Postman roles also named Selenium, and 8 named Playwright. Six of the 13 descriptions mention SQL too. Interviewers want to see that you can test below the UI, where checks are faster and more precise.

This guide goes deeper than the API section of QA interview questions for remote roles, which covers 401 versus 403 and testing a POST endpoint.

HTTP fundamentals

"Which HTTP methods are idempotent, and why does it matter?"

GET, PUT and DELETE are idempotent: sending the same request twice leaves the server in the same state as sending it once. POST is not: two identical POSTs can create two orders. It matters for retries. A client that times out can safely retry a PUT, but retrying a POST needs protection, usually an idempotency key the server remembers. A strong answer adds a test idea: send the same POST twice with the same key and check that only one order exists.

"What is the difference between PUT and PATCH?"

PUT replaces the whole resource with what you send. PATCH changes only the fields you send. Test that PUT without an optional field clears it, and that PATCH leaves other fields alone.

"Which status codes would you expect, and when?"

  • 200 OK for a successful read or update with a body, 201 Created (ideally with a Location header) for a creation, and 204 No Content for a success with no body.
  • 400 Bad Request for malformed input, and 422 Unprocessable Content (used by some APIs) for well-formed input that fails validation.
  • 404 Not Found, and 409 Conflict for duplicates or version clashes.
  • 429 Too Many Requests when rate limited, often with Retry-After.
  • 500 and 503 for server-side failures. A 500 caused by client input is itself a bug to report.

Also mention that the body matters as much as the code: a useful error message, no stack traces, no internal details.

"How would you test pagination?"

First page, middle page and last page. An empty result. A page size at its limit and beyond it. What happens when items are added or deleted while a client is paging. Stable ordering, so no item appears twice or goes missing. Invalid values such as a negative page number or a malformed cursor.

Authentication and security

"How do you test an endpoint protected by OAuth 2.0 or a bearer token?"

Get a token the way a real client would, from the token endpoint with test credentials, kept in an environment variable and never committed. Then check: no token, an expired token, a token with the wrong scope, and above all access to another user's data. Change the ID in /users/123/orders to someone else's. Broken object-level authorisation tops the OWASP API Security Top 10, and testers find it often.

"What else would you check from a security angle?"

Input validation (very long strings, special characters, wrong types), rate limiting, error messages that reveal too much, and sensitive data in responses that the client does not need. See security testing basics.

Postman

"How do you organise work in Postman?"

  • Collections grouped by feature, with requests named after what they check.
  • Environments for each stage (local, staging) holding the base URL and credentials.
  • Variables at the right scope (collection, environment, or local within a run), so nothing is hard-coded.
  • Pre-request scripts for setup such as fetching a token.
  • Tests written with pm.test and pm.expect in each request.

"How do you chain requests?"

Save a value from one response in a test script, for example pm.environment.set('orderId', json.id), and use {{orderId}} in the next request. Keep chains short. A long chain where every step depends on the previous one fails in confusing ways.

"How do Postman tests run in CI?"

With Newman, Postman's command-line runner, or the Postman CLI. Export or sync the collection and environment, run it in the pipeline and publish a JUnit report. Mention the limit too: past a certain size, teams usually move to tests in code, which are easier to review, reuse and version.

REST Assured

REST Assured was named with Java in 10 of the 11 roles, so expect Java code.

"Show me a basic REST Assured test."

given()
    .spec(requestSpec)            // base URI, auth and headers in one place
    .body(new CreateOrder("SKU-1", 2))
.when()
    .post("/orders")
.then()
    .statusCode(201)
    .body("status", equalTo("PENDING"))
    .body("items.size()", equalTo(1));

Talk through the parts: a shared RequestSpecification, request bodies as Java classes serialised to JSON instead of hand-written strings, and Hamcrest matchers on JSON paths. For larger checks, deserialise the response into a class and assert on its fields.

"How do you validate the response structure?"

Use JSON Schema validation (REST Assured's json-schema-validator module, matchesJsonSchemaInClasspath) to catch missing fields, wrong types and unexpected nulls. Field-level assertions can't cover all of that.

Beyond single endpoints

"What is contract testing, and when is it worth it?"

A consumer records what it expects from a provider (requests and the fields it reads), and the provider checks it still meets those expectations, usually with Pact. It catches breaking changes between services before deployment, without a full shared environment. It's worth it when several teams own services that call each other. See contract testing explained.

"How do you test GraphQL differently?"

GraphQL usually returns 200 even when part of the query failed, with an errors array in the body, so status codes alone prove little. Test queries for exactly the fields requested, mutations, authorisation for each field, query depth and cost limits, and error shapes.

"How do you handle test data?"

Create it through the API in setup, use unique values (a random suffix) so parallel runs don't collide, clean up afterwards, and check data in the database with SQL when the API can't show it. The guide to test data management goes further.

A live task to rehearse

"Here is a public API. Write tests for creating and fetching a resource." Do it in your strongest tool:

  1. A positive case: create, then fetch by ID and compare.
  2. Validation: a missing required field gives a 4xx with a useful message.
  3. Authorisation: a missing or invalid token is rejected.
  4. One edge case you explain out loud, such as a duplicate or a very long name.

Narrate your choices. For a broader view of tools, see API testing with Postman and REST Assured.

The open roles below name Postman.

Open remote QA roles that use Postman

  1. Manual QA Engineer (Game Client)Playson · Europe
  2. 1207 - QA AutomationGoFasti · LATAM
  3. QA Analyst, ConsoleKeeper Security · Remote, US
  4. QA Analyst, Keeper App (Backend & Platform)Keeper Security · Remote, US
  5. Senior SDETSparksoft Corporation · Remote/Hybrid if local to Maryland

More guides