QA Interview Hub · Knowledge base · Quizzes · Українська

All topics

API interview questions

161 questions on API, from the basics to the hard ones. Answers and explanations are in the quiz and the knowledge base.

By level: Junior QA interview questions · Middle QA interview questions · Senior QA interview questions

Client-server and REST

  1. In the request GET /users/42, what is the resource and what is its representation? Junior
  2. Why do REST addresses use nouns (/orders) rather than verbs (/getOrders)? Junior
  3. What makes testing at the HTTP API level more convenient than a UI test of the same business logic? Middle
  4. What exactly does this request ask for? Junior
    GET /users/42/orders?status=paid HTTP/1.1
    Host: shop.test
    Accept: application/json
  5. In a test the client does not keep cookies: the login succeeds, but the next request goes without a Cookie header and gets 401. How do you explain it? Middle
    POST /login HTTP/1.1
    Host: shop.test
    Content-Type: application/json
    
    {"email":"ira@shop.test","password":"correct-password"}
    
    HTTP/1.1 200 OK
    Set-Cookie: sid=abc123; HttpOnly; Secure
    
    ###
    
    GET /profile HTTP/1.1
    Host: shop.test
    Accept: application/json
    
    HTTP/1.1 401 Unauthorized
  6. The UI form does not let you enter a negative amount, but this request sent directly created a transfer. What is the conclusion? Middle
    POST /api/transfers HTTP/1.1
    Host: bank.test
    Authorization: Bearer <token>
    Content-Type: application/json
    
    {"toAccount":"UA2100000000000000000000001","amount":-500}
    
    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {"id":"tr_88","amount":-500}

Take the quiz for this chapter · Read the explanation in the knowledge base

Anatomy of a request and response

  1. An API client fails to parse JSON: the response has Content-Type: text/html and the body starts with <html>…502 Bad Gateway. What happened? Middle
  2. The request body is valid JSON, but the server answered 415. What is the most likely cause? Middle
    POST /v1/orders HTTP/1.1
    Host: api.shop.test
    Authorization: Bearer <token>
    Content-Type: text/plain
    
    {"item":"book","qty":2}
    
    HTTP/1.1 415 Unsupported Media Type
  3. A user reported this error. Which response header helps most to find the matching entry in the server logs? Middle
    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    Content-Length: 59
    Cache-Control: no-store
    Date: Wed, 11 Nov 2026 09:14:07 GMT
    Server: nginx/1.27.0
    X-Request-Id: 9b2f4c1e-7a3d-4e55-8c10-2f6a1d9e0b44
    
    {"error":"internal_error","message":"Something went wrong"}
  4. Why should an authorization token not be passed in a query parameter such as ?access_token=…? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base

HTTP methods and idempotency

  1. What does it mean that an HTTP method is "safe" according to the specification? Junior
  2. DELETE /orders/5 returned 204 the first time and 404 the second. Does this violate the idempotency of DELETE? Middle
  3. What is the HEAD method used for? Junior
  4. The first request timed out on the client, which repeated it with the same Idempotency-Key. The documentation says a repeat with the same key returns the original result. How do you assess this pair of responses? Middle
    POST /v1/payments HTTP/1.1
    Host: api.bank.test
    Idempotency-Key: 7f3c-0001
    Content-Type: application/json
    
    {"amount":100,"currency":"UAH"}
    
    HTTP/1.1 201 Created
    
    {"id":"pay_1","amount":100}
    
    ###
    
    POST /v1/payments HTTP/1.1
    Host: api.bank.test
    Idempotency-Key: 7f3c-0001
    Content-Type: application/json
    
    {"amount":100,"currency":"UAH"}
    
    HTTP/1.1 201 Created
    
    {"id":"pay_1","amount":100}
  5. The API contract says PUT fully replaces the resource, and phone and city are optional. After a PUT with only name both fields became null. How do you assess it? Middle
    GET /users/9 HTTP/1.1
    Host: api.shop.test
    
    HTTP/1.1 200 OK
    
    {"id":9,"name":"Ira","phone":"+380501112233","city":"Lviv"}
    
    ###
    
    PUT /users/9 HTTP/1.1
    Host: api.shop.test
    Content-Type: application/json
    
    {"name":"Iryna"}
    
    HTTP/1.1 200 OK
    
    {"id":9,"name":"Iryna","phone":null,"city":null}
  6. A GET request cancelled an order. What is the main problem with this design? Junior
    GET /orders/17/cancel HTTP/1.1
    Host: shop.test
    
    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {"id":17,"status":"cancelled"}

