Cross-lab interview prep

50 Algorithm & Systems Problems

This set was built from research into publicly reported interview experiences at Anthropic, OpenAI, DeepMind, and Mistral, plus the classic algorithm categories that recur across ML-infra and conversational-AI coding rounds industry-wide. Problems are grouped by the lab whose reported interview style they best match: the first nine follow Anthropic-style rounds, the next eight follow OpenAI-style rounds, the next nine follow DeepMind-style rounds, then sixteen general cross-lab ML-infra patterns, and finally eight classic algorithm patterns reported across most of the labs.

How to read the grounding badges: every problem page states plainly whether its scenario is Confirmed — backed by a specific source describing that lab's actual interview process — or General Pattern — a plausible, industry-standard scenario framed around that lab's domain, but not a confirmed detail of a real reported question. Treat "General Pattern" problems as strong practice for the category, not as leaked interview questions.

What's on each problem page

  • The scenario, framed around the relevant lab's product/infra domain, with its grounding badge.
  • The actual stub function signature and docstring from the corresponding .py file in ../ (the code you'd run locally to practice).
  • A step-by-step walkthrough of the solution approach — the reasoning, not just the final code.
  • A "how to recognize this pattern in general" section, for transferring the approach to a novel problem in an interview.

Running the code yourself

Every problem has a matching pair of files one level up, in src/:

src/1_redact_banned_phrases.py            # stub — implement the function, then run it
src/1_redact_banned_phrases_solution.py   # reference solution — run it directly

python3 N_slug.py runs your implementation against the built-in test cases and asserts they pass. python3 N_slug_solution.py runs the reference solution and prints a step-by-step trace of its execution.

Start with Problem 1: Redact Banned Phrases in a Streamed Response, or jump to any problem from the sidebar.