Interview Preparation

API Testing Interview Questions with Practical Answers

Experienced-level API testing interview questions with concise answers, practical reasoning, and realistic request and response examples.

JobFitPilot Editorial · Practical career guides22 min read
In this guide

Experienced API testing interviews assess how you reason about contracts, state, failure, security, and observability—not whether you can recite every status code.

Use these as answer frameworks. Adapt examples to systems you have genuinely tested, and be ready to explain your oracle, evidence, and trade-offs.

Question 1

What is API testing, and what does it validate?

Short answer

API testing verifies service behavior at the interface layer by sending requests and evaluating responses, state changes, integrations, and non-functional behavior against an agreed contract.

A useful answer goes beyond status codes. Validate the body and headers, authorization rules, persisted data, emitted events, dependency behavior, and whether failures are safe and observable.

Question 2

What REST concepts should a QA engineer understand?

Short answer

REST-style APIs expose resources through addresses, use HTTP methods to express intent, and commonly exchange representations such as JSON. Statelessness means each request carries the context needed to process it.

Resources are usually nouns such as /users/123 or /orders/42/items. The contract defines operations, formats, authentication, error behavior, and compatibility.

REST request
GET /api/users/123 HTTP/1.1
Accept: application/json
Authorization: Bearer <token>
Question 3

How do GET, POST, PUT, PATCH, and DELETE differ?

Short answer

GET reads, POST commonly creates or starts processing, PUT replaces a resource representation, PATCH applies a partial change, and DELETE removes or deactivates according to the contract.

HTTP method interview summary
MethodTypical intentImportant tests
GETRead a resource or collectionFilters, pagination, cache headers, authorization
POSTCreate or trigger an operationValidation, duplicates, identifiers, side effects
PUTReplace a known resourceRequired fields, repeat requests, omitted fields
PATCHPartially updateOnly requested fields change; invalid transitions fail
DELETERemove or deactivateRepeat behavior, dependencies, later reads
Question 4

Which HTTP status codes matter most in API testing?

Short answer

Know the families and explain codes in context: 2xx success, 3xx redirection, 4xx request or permission problems, and 5xx server failures.

  • 200 successful read or update
  • 201 created, often with a Location header
  • 204 success with no body
  • 400 malformed or invalid request
  • 401 missing or invalid authentication
  • 403 authenticated but unauthorized
  • 404 not found or intentionally concealed
  • 409 state or uniqueness conflict
  • 422 semantic validation where used
  • 429 rate limit exceeded
  • 500/502/503/504 server, gateway, or availability failure

Assert the documented code, error schema, absence of unsafe side effects, and a safe diagnostic signal—not a favorite code in isolation.

Question 5

What do you validate in headers, path parameters, and query parameters?

Short answer

Validate required and optional headers, media types, tracing or caching behavior, path identity, and supported query parameters—including invalid combinations.

  • Missing, duplicate, malformed, and case-sensitive headers
  • Encoded path values and unauthorized resource identifiers
  • Repeated query keys, blanks, special characters, and defaults
  • Filtering, sorting, and pagination combinations
Question 6

How do you validate an API response?

Short answer

Validate transport, schema, business meaning, consistency, and side effects. A response can match its schema and still be functionally wrong.

  1. Status, content type, headers, and response-time signal
  2. Required, optional, nullable, and additional fields
  3. Types, formats, ranges, enums, and cross-field rules
  4. Business values against controlled data
  5. Database, queue, or downstream side effects when observable
  6. No secrets or stack traces in errors
Example response
{
  "id": "usr_123",
  "status": "active",
  "roles": ["candidate"]
}
Question 7

Authentication and authorization: what is the difference?

Short answer

Authentication establishes identity; authorization decides what that identity may do. Test them separately.

For Bearer or JWT access, test missing, malformed, expired, revoked, wrong-audience, and wrong-scope tokens. A JWT is a signed token format, not proof that authorization rules are correct.

Question 8

What is API chaining?

Short answer

API chaining uses output from one request as input to a later request in the same business flow.

Chained order flow
POST /api/orders              -> capture orderId
GET  /api/orders/{orderId}    -> verify persisted order
POST /api/orders/{orderId}/pay -> capture payment status

Keep end-to-end chains focused. Most regression tests should create controlled state so one failure does not obscure every downstream assertion.

Question 9

What is schema validation, and is it enough?

Short answer

Schema validation checks structure, types, required fields, formats, enums, and additional-property rules. It is necessary but insufficient for business correctness.

A schema may allow any positive number while the business requires total = subtotal + tax. Combine contract assertions with targeted business rules.

Question 10

How do you design positive, negative, and boundary tests?

Short answer

Positive tests prove supported behavior. Negative tests challenge validation, permissions, and state. Boundary tests target values immediately around limits and transitions.

RuleRepresentative valuesWhat to assert
Name length 1–800, 1, 80, 81 charactersAcceptance boundary and stable error
Quantity 1–1000, 1, 100, 101; decimal; textType and range enforcement
State transitiondraft→submitted; submitted→draftAllowed succeeds; forbidden has no side effect
Question 11

What is idempotency, and how would you test it?

Short answer

An idempotent operation produces the same intended server state when repeated. Some POST operations use an idempotency key to prevent duplicate processing.

Question 12

How do you test pagination, filtering, and sorting?

Short answer

Use controlled datasets that expose missing, duplicated, and misordered records across page boundaries.

  • First, middle, last, empty, and beyond-range pages
  • Page-size minimum, maximum, default, and invalid values
  • Stable sort with a deterministic tie-breaker
  • No duplicates or gaps across an unchanged dataset
  • Filter combinations and URL encoding
  • Cursor expiry or invalid cursor behavior
Question 13

How should rate limits, retries, and timeouts be tested?

Short answer

Verify the documented limit response and headers, ensure clients retry only safe operations, and confirm timeouts do not create unknown duplicate side effects.

Use bounded attempts and backoff. Avoid retrying permanent 4xx failures. Pair state-changing retries with idempotency or reconciliation.

Question 14

How do you test API error handling and dependency failures?

Short answer

Force known failure modes and validate safe status mapping, stable errors, observability, and absence of partial or corrupt state.

  • Database unavailable or slow
  • Downstream 4xx, 5xx, timeout, or malformed response
  • Queue or event publication failure
  • Partial failure after one step committed
  • Unsupported media type or malformed JSON
Safe error response
{
  "code": "ORDER_DEPENDENCY_UNAVAILABLE",
  "message": "Order could not be completed",
  "correlationId": "corr_8f31"
}
Question 15

When should a QA engineer validate the database?

Short answer

Validate persistence when the database is part of the acceptance oracle and the environment allows safe, isolated access. Prefer public behavior when it fully proves the requirement.

Check values, relationships, uniqueness, audit fields, and rollback behavior. Avoid coupling every test to internal tables.

Question 16

How do Postman collections and environments support testing?

Short answer

Collections organize requests, examples, scripts, and flows. Environments separate values such as base URLs and non-secret identifiers.

Keep secrets outside exported collections, add clear assertions, and run stable collections through the CLI in CI. Collection order should not be the only state setup.

Question 17

What makes an API automation strategy maintainable?

Short answer

Prioritize critical contracts, separate test data from assertions, keep tests independent, and make failures diagnosable.

  • Reusable clients without hiding intent
  • Controlled data creation and cleanup
  • Contract plus targeted business assertions
  • Parallel-safe unique identifiers
  • Sanitized diagnostics and correlation IDs
  • Fast smoke plus broader scheduled regression
Question 18

What security considerations should QA cover?

Short answer

At a QA level, verify authentication, object and function authorization, input handling, sensitive-data exposure, transport expectations, and abuse controls.

Test horizontal and vertical authorization, mass assignment, unexpected fields, oversized input, unsafe errors, and secrets in logs. Use approved tools and environments; never perform intrusive testing without authorization.

Question 19

How do you approach API performance questions?

Short answer

Start with agreed objectives and representative traffic. Measure latency distributions, throughput, errors, and resource symptoms—not one local response time.

Distinguish a functional response-time assertion from load, stress, soak, and spike testing. Report the environment, data, caching state, and workload.

Question 20

Give a realistic end-to-end API test scenario

Short answer

Choose a business flow and show assertions at every boundary, including failure and recovery.

Order creation scenario

  1. Create an authenticated user and controlled product stock.
  2. POST a valid order; assert 201, schema, totals, ownership, and one persisted order.
  3. GET as its owner; deny a second user.
  4. Repeat with one idempotency key and assert no duplicate.
  5. Try zero, excessive, unavailable, and malformed quantities.
  6. Force payment or inventory failure and verify rollback or recoverable state.
  7. Verify logs or events use a correlation identifier without sensitive data.

Related guides