Bug squash Medium · 60 minutes
Bug reports written as symptoms, in code you've never seen. Reproduce each one, find the cause, fix it.
Crumb & Co. delivers celebration cakes and cafe orders around town. The delivery scheduler
is a small Python package of six modules (about 320 lines). It parses delivery windows like
9:00-11:30 and 2pm-4pm, assigns deliveries to the drivers on shift, orders each
driver's route by window start and priority, works out ETAs, and prints a route sheet.
It mostly works, but four bug reports have come in. Each one describes what people see, not what's wrong in the code. Your job is to find and fix the root cause of each one. This is the "bug squash" format, like Stripe's bug-finding round and other debugging interviews: you're handed unfamiliar code and a list of symptoms, and you're judged on how methodically you get from symptom to cause.
Time box: 60 minutes. The bugs get subtler as you go. Each one has its own test file and doesn't depend on the others, but work through them in order.
12pm-1:30pm fails with "window
ends before it starts", and lunchtime ETAs print as 0:40pm. Done when every time around 12
o'clock, morning or afternoon, parses and prints correctly.
The README in the download has the full bug reports and the scheduling rules. test_existing.py
passes from the start; test_stage1.py to test_stage4.py go with bugs 1 to 4.
Run them with python3 -m unittest discover -s tests.
Same format as Stripe's bug squash (bug bash) round and Google's code comprehension round (pilot).
60 minutes, with the AI assistant on, and every stage open from the start. Good for learning the problem. Pick a company to practice with the time limit and AI rules of its real round.
Like a real round: each stage's instructions and tests show up only when the stage before it passes, so you can't read ahead, and neither can the assistant. 60 minutes. Your work here is kept separate from Standard.
Stripe hasn't published an AI policy for candidates. Assume no AI unless your recruiter says otherwise. The stages unlock one at a time, as in Interview mode. Our Stripe guide
Google confirmed Gemini is the assistant in the pilot. The stages unlock one at a time, as in Interview mode. Our guide to AI-assisted interviews
Run All tests to see which stages pass. The details for each stage are in README.md and the docstrings.
A methodical search instead of random reading, fixing the cause instead of the symptom, and a test that proves the fix.
Loading the editor…
Choose All tests under the editor and click Run to see where you stand. On the starter repo, the existing tests pass and each stage's tests fail until you finish that stage.
Ask about the code, a failing test, or what to try next, the way you'd use an AI assistant in the interview. Your files and your last run go with every question, so there's nothing to paste.
In Edit mode it also changes your files when you ask it to, and you can undo each change. Some interviews' assistants can edit your code and some can only answer, so switch to Ask to practice the second kind.
It can often write a whole stage at once. In an interview you'd have to explain every line, so practice in small steps. Why, and how to talk about AI-written code
Answers come from Claude Sonnet and can be wrong. Run the tests before you trust one.
It's free with an Interview Cake login while the workspace is in beta, up to 30 questions a day.
Prefer your own editor? Download the starter repo, or use Download my code to take your work with you, and run the tests with python3 -m unittest discover -s tests.
The task, the rubric and the walkthrough are on the problem page.