Take the quiz for this chapter · Read the explanation in the knowledge base

Status codes

  1. Which HTTP methods are idempotent according to the specification? Junior
  2. Which status is expected after a successful POST that created a resource? Junior
  3. How is PUT different from PATCH? Junior
  4. The API returns 500 for an invalid request body. Is that a bug? Middle
  5. A 200 OK response with the body {"error": "Insufficient funds"}. How do you assess it? Junior
  6. Registration with an email that already exists, and the API contract tells the client directly that the email is taken. Which status is the most logical? Middle
  7. What does status 429 mean? Middle
  8. What does 204 No Content mean? Junior
  9. When is 202 Accepted appropriate? Middle
  10. How is 400 different from 422? Middle
  11. How do 502, 503 and 504 differ? Middle
  12. The API answered like this to a report creation request. Which next test step most precisely checks the contract of an asynchronous operation? Middle
    POST /v1/reports HTTP/1.1
    Host: api.shop.test
    Content-Type: application/json
    
    {"type":"monthly","month":"2026-10"}
    
    HTTP/1.1 202 Accepted
    Location: /v1/reports/jobs/88
  13. Invoice 501 exists but belongs to user B, and the request comes from user A. The contract says that resources of other users behave as non-existent. How do you assess the response? Middle
    GET /v1/invoices/501 HTTP/1.1
    Host: api.shop.test
    Authorization: Bearer <token of user A>
    
    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {"error":"not_found"}
  14. What does this response mean and what does the client do next? Middle
    PUT /v1/orders/17 HTTP/1.1
    Host: api.shop.test
    If-Match: "v3"
    Content-Type: application/json
    
    {"status":"shipped"}
    
    HTTP/1.1 412 Precondition Failed
    ETag: "v5"

Take the quiz for this chapter · Read the explanation in the knowledge base

Postman: structure and variables

  1. What is an Environment for in Postman? Junior
  2. How does the Shared value of a Postman variable differ from the Local value? Middle
  3. How do you pass the id of a newly created resource from a POST response to the next request of the collection? Middle
  4. The collection has Bearer {{token}} authorization. The GET /health request must go without a token. What to do? Middle
  5. The token exists only in the Local value of an environment variable (the Shared value is empty). The request passes locally, but the Postman monitor in the cloud gets 401. Why? Middle
  6. What do the responses of a Postman mock server created from a collection rely on? Middle
  7. How does a Postman monitor differ from a Newman run in CI? Junior

Take the quiz for this chapter · Read the explanation in the knowledge base

Authentication and authorization

  1. How is 401 different from 403? Junior
  2. Is the content of a JWT of the form xxxxx.yyyyy.zzzzz (three parts separated by dots) encrypted? Junior
  3. How do you test that the backend really verifies the JWT signature? Middle
  4. Why a refresh token if there is an access token? Middle
  5. Which OAuth 2.0 flow suits service-to-service integration without a user? Middle
  6. What does the HttpOnly flag give a session cookie? Middle
  7. What does SameSite=Lax or Strict protect against? Middle
  8. A user updates their profile and adds "role": "admin" to the body. The server saves the role. What is this vulnerability called? Middle
  9. What do you check after logout from the API's point of view? Middle
  10. Below is the decoded payload of a JWT from the Authorization: Bearer header, the signature is valid. The server handles the request at the moment 1700001800 (Unix time, seconds). Which response is expected? Junior
    {
      "sub": "42",
      "role": "user",
      "iat": 1700000000,
      "exp": 1700000900
    }
  11. The token is valid and not expired, but has only the scope orders:read. What is wrong with the response? Middle
    POST /v1/orders HTTP/1.1
    Host: api.shop.test
    Authorization: Bearer <valid token with scope orders:read>
    Content-Type: application/json
    
    {"item":"book","qty":1}
    
    HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Bearer error="insufficient_scope", scope="orders:write"

Take the quiz for this chapter · Read the explanation in the knowledge base

