OpenBook
  • Problems
  • Tracks
  • How it works
  • Pricing
Start practicingSign In
Problems/Data Modeling

1. Library Checkout System

Medium

Model books, members and loans. Enforce loan limits, due dates and late fees.

45 minute budget58.4% acceptancedata modeling · validation · REST

Requirements

  1. 01POST /books, GET /books, GET /books/:id with title, author, isbn, copies.
  2. 02POST /members with name and email. Email must be unique.
  3. 03POST /loans checks out one copy of a book to a member. A member may hold at most 3 active loans.
  4. 04Checking out a book with zero available copies returns 409.
  5. 05POST /loans/:id/return marks the loan returned and computes a late fee of 50 cents per full day past the 14-day due date.
  6. 06Requests may carry an x-now header with an ISO date. Treat it as the current time when present, so tests can control the clock.
  7. 07GET /members/:id/loans lists active and returned loans with fees.

What the hidden tests check

  • Loan limit is enforced at exactly 3 active loans.
  • Available copies decrement on checkout and increment on return.
  • Late fee is rounded to cents and zero when returned on time.
  • Duplicate member email returns 409 with an error body.

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.