All jobs / QA / manual tester / API Testing
QA / manual tester interview question · 0–1 years
An API returns 200 with an error object in the body. What do you report?
The strongest answer
The contract mismatch: status, body, and what the client does with it — “200 + error” is a bug if the spec said 4xx, or a spec bug if it is intentional and undocumented
Why it works
Exactly. Status and body together are the contract. QA can say when they disagree.
What a good answer covers
- Read status and body.
- Compare to the spec.
- Say what the client will do.
- Do not “fix” it in the assertion.
Answers that fall short
- Close, but not the strongest: Nothing; 200 means success
200 is a number, not a verdict. - Weak: Only the UI; APIs are a developer concern
The UI is one client. The API is still the product. - Red flag: I change the test to accept both so CI stays green
Teaching the test to lie is how you ship the lie.
Who gets asked this
More API Testing questions
- What do GET, POST, PUT, PATCH and DELETE tell you before you write a single API test?
- An endpoint returns 400 for one request and 500 for another. What does that difference tell you?
- The UI looks fine; the list API dropped a field the mobile app still needs. Who should have caught it?
- Which request and response headers do you actually look at when testing an API?
- Pay is a POST. What conceptual API check do you insist on?
- Your Postman collection is the only way anyone tests this API, and three people now want to use it. What do…
- Two clients consume one API. Where do you put the cheapest tests?
- You are asked to “test the API” and you will not write a framework in the room. What do you still cover?