All jobs / Backend developer / Testing

Backend developer interview question · 1–3 years

How do you test that POST /orders returns 201 with the right body, without deploying anything?

The strongest answer

Start the application inside the test process with its real routing, serialisation and middleware, send the request through the framework’s test client, and stub only the external dependencies at the boundary

Why it works

Right — that path covers routing, model binding, validation and serialisation, which is where the status code and the body are actually decided.

What a good answer covers

Answers that fall short

Who gets asked this

More Testing questions