Stage 1 of 4: Fix builds with shared dependencies
Background. A build system turns targets into outputs. A target names a rule, its own source files, and the other targets it depends on; building it runs the rule over its sources and its dependencies' outputs. Results are cached, so a rebuild only re-runs what changed.
builder.py is the entry point: Builder(workspace).build(name) builds a target and everything under it. The other modules (graph.py, digest.py, cache.py, rules.py, model.py) are what it is built from.
The starter has a bug. Three tests in tests/test_part1_shared_deps.py fail.
Find it and fix it. Don't change the public interface.
Done when Submit goes green.
Constraints
- Python 3.12+ standard library only
- Time limit: 5 seconds per test
- Editable:
builder.py,graph.py,digest.py - Read-only:
model.py,rules.py,cache.py,test_helpers.py, alltests/test_*.pyfiles
What comes after stage 1
The next stages open once the tests for the one before them pass. Each raises the bar, the way an interviewer does in the room.
- Stage 2: Fix stale rebuilds. Edited sources and redefined targets must trigger rebuilds, and only those.
- Stage 3: Make large builds fast. Thousands of targets, dozens of rebuilds, two-second budgets.
- Stage 4: Find what a change affects. Before building anything: which targets can a change to these files reach?
The files you get
- Yours to edit: builder.py, graph.py, digest.py.
- Read-only: cache.py, rules.py, model.py, test_helpers.py, tests/__init__.py.
- Tests you can read and run: tests/test_part1_shared_deps.py. Hidden tests run on Submit.
The round: an agent in the editor
The assistant here works like the one in the interview IDE. It reads your files, runs code and proposes changes, and you accept or reject each one. It doesn't volunteer ideas, so what gets built is what you asked for. Along the way the interviewer asks about your decisions, and at the end the report says what you checked and what you accepted unread.
Frequently asked, briefly answered
Is Incremental Build System free?
It is a Pro problem. Free plan includes one complete problem, plus the first stage of several more, so you can see how a round works before you pay.
Which company asks something like this?
Google. It is modelled on Google's round: Code comprehension round (pilot on select US teams) — read, debug and optimize an existing codebase with Gemini as the assistant; graded on reviewing and validating AI output.
Do I bring my own AI tool?
No. The assistant is in the editor, same as in the interview IDEs at Meta, Stripe and Amazon. What you choose at Begin is the format: an agent that proposes changes you accept or reject, an answer-only assistant that can't write code, or no assistant at all.
What does the interviewer ask?
5 questions along the way about your own code, and one at the end about the whole session. A weak answer gets one follow up. The answers go into the report, which ends with a hire or no hire verdict.
Start the problem
Sign in and the problem opens where you left it. New here? An account takes a minute to create, and the Pro plan starts at the first stage of this problem.
More like it: every practice problem, how Google runs its AI round, the AI coding interview guide.