Scripts and checks in Postman

  1. Where in Postman does code run before the request is sent and where after the response arrives? Junior
  2. What happens to this test if the server returned HTML instead of JSON? Middle
    pm.test('has numeric id', () => {
      const body = pm.response.json();
      pm.expect(body.id).to.be.a('number');
    });
  3. Why does this check fail although the array in the response equals ['a', 'b']? Middle
    pm.expect(pm.response.json().tags).to.equal(['a', 'b']);
  4. What will the orderId variable get if this script runs in post-response? Middle
    let id;
    pm.sendRequest(pm.environment.get('baseUrl') + '/orders/latest', (err, res) => {
      id = res.json().id;
    });
    pm.environment.set('orderId', id);
  5. This script is in the pre-request of a collection of 30 requests. How can the load on the auth service be reduced? Middle
    pm.sendRequest({
      url: pm.environment.get('baseUrl') + '/auth/token',
      method: 'POST',
      header: { 'Content-Type': 'application/json' },
      body: { mode: 'raw', raw: JSON.stringify({ clientId: 'qa' }) }
    }, (err, res) => {
      pm.environment.set('token', res.json().access_token);
    });
  6. The script is in the post-response of GET /operations/{{opId}} and runs in Runner. What is wrong with it? Senior
    const body = pm.response.json();
    if (body.status !== 'done') {
      pm.execution.setNextRequest(pm.info.requestName);
    }
  7. What is dangerous about console.log(pm.environment.get("token")) in a collection run through Newman in CI? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base

Runner, data-driven tests and Newman

  1. What does the Collection Runner do in Postman? Junior
  2. The Runner is started with a CSV file that has an email column. How do you use the value in a request? Middle
  3. A collection is run in CI with newman run. Will the pipeline step fail if at least one test in the collection fails? Middle
  4. Why does this test fail when the data comes from the JSON file shown? Middle
    // data.json: [{ "email": "a@test.dev", "ok": true }]
    pm.test('ok flag', () => {
      pm.expect(pm.iterationData.get('ok')).to.eql('true');
    });
  5. newman run is started with --bail and a data file of 10 rows. A test in iteration 3 fails. What happens? Middle
    newman run api.postman_collection.json -d users.csv --bail
  6. A Newman run has 5 requests, and a pm.test (assertion) failed in the 2nd; --bail is not set. What happens to requests 3–5? Middle
  7. CI must show the tests in the pipeline interface, and a person must be able to analyse a failure from raw requests and responses. Which Newman reporters to choose? Senior
  8. A data-driven run creates users from a CSV, but the email is the same in every row, and from the second row 409 comes back. What to do? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base

Checklist: what to test in an endpoint

  1. The POST /orders endpoint returned 201. What else must be checked besides the status? Middle
  2. The API answers 400 to an invalid request. What is checked in such a response besides the status? Middle
  3. Which three authentication and authorization scenarios are checked for a protected endpoint? Junior
  4. The API is documented as supporting Idempotency-Key. The same request with the same key and body was sent twice in a row. What do these responses show? Middle
    POST /orders HTTP/1.1
    Idempotency-Key: 7f3a-91
    Content-Type: application/json
    
    {"sku": "A1", "qty": 1}
    
    HTTP/1.1 201 Created
    {"id": 501, "sku": "A1", "qty": 1}
    
    POST /orders HTTP/1.1
    Idempotency-Key: 7f3a-91
    Content-Type: application/json
    
    {"sku": "A1", "qty": 1}
    
    HTTP/1.1 201 Created
    {"id": 502, "sku": "A1", "qty": 1}
  5. The documentation says DELETE removes the order permanently. After the DELETE response the test does a GET. What is the conclusion? Junior
    DELETE /orders/17 HTTP/1.1
    
    HTTP/1.1 204 No Content
    
    GET /orders/17 HTTP/1.1
    
    HTTP/1.1 200 OK
    {"id": 17, "status": "active"}
  6. What in this response is a sign of a problem that a checklist for money fields must catch? Middle
    GET /invoices/9 HTTP/1.1
    
    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {"id": 9, "items": 3, "total": 0.30000000000000004, "currency": "USD"}

Take the quiz for this chapter · Read the explanation in the knowledge base

