Practice assignment
Node.js TypeScript take-home project example
- Node.js 20
- TypeScript
- Express
- Vitest
- 3–4 hours
HireCheck’s TypeScript assignments are native ESM (“module”: “NodeNext”), so imports use a .js suffix. You get a small Express app, a typed path from route to service to repository, and Vitest + Supertest. The starter type-checks; the provided tests fail until the TODOs are done.
The starter
The payment-webhooks sample on the landing page is the same shape, with a signature check and an idempotent processor instead of an orders API.
Requirements
A typical Node/TypeScript task on HireCheck asks you to:
- Keep the HTTP contract and the error shape
{code, message}(validation errors may adddetails). - Treat the given in-memory store like PostgreSQL: unique keys, optimistic
versionchecks, no process-wide mutex. - Use exact money or integer minor units — never IEEE floats for totals.
- Handle concurrent requests (idempotency keys, webhook redeliveries, two instances sharing one store).
Concrete examples in this library: orders API, payment webhooks, JWT auth, resilient HTTP client and CSV import.
Grading rubric
| Area | Points |
|---|---|
| Correctness (provided tests, including hardening) | 30 |
| Validation, error contract, no leaked internals | 15 |
| Domain logic (state, money, or the stated invariant) | 15 |
| Concurrency / idempotency where the brief requires it | 10 |
| Own tests | 15 |
TypeScript quality (strict types, no any, layering) | 5 |
| NOTES.md trade-offs | 10 |
Levels: junior ≥ 60, mid ≥ 75, senior ≥ 85 (and a strong NOTES.md).
What reviewers look for
- Pinned TypeScript types on the request principal, the parsed body and the error union —
anyis a smell. - A single error handler that never returns a stack trace.
- Tests that inject a clock or a fake upstream instead of sleeping.
- NOTES.md that says what changes with a real database (unique index,
UPDATE … WHERE version = ?, transactions).
Common mistakes
- Forgetting the
.jssuffix on ESM imports, sotscis green locally but the built app cannot start — the provided config already expects the suffix. - Using
numberfor money. - An in-process
Mutexto “fix” concurrency. The tests construct a second app on the same store. - Buffering a whole upload or webhook body as a string when the brief asked for a stream or the raw bytes.
How to run it
Node.js 20+. npm ci, then npm test (type-check + Vitest). npm run build && npm start serves on port 3000.
Download the payment-webhooks sample (no account), or generate a TypeScript assignment from a job ad.
Download the Node.js sample ZIP Generate one from a job adRelated practice tasks
Frequently asked questions
- Is this a frontend TypeScript test?
- No. These are backend Node.js / Express take-homes, written in TypeScript. There is no React or UI bundle in the starter.
- Do I need a database running?
- Not for the provided tests. The store is in-memory but behaves like a database (unique constraints, version conflicts). NOTES.md should still discuss PostgreSQL.
- Which sample should I download first?
- The free Node sample is the payment webhook processor. It is a good picture of signature checks, idempotency and concurrency.
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.