AlgoMaster Logo

Library Search: Solution Walkthrough

Medium Priority17 min readUpdated November 11, 2026

Library Search is a book search system for a public library's website. The codebase contains about a dozen small files that work together to turn raw search parameters into a JSON-ready response. Readers can search the catalog, filter books by genre or availability, and browse paginated results, with a summary box displayed above the list.

The round lasts 60 minutes and has four phases:

  • Phase 0: Understand the code (10 minutes). Fill in three blanks with the values produced by the code and answer three questions about how a search request flows through the files.
  • Phase 1: Fix the search tickets (15 minutes). Resolve three support tickets about searches that should return matches but don't.
  • Phase 2: Fix the results summary (15 minutes). Fix a bug where the summary box doesn't update when readers apply filters.
  • Phase 3: Add stable paging (20 minutes). Add cursors so books stop appearing twice or going missing when the library adds books between page requests.

The individual bugs are small, and the assistant will find each one quickly. The hard part is that every fix has a version that is only half right.

Every ticket describes a specific symptom, and the visible tests check exactly that symptom. The hidden tests check the README rule behind it, so a fix that only covers the ticket passes the visible tests but fails the hidden ones.

Premium Content

Subscribe to unlock full access to this content and more premium articles.