API design: resources, pagination, versioning, GraphQL

  1. The request GET /users/42?active=true. Which is the path parameter and which is the query? Junior
  2. Why do payment APIs have the Idempotency-Key header? Middle
  3. What does it mean that HTTP is stateless? Junior
  4. Why is cursor pagination better than offset/limit? Middle
  5. What negative cases are there for the limit parameter? Middle
  6. Why version an API, for example /v1/? Junior
  7. Which API change is a breaking change? Middle
  8. What does the OpenAPI (Swagger) specification describe? Middle
  9. How is GraphQL different from REST from the testing point of view? Middle
  10. How do you test a webhook from a payment provider? Middle
  11. A test sends POST /orders with qty = 0 and gets the response below. Which body check is the most stable against wording changes and message localisation? Middle
    HTTP/1.1 422 Unprocessable Content
    Content-Type: application/problem+json
    
    {
      "type": "https://api.shop.test/errors/out-of-range",
      "title": "Validation failed",
      "status": 422,
      "detail": "Field qty must be between 1 and 100, got 0"
    }
  12. Cursor c28 points to the last item received, and the next page must start right after it. No new records were added between the requests. What is wrong in these two responses? Middle
    GET /transactions?limit=3 HTTP/1.1
    
    HTTP/1.1 200 OK
    {"items": [{"id": 30}, {"id": 29}, {"id": 28}], "next_cursor": "c28"}
    
    GET /transactions?limit=3&cursor=c28 HTTP/1.1
    
    HTTP/1.1 200 OK
    {"items": [{"id": 28}, {"id": 27}, {"id": 26}], "next_cursor": "c26"}
  13. The API declares support for JSON Merge Patch (RFC 7396). What is expected from the server for this request? Middle
    PATCH /users/7 HTTP/1.1
    Content-Type: application/merge-patch+json
    
    {"nickname": null, "city": "Lviv"}

Take the quiz for this chapter · Read the explanation in the knowledge base

Headers, caching and CORS

  1. How is Content-Type different from Accept? Middle
  2. Why does a request from the front end fail because of CORS, but work from Postman? Middle
  3. When does the browser send a preflight OPTIONS? Middle
  4. A shared cache (CDN) sits between the clients and the server, and the response depends on Accept-Language. Users with Accept-Language: en started receiving Ukrainian. What is missing in the response? Middle
    GET /v1/catalog HTTP/1.1
    Host: api.shop.test
    Accept-Language: uk
    
    HTTP/1.1 200 OK
    Content-Type: application/json
    Content-Language: uk
    Cache-Control: public, max-age=600
    
    {"title":"Catalog"}
  5. The browser blocked the POST after this preflight response. Why? Middle
    OPTIONS /v1/orders HTTP/1.1
    Host: api.shop.test
    Origin: https://app.shop.test
    Access-Control-Request-Method: POST
    Access-Control-Request-Headers: content-type, authorization
    
    HTTP/1.1 204 No Content
    Access-Control-Allow-Origin: https://app.shop.test
    Access-Control-Allow-Methods: GET, POST
    Access-Control-Allow-Headers: content-type
  6. The browser received this response to GET /accounts/42 and stored it in its own cache. 30 seconds later the page code calls the same GET again. What happens? Junior
    HTTP/1.1 200 OK
    Content-Type: application/json
    Cache-Control: max-age=60
    ETag: "v7"
    
    {"balance":1520.50}

Take the quiz for this chapter · Read the explanation in the knowledge base

API security

  1. User A, with their own valid token, requests GET /orders/123, which belongs to user B, and the API server returns that order to them. What is this? Middle
  2. Which of these is a data leak in an API? Middle
  3. Why is a stack trace in the body of a 500 response considered a defect? Middle
  4. How do you test rate limiting on login? Middle
  5. Why is the message "A user with this email does not exist" on login considered a problem? Middle
  6. Invoice 1002 exists and belongs to user B, invoice 999999 does not exist. Product policy: do not reveal the existence of other people's resources. What is dangerous in these two responses for user A? Middle
    GET /invoices/1002 HTTP/1.1
    Authorization: Bearer <token of user A>
    
    HTTP/1.1 403 Forbidden
    
    GET /invoices/999999 HTTP/1.1
    Authorization: Bearer <token of user A>
    
    HTTP/1.1 404 Not Found
  7. A test forges a token: the header has alg none, there is no signature, and the payload has role admin. The service is protected. Which response is correct? Senior
    {"alg": "none", "typ": "JWT"}
    
    {"sub": "42", "role": "admin", "exp": 1893456000}
  8. The API uses HTTPS. What is wrong with how this request authenticates? Junior
    GET /v1/reports/export?api_key=sk_live_51Hx9 HTTP/1.1
    Host: api.shop.test

Take the quiz for this chapter · Read the explanation in the knowledge base

