All jobs / Backend developer / API Development

Backend developer interview question · 0–1 years

The interviewer asks: “When do you nest URLs like /orders/12/items?” Strongest answer?

The strongest answer

When items are a real sub-resource of that order. If the child is first-class, a flat /items?orderId=12 is clearer than a deep tree.

Why it works

Exactly. Nesting expresses ownership. Deep trees that exist only to pass filters are harder to cache, authorise and document.

What a good answer covers

Answers that fall short

Who gets asked this

More API Development questions