All jobs / QA / manual tester / API Testing
QA / manual tester interview question · 0–1 years
An endpoint returns 400 for one request and 500 for another. What does that difference tell you?
The strongest answer
4xx says the request was wrong, so my data or the client is at fault; 5xx says the server broke while handling it, which is a defect even when my input was nonsense
Why it works
Right — and the corollary matters: a server that answers bad input with a 500 is still a bug, because it should reject it as 4xx.
What a good answer covers
- 4xx is yours; 5xx is theirs.
- On 4xx, check what you sent.
- On 5xx, get the server logs.
- Bad input should never be a 500.
Answers that fall short
- Close, but not the strongest: 400 means bad input and 500 means the server failed, so I report the 500 as the bug
Correct, and add the consequence: a 4xx sends you back to your request, a 5xx sends you to the server logs. - Weak: Both are errors, so I file them together as one bug about that endpoint failing
They have different owners and different next steps; merging them buries the real defect. - Red flag: I retry the call until I get a 200 back and carry on with the rest of the test
Retrying past an error is how a broken endpoint reaches production with a green test run behind it.
Who gets asked this
More API Testing questions
- 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?
- The OpenAPI file is stale. Tests use a different example. What do you do?
- You are asked to test authentication and authorisation on an API. What is on your list?