Documentation and contracts: OpenAPI, JSON Schema, contract testing

  1. The variable baseUrl is set in the Environment and in the Collection with different values. Which will Postman take? Middle
  2. What does JSON Schema validation of a response check? Middle
  3. What is consumer-driven contract testing (Pact)? Middle
  4. Why use a mock server when testing an API client? Middle
  5. What does Newman do? Junior
  6. Where is it best to keep a token obtained at login in a Postman collection? Middle
  7. How do you run one Postman request with different data 20 times? Middle
  8. What does this Postman test check? Middle
    pm.test('fast enough', () => {
      pm.expect(pm.response.responseTime).to.be.below(500);
    });
  9. The response schema of GET /users/{id} is below. The server returned {"id": 5, "email": "a@b.co", "passwordHash": "x9"}. What will validation against the schema show? Junior
    {
      "type": "object",
      "required": ["id", "email"],
      "properties": {
        "id": { "type": "integer" },
        "email": { "type": "string" }
      },
      "additionalProperties": false
    }
  10. The schema (JSON Schema, as in OpenAPI 3.1) describes a response. Which response content passes validation? Middle
    {
      "type": "object",
      "required": ["id", "middleName"],
      "properties": {
        "id": { "type": "integer" },
        "middleName": { "type": ["string", "null"] }
      }
    }
  11. The first object is the body schema of POST /payments before a release, the second one after it. Existing clients are valid against the old schema and do not send currency. How should this change be classified? Middle
    {"required": ["amount"], "properties": {"amount": {"type": "integer"}, "currency": {"type": "string"}}}
    
    {"required": ["amount", "currency"], "properties": {"amount": {"type": "integer"}, "currency": {"type": "string"}}}

Take the quiz for this chapter · Read the explanation in the knowledge base

Performance and reliability

  1. What does p95 latency = 400 ms mean? Middle
  2. How is load testing different from stress testing? Middle
  3. Which tools are used for load testing an API? Junior
  4. How do you test the idempotency of a transfer at the API level? Senior
  5. The result of a five-minute test under constant load is below. The SLO target: p99 at most 500 ms. What is the conclusion and the next step? Middle
    {
      "requests": 120000,
      "errors": 0,
      "rps": 400,
      "latency_ms": { "p50": 85, "p95": 140, "p99": 3900, "max": 9800 }
    }
  6. The client received this response and repeated the request after 1 second. How must a correct client behave and what does the test check? Middle
    HTTP/1.1 429 Too Many Requests
    Retry-After: 30
    Content-Type: application/json
    
    {"error": "rate_limited"}
  7. The first request actually ran on the server, only the response was lost. After the retry the database has two payments. What is the cause? Senior
    POST /payments HTTP/1.1
    Idempotency-Key: 11aa
    Content-Type: application/json
    
    {"amount": 5000}
    
    (client: timeout after 5 s, no response)
    
    POST /payments HTTP/1.1
    Idempotency-Key: 22bb
    Content-Type: application/json
    
    {"amount": 5000}
    
    HTTP/1.1 201 Created

Take the quiz for this chapter · Read the explanation in the knowledge base

gRPC

  1. Which transport and message format does gRPC use by default? Junior
  2. When is gRPC usually a better choice than REST? Junior
  3. A gRPC client calls a method directly over HTTP/2, with no gateway or transcoder, and the method returns NOT_FOUND. What HTTP status does the client see? Middle
  4. The user sent a token but is not allowed to perform the operation. Which gRPC status fits? Middle
  5. Which gRPC status means the service is temporarily unavailable and the call is safe to retry? Middle
  6. Why is reusing the number of a removed field in .proto dangerous? Middle
    message User {
      string id = 1;
      string email = 2;
      // was: string phone = 3;  (removed)
      int32 age = 3;
    }
  7. Which CI check most reliably shows that a .proto change breaks backward compatibility? Middle
  8. An int32 discount field in proto3 arrives as 0. How do you tell "discount 0" from "discount not set"? Middle
  9. The gRPC call below has no deadline. What can go wrong in production? Middle
    client.getOrder({ id: '42' }, (err, order) => {
      // ...
    });
  10. Which RPC type suits uploading a large file in chunks with a single final result? Middle
  11. Why can a browser not call a gRPC service directly? Middle
  12. What does server reflection give you when testing gRPC? Middle
  13. You configure automatic retries for a gRPC client. What should you take into account? Senior
  14. Which test best checks server behaviour when the client cancels a server-streaming call? Senior
  15. A method receives a 6 MB message and the server uses default receive settings. What will the client most likely see? Senior

Take the quiz for this chapter · Read the explanation in the knowledge base

