awesome-everything RU
↑ Back to the climb

APIs

REST modeling: multiple-choice review

Crux Multiple-choice synthesis across the REST-modeling unit: nouns vs verbs, non-CRUD transitions, nesting depth, representation vs resource, idempotency, and HATEOAS pragmatics.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 13 min

Six questions that cut across the whole unit. Each one is a design decision you make at a whiteboard or in a PR review — not a definition to recite, but a tradeoff to defend when a teammate pushes back.

Goal

Confirm you can connect resource modeling, non-CRUD transitions, nesting depth, the representation/resource split, idempotency, and HATEOAS pragmatics — the synthesis the lesson built toward.

Quiz

A teammate proposes GET /getOpenOrders and POST /createOrder as your two new endpoints. What is the most precise objection?

Quiz

You must expose 'cancel an order', a guarded transition with rules (not shipped, not already cancelled). Which model is both RESTful enough and safe?

Quiz

A dashboard renders /customers/7/projects/3/orders/42/items in nine sequential calls and the path breaks whenever an item moves between orders. What is the senior fix?

Quiz

Your API serializes ORM rows straight to JSON. Why is adding an explicit mapping layer (DTO/serializer) the highest-leverage decision in the design?

Quiz

A client retries POST /payments because the response timed out, and the customer is charged twice. Which statement about idempotency is correct?

Quiz

A purist blocks your PR because the responses do not carry hypermedia links (HATEOAS). How should a senior weigh this?

Recap

The through-line: a REST API models nouns the client needs, with the verb in the HTTP method, filtering and paging in query params, and non-CRUD transitions as guarded action or transition resources — never a client-writable status field. Keep nesting shallow and use expansion to kill chatty screens. Serialize through a mapping layer so the representation is a contract you own, not your DB schema. Know that POST is not idempotent (use idempotency keys for safe retries) and that HATEOAS is the elegant theory level-2 REST rarely needs.

Continue the climb ↑REST modeling: free-recall review
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.