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

33. Course Enrolment with Prerequisites

Hard

Courses with seat limits and prerequisite chains: students record completions, enrol, drop and wait in line, and an eligibility check explains why a student cannot get in.

55 minute budget0.0% acceptancegraphs · prerequisites · waitlist · deadlines

Requirements

  1. 01Create courses with a code, a title, a seat limit, a drop deadline and prerequisite courses; read a course and replace its prerequisites.
  2. 02Create students and record the courses they have completed.
  3. 03An eligibility route says whether a student can enrol, why not, and which prerequisites are missing.
  4. 04Enrol an eligible student in a free seat, or on the waitlist when the course is full; drop a student from a course.
  5. 05400 for invalid input, 404 for an unknown course or student, 409 when the student cannot enrol.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • Seat and waitlist order are checked after every drop, and prerequisite chains several courses deep are checked.

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.