Ctrl K
QA · Mid-level · Theory

How would you test a REST endpoint for creating an order, POST /orders? What would you check besides a successful response?

~4 min by voice

How to approach it

This checks whether the candidate can test an API systematically, not just the happy path: the contract, actual persistence of data, validation, security, business rules, idempotency and side effects.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsThere's an endpoint POST /api/users: it accepts JSON with the fields email and name, and on success returns status 201 and the created user with the fields id, email, name and createdAt. Write automated tests for this endpoint: a positive scenario that checks the response schema, and a couple of negative ones. Mid-levelYour service is integrated with an external payment provider, and on the test environment it's either unavailable or takes a minute to respond. How would you test this integration? Mid-levelWhat's the difference between the HTTP methods GET, POST, PUT, PATCH and DELETE? And what does it mean for a method to be idempotent? JuniorIn a system of twenty microservices, the end-to-end tests take a long time and fail constantly. How would you apply contract testing, and what won't it cover? SeniorLet's say you need to build a REST API for a simple notes service. What endpoints would you create, and what would they look like? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min