Contract testing in practice

  1. What exactly is the "contract" in the consumer-driven approach? Middle
  2. The frontend and orders-api release separately and e2e has become the bottleneck. What does contract testing give? Middle
  3. In which order does the Pact cycle go? Middle
  4. What does pact-broker can-i-deploy --pacticipant web-app --version $SHA --to-environment production answer? Senior
  5. Why call pact-broker record-deployment --pacticipant web-app --version $SHA --environment production after a deploy? Senior
  6. What are stateHandlers for in provider verification? Middle
  7. What does this matcher check in a consumer test? Middle
    body: {
      id: like(42),
      items: eachLike({ sku: like('A-1') }),
    }
  8. A contract has total: 150 with no matcher, and provider verification fails on any cart change. What is the problem? Senior
  9. A new consumer branch publishes a pact with a field the provider does not yet return. How do you avoid breaking the provider build? Senior
  10. Which versioning approach in the Pact Broker is considered modern? Senior
  11. How does bi-directional contract testing differ from classic Pact? Senior
  12. A public API has hundreds of unknown third-party clients. What fits better than CDC? Senior
  13. What does Schemathesis do? Middle
  14. A service publishes events to Kafka. What does a message pact check? Senior
  15. Provider verification is green, yet the consumer breaks in production. What is the most likely cause in the Pact setup? Senior

Take the quiz for this chapter · Read the explanation in the knowledge base

Test design for APIs

  1. The quantity field in POST /orders is described as below. Which values cover boundary analysis: each boundary and the nearest invalid value beyond it? Junior
    {
      "quantity": { "type": "integer", "minimum": 1, "maximum": 100 }
    }
  2. The specification says age has the type integer. A test sends the request below. What does this response show? Junior
    POST /users HTTP/1.1
    Content-Type: application/json
    
    {"email": "a@b.co", "age": "30"}
    
    HTTP/1.1 201 Created
    {"id": 12, "email": "a@b.co", "age": 30}
  3. The GET /products endpoint accepts sort (price, name, rating), order (asc, desc) and inStock (true, false). What is the minimum number of tests that covers every pair of values of two parameters (pairwise)? Middle
    GET /products?sort=price|name|rating&order=asc|desc&inStock=true|false HTTP/1.1
  4. The allowed order status transitions are below. Which test is a negative one (a forbidden transition), expecting 409 and an unchanged state? Middle
    {
      "created": ["paid", "cancelled"],
      "paid": ["shipped", "refunded"],
      "shipped": ["delivered"],
      "delivered": [],
      "cancelled": [],
      "refunded": []
    }
  5. Why is a field's value space split into equivalence classes in API test design? Junior
  6. How do an absent field, a field with null and an empty string differ in test design? Junior
  7. A test set creates an order in the first test and uses its id from a constant in the following ones. How to make it independent of run order? Middle
  8. Time for testing is short. Endpoints: PATCH /profile/avatar, POST /transfers, GET /banners, DELETE /sessions. Where to start by risk? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base

The most critical API bugs

  1. What defect does total show and how is it fixed? Middle
    POST /api/v1/orders HTTP/1.1
    Content-Type: application/json
    
    {"items": [{"sku": "A1", "price": 0.1, "qty": 3}]}
    
    HTTP/1.1 201 Created
    
    {"id": 900, "currency": "UAH", "total": 0.30000000000000004}
  2. A record was added between two list requests. The list is sorted by created_at descending, newer records have larger ids. What causes the duplicate and what is the fix? Senior
    GET /api/v1/items?page=1&limit=2 HTTP/1.1
    -> 200  [{"id": 5}, {"id": 4}]
    
    (a new item with id 6 is created here)
    
    GET /api/v1/items?page=2&limit=2 HTTP/1.1
    -> 200  [{"id": 4}, {"id": 3}]
  3. You proved BOLA on staging with two of your own accounts. What do you do next? Middle
  4. A double click on "Pay" creates two charges. What class of defect is this and what should be checked? Senior
  5. After a password change, a refresh token issued before it still exchanges for new access tokens. How should this be classified? Senior
  6. The report "for yesterday" misses orders at 00:30 Kyiv time (UTC+2). The server stores time in UTC and computes day boundaries in UTC too. Which test data reproduces the bug most precisely? Senior
  7. The backend renamed the field phone to phoneNumber in v1 without notice, and the old mobile app shows an empty number. What is this? Middle
  8. POST /orders created the order, but the call to the notification service failed and the API answered 500. The client repeated the request. What should be checked first? Senior
  9. An endpoint responds in 80 ms on 10 records and times out on 100,000. What best shows it is N+1? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base