Skip to main content

Quality Engineering

API Testing Interview Questions and Answers

Prepare for API testing interviews with questions on contracts, status codes, authentication, validation, idempotency, automation, and performance.

  1. 01
    Latest question

    What should an API test validate beyond the status code?

    Question codetypescript
    const response = await request.get('/api/orders/42')
    expect(response.status()).toBe(200)

    Validate the response schema and meaning, headers, side effects, persistence, authorization, error contract, and relevant timing. A successful status can still hide incorrect or unsafe behavior.

    Answer codetypescript
    const response = await request.get('/api/orders/42')
    expect(response.status()).toBe(200)
    expect(response.headers()['content-type']).toContain('application/json')
    expect(await response.json()).toMatchObject({
      id: 42,
      status: expect.stringMatching(/pending|paid|shipped/),
    })
  2. 02

    How do authentication and authorization tests differ?

    Authentication tests whether identity is established correctly, while authorization tests whether that identity may perform an action on a resource. Include missing, invalid, expired, and insufficient-permission cases.

  3. 03

    What is idempotency and how would you test it?

    An idempotent operation can be repeated without creating additional unintended effects. Repeat the request under realistic retry conditions and verify resource state, response behavior, and idempotency-key handling where used.

  4. 04

    How should negative API tests be selected?

    Derive them from the contract and risk: missing fields, invalid types, boundary values, malformed payloads, unauthorized access, unavailable dependencies, duplicates, and conflicting state. Assertions should cover safe and consistent error responses.

  5. 05

    Where should API tests run in a delivery pipeline?

    Fast contract and service checks can run on each change, with broader integration and environment checks at later gates. Keep test data isolated and make failures traceable to a request and build.

  6. 06

    How would you approach API performance testing?

    Define representative workloads, concurrency, data, and service-level expectations before running tests. Observe latency distributions, errors, saturation, and dependencies rather than reporting only average response time.

Continue preparing

Related interview guides

Need delivery capability?

Pair technical understanding with the right specialist.

Explore hiring roles
Have a quick question?Chat on WhatsAppAPI Testing Interview Questions and Answers | Quinoid