Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Distributed Crossword Solver

Design a distributed search service that solves crossword grids while preventing workers from exploring the same logical search state.

Problem statement

For this exercise, assume a client submits a crossword grid and an immutable dictionary version, then requests the first valid complete fill or a definitive exhausted result. The grid defines fixed blocked cells and across and down slots.

Every completed slot must use one dictionary word, and a dictionary word may be used at most once in one solution. Logically identical partial fills have one canonical state key regardless of assignment order.

A search frontier item may have at most one active worker lease; a retry after lease expiry must remain safe, and a valid solution cancels remaining work for that job.

The service handles 10,000 submitted puzzles per day, up to 200 concurrent jobs, grids as large as 25 by 25, and hard jobs that may expose 100 million candidate states.

An accepted job is durable within one second, 95% of solvable jobs finish within two minutes, worker loss may delay but must not corrupt a job, and completed results remain available for seven days.

Puzzle authoring, clue generation, ranking multiple solutions, interactive play, billing, and dictionary training are outside scope.

What to build

  1. A client can submit a valid grid and immutable dictionary version using an idempotent request and receive one durable job identity.
  2. A client can read queued, running, solved, exhausted, failed, or cancelled status and can request cancellation.
  3. Workers can claim bounded frontier items so one canonical partial-fill state has at most one active lease and completed work is recorded idempotently.
  4. The service can reassign expired work, stop remaining work after a solution or cancellation, and preserve one terminal job result across retries and worker failures.

At scalePractice assumption

  • Accept 10,000 puzzle jobs per day and schedule up to 200 concurrent jobs fairly.
  • Support grids up to 25 by 25 and hard searches that expose as many as 100 million candidate states.
  • Durably accept a job within one second and finish 95% of solvable jobs within two minutes.
  • Tolerate worker loss without job corruption and retain terminal results for seven days.