OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/CRUD & REST

2. Todo API with Auth

Easy

Signup, login, and per-user todo lists behind a bearer token.

35 minute budget81.2% acceptanceCRUD · bearer token

Requirements

  1. 01POST /auth/signup (201) and POST /auth/login (200) take { email, password } and return { token }; invalid input is a 400.
  2. 02Every /todos route requires Authorization: Bearer <token>. A missing, malformed or unknown token is a 401.
  3. 03Per-user todos: create, list (oldest first), read, update, complete and delete. A todo is { id, title, completed, createdAt }.
  4. 04Another user's todo is a 404 on every route, never a 403.
  5. 05Standard library only: hash passwords (scrypt, or sha256 + a random salt) and issue random, unguessable tokens.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • Every /todos route is probed with bad tokens and with another user's todo id.

4 more details are held back. In a mock interview they come out only when you ask the interviewer the right question; in practice they are listed in the workspace.

Sign in to start

Attempts, files and transcripts are saved to your account so the grader can review how you worked.

Sign inCreate an account
OpenBook

Practice for interviews where you build a feature with an AI assistant.

Early preview. Problems, grading and the interviewer are still changing.

Practice

  • Problems
  • Tracks
  • How it works
  • Pricing

Legal

  • Terms
  • Privacy
© 2026 OpenBook.