StaffCoder
Node.js

Node.js TypeScript Practice Exercises

Node.js 24
4 modules · 16 challengesSign up
Module 1 of 4 · 4 challenges

Routing & Controllers

Map each verb and path to its handler, resolve ids from the URL, and return the status that matches the outcome - created, updated, deleted, not-found, method-not-allowed. Covers nested resources and route precedence.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Bike Hire Endpoints

Sign up to unlock
15%2 of 13 solvedeasy
About this challenge

A bike rental shop's web service. Staff list bikes, add one, and view, edit or remove a single bike. It must reply with the right "found / created / deleted / not-found" signals instead of misleading ones.

Solved in a browser IDE and graded by tests. Sign up to solve

Course Catalogue Nested Routes

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

A training provider lists modules that live inside a course. A module is only valid under its own course, so asking for it through the wrong course returns "not found", and malformed ids are rejected before any lookup.

Solved in a browser IDE and graded by tests. Sign up to solve

Analytics Report Route Precedence

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

A reporting service where a fixed page (`/reports/summary`) keeps being mistaken for a generic "report by id" page. Routes must be ordered so named pages win, with a clean JSON not-found for anything unmatched.

Solved in a browser IDE and graded by tests. Sign up to solve

Meeting Room Booking Endpoints

STAR
Solving it completes the module
100%1 of 1 solvedeasy
About this challenge

An office room-booking service. Users filter rooms and request a reservation. It checks the times and party size make sense before accepting, and tells the user exactly which field was wrong.

Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Build real HTTP APIs in Node, one skill at a time. Easy → Hard: routing, validation, responses, middleware, data access — up to auth, caching, jobs, concurrency, transactions, streaming, resilience. Every challenge is API-only and test-driven: implement the missing piece until the supertest suite (in-memory SQLite, seeded) passes.

This path builds HTTP APIs in Node.js with TypeScript, starting with routing and controllers, request validation, status codes and middleware. You should be comfortable with basic TypeScript or JavaScript. No earlier backend experience is needed. The middleware module includes a request audit log and an access gate for an admin console.

From the blog

7
Bun 1.4 Updates: Rust Runtime, Native APIs, and MoreBun updates in the latest release bring a Rust rewrite, native APIs, stronger Node.js compatibility, and new package tooling.REST vs GraphQL: picking an API styleAn honest, trade-off-first comparison of REST and GraphQL — over/under-fetching, caching, versioning, and the cost GraphQL adds — so you pick by project shape, not hype.How to paginate an API properlyBuild a pagination contract that scales — page/limit vs cursor, a field whitelist for sorting, consistent page metadata, and the edge cases that break offset paging.Why your Express async errors slip throughA rejected promise in an async route handler never reaches your Express error middleware. Here's why the default error handler misses it, and three ways to fix it.Securing an Express APIExpress security best practices as a pre-ship checklist — authentication, rate limiting, input validation, security headers, and secret handling.How to handle API errors consistentlyOne error envelope, one middleware, one shape — a practical pattern for API error handling that clients can rely on, with status-code mapping and safe messages.REST API design done rightThe REST API checklist to run before you ship — resource naming, status codes, error shapes, pagination, versioning, and auth.

Frequently asked questions

4

What will I practice in this path?

4 modules: Routing & Controllers, Request Data & Validation, Responses & Status Codes and Middleware Basics.

How many Node.js exercises are there, and how hard are they?

16 exercises, all easy.

What does this path run on?

Challenges run on Node.js 24.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.