HomeChallengesRepsProblemsLeaderboardTake a challenge

Say what you send

GET /orders returns whatever shape is lying around, and sorts the stored queue in place while it is at it. Make the response type a promise the compiler checks, and return the orders oldest first without changing what is stored.

Beginner8 min on the clock4 graded checks · 100 pointsTyped Express
Graded by running your code against real cases.

What you build

  • Type the handler’s response as Response<Order[]>
  • Return the orders as an array, oldest first
  • Sort a copy, never the stored queue

Done means

The response type is enforced, the orders come back oldest first, and the stored queue is untouched.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. Refuses res.json({ ok: true })+25TypeScript basics
  2. The response is Response<Order[]>+20TypeScript basics
  3. GET /orders returns the orders, oldest first+35TypeScript basics
  4. The stored queue is untouched+20Not mutating your inputs

What it teaches

The rest of Typed Express