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

31. Category Tree with Moves

Medium

Nested product categories: create, rename, move whole subtrees, delete, and read breadcrumbs and subtrees.

40 minute budget0.0% acceptancetrees · hierarchy · cycles

Requirements

  1. 01Create a category at the top level or under a parent; read it, rename it, and list the top-level categories.
  2. 02Move a category, with everything under it, to a new parent or to the top level.
  3. 03Delete a category.
  4. 04Return a category's breadcrumb from the top down, and its full subtree as nested nodes.
  5. 05400 for invalid input, 404 for an unknown category or parent.

What the hidden tests check

  • Everything the interviewer tells you is checked.
  • The tree is read back after every move and delete, including the order of children.

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.