Practice assignment

Orders REST API take-home assignment

A small webshop needs a backend to accept and track orders. The checkout frontend may retry on a flaky connection, and finance reconciles totals to the cent. The Spring Boot brief is the core HTTP contract. The TypeScript brief adds exact bigint money, an Idempotency-Key header, optimistic versions on status changes, and limit/offset listing.

The starter

POST   /api/orders
GET    /api/orders/{id}
GET    /api/orders?status=PAID
PATCH  /api/orders/{id}/status

Allowed transitions: NEW → PAID | CANCELLED, PAID → SHIPPED | CANCELLED. Everything else, including self-transitions, is 409 INVALID_STATUS_TRANSITION.

Requirements

Grading rubric

AreaPoints
Correctness (provided tests)30
Validation & error contract15
Domain logic: state machine, exact money15
Idempotency & concurrency (TypeScript; discussed in Java NOTES.md)10
Own tests15
Structure5
NOTES.md (pagination, persistence, key expiry)10

Levels: junior ≥ 60, mid ≥ 75, senior ≥ 85 (and a strong NOTES.md).

What reviewers look for

Common mistakes

How to run it

Java: mvn verify (58 provided tests on the template). Node.js: npm ci and npm test.

Generate an orders-style assignment from a job posting, or start with a free sample in a related style.

Download a Spring Boot sample Generate one from a job ad

Related practice tasks

Frequently asked questions

Why is idempotency only required on the TypeScript brief?
The two templates are pitched at slightly different depths. On the Java task, mentioning an Idempotency-Key in NOTES.md is part of a senior submission; on the TypeScript task it is in the contract and the tests.
May I swap H2 for Postgres?
Yes, if the HTTP contract and the provided tests still hold. Say in NOTES.md what unique indexes and conditional updates you would add.
Is a webshop take-home too simple for senior?
The happy path is simple. Senior shows up in money, conflict handling, and the notes on what you would do next.

Practice only. This is an original HireCheck practice assignment, not a real employer's take-home, and it is not affiliated with any company mentioned as a role example.