How would you test a REST API?
How the interviewer asks it
“A new REST endpoint creates a booking and returns it. Describe how you would test it: the cases, the data, the status codes you expect, and how you would automate it.”
Typed drills are free and unlimited: the AI scores your answer against the outline below.
What the interviewer is looking for
- Contract checks: request and response schema, headers, status codes.
- Validation and error cases with the right 4xx codes.
- Authentication and authorisation, including another user's booking.
- Business rules and side effects: the booking really exists, no double booking.
- An automation approach that runs in CI with isolated test data.
How to structure your answer
- 01
Understand the contract
Read the spec: fields, rules, status codes and side effects.
- 02
Happy path
201 Created, the body matches the schema, a follow-up GET returns the same booking.
- 03
Negative cases
Missing and invalid fields (400), no token (401), wrong user (403), unknown resource (404), conflicts (409).
- 04
Robustness
Retries with an idempotency key, concurrent requests for the same slot, large and unusual inputs.
- 05
Automation
API tests in code with generated data, run on every pull request, plus contract tests with consumers.
Best answers from candidates
No candidate answers yet. Type yours, and if it scores 6 or more you can show it here without your name.
Answers are shared by candidates, without names, after a privacy check. Add yours
Common mistakes
- Only checking the status code and not the body or side effects.
- Tests that depend on shared data and each other's order.
- Ignoring authorisation between users.
Follow-up questions to expect
- The endpoint must handle 500 bookings a second. How do you test that, and what do you report?
- How do you test it when it calls a payment provider?
Now answer it out loud
Max will ask you this exact question, listen to your answer, push on the weak spots with follow-ups like the ones above, and score you when you finish.
Practice with MaxFree: a 5-minute voice round and unlimited typed drills, with scored feedback. No card, and your camera is never recorded.