What they’re really asking
If you only remember one thing, say this in the first minute: “With an empty repo, my workflow is the thing being graded, so I’ll make it visible. First a two-minute setup: a test runner, one passing test, a commit. Then I’ll say my plan and the three tests that define done, write those tests myself, and let the AI write the implementation one module at a time. I’ll run the tests after every change, clean up what the AI wrote, and commit at each green step. When requirements grow, I’ll add the new test first and keep the old ones.”
The rest of this page explains each part of that answer, so you can say it with understanding.
In a normal coding interview, the interviewer looks at your final solution. Here there is almost nothing to look at except how you work. You start with an empty repository, your own editor and any AI tool you like. Hello Interview’s prep guide reports two AI coding interviews at Shopify in this shape: “You get an empty GitHub repo” (Hello Interview).
The tool changes what matters. An AI coding agent (or assistant) is a program built on a large language model, an LLM, a model that reads and writes text. You describe a task in a prompt, and it writes the code. With a good agent, a small program like an LRU cache can appear in a minute. So the question is not “can you produce it?” but “is it clearly yours?”: did you decide the structure, did you choose the tests, can you explain every line, and does the result read like code a teammate would accept?
The same guide lists workflow, design, ownership (“You drive, AI assists”), readability, testing and communication as what is graded. It adds that candidates who “wrote zero code by hand” still passed when they were “clearly directing the AI and could explain what it produced” (Hello Interview). That is a prep site’s summary of candidate reports, not Shopify’s rubric. Shopify’s head of engineering said of AI in interviews, “We’re embracing it” (The Pragmatic Engineer).
Clarify first
- The problem’s boundaries: input format, output, error cases. Hello Interview lists Robot Navigation, LRU Cache and Tail Command as examples.
- Language and runtime: your choice, or theirs?
- What “done” looks like: a command-line tool, a library with tests, or both?
- Will requirements be added part-way? Assume yes, and structure for it.
- May you install packages? Assume only a test runner.
Say it like this: “I’ll assume a library with tests, standard library only, and that you’ll add requirements as we go. Is that right?”
Answer
The first minutes are part of the grade, so make them visible.
- Set up in two minutes. Create the project, add a test runner and one passing smoke test (a trivial test
that proves the test setup works), and commit. Add a short conventions note for the agent: language version,
no new dependencies, tests in
tests/. It saves repeating yourself in every prompt. - State the plan out loud: modules, the data structure, and the three tests that define done.
- Write the first tests yourself, then delegate the implementation in one-module prompts. Run the tests after every change.
- Clean up what the agent wrote. Hello Interview’s advice: “Even if the AI-generated code works perfectly, go over it and clean it up.” Rename, delete dead branches, and make error handling explicit.
- Commit at each green step with a message that says what changed. The history is evidence of your workflow.
- When requirements grow (an expiry time, thread safety, a new command), name the module that changes, add the new test first, and keep every old test.
The loop, as a picture
Plan out loud ── data structure, modules, the 3 tests that define done
│
▼
You write the tests ── they fail (nothing exists yet)
│
▼
One prompt, one module ── "implement X; don't touch the tests; no new dependencies"
│
▼
Run tests → read the diff → clean up names and dead code
│
▼
Commit ("LRU: get refreshes recency") ── then the next module or the next requirement
One worked example: an LRU cache
An LRU cache (least recently used) holds a fixed number of entries. When it is full and a new entry arrives, it evicts the entry that was used longest ago. The standard design is a hash map plus a doubly linked list: the map finds an entry in O(1), and the list keeps entries in order of use, so moving one to the front and dropping the last are also O(1).
Here is how the session might run. The minutes are a suggested pace, not a reported schedule.
| Minutes | Step | Commit message | What to say in the interview |
|---|---|---|---|
| 0–2 | Setup, smoke test | ”Project setup, test runner" | "I want a green test before any real code.” |
| 2–6 | Plan, three tests by hand | ”Tests: put/get, eviction at capacity, get refreshes recency" | "These three tests are my definition of done.” |
| 6–15 | Prompt for the map + list | ”LRU: O(1) get and put" | "I’ll let the agent write the linked list; I’ll review the pointer updates.” |
| 15–20 | Cleanup pass | ”LRU: rename, remove unused branch" | "It works, but I want it to read like our code.” |
| 20+ | New requirement: expiry time | ”Test first: expired entries miss" | "Expiry touches get only. The old tests stay.” |
The test that matters most is “get refreshes recency”. Put A, B and C in a cache of size 3, read A, then add
D. The cache must evict B, not A. It is easy to get subtly wrong (a get that forgets to move the entry), and
it is the one that shows you understand what “least recently used” means.
Narrate as you go. The interviewer is watching your screen and needs to hear your reasoning. Delegate the boilerplate. Keep the data-structure choice, the edge cases and the test list.
Senior vs Staff
Empty repo, any tool
Senior
- A clean setup, tests from the first minutes, small commits, readable code and a clear explanation of everything the agent produced.
Staff
- Chooses a structure that absorbs the next requirement, says what was deliberately left out, and treats the conventions note and test list as the real design.
In plain words: a Senior candidate produces clean, tested code with a visible workflow. A Staff candidate also shapes the code for the next requirement and treats the tests and conventions as the design itself.
Small-team version
This is how a new service starts at a small company: one engineer, an agent and an empty repo. Do the same things on day one:
- a test runner;
- CI (continuous integration, a server that runs your tests on every push);
- a conventions file the agent reads;
- small commits;
- no production secrets in the development environment.
They cost about an hour, and they are what keeps agent output reviewable a month later. They also make the speed-up measurable. DORA, Google’s yearly study of software delivery, found in 2025 that AI “amplifies what’s already there” (Google Cloud, 2025-09-23), so good foundations come first.
What the tooling costs. Agents are billed per token, a chunk of text of roughly ¾ of a word. Each step of an agent session re-sends the whole conversation so far, so the bill grows quickly with session length. Prompt caching, where the provider charges much less to re-read text it has just seen, cuts it. At the family walkthrough’s assumed 10 agent sessions a day, that is about $1,500 a month without prompt caching and $270 with it (Claude Sonnet 5 list prices, fetched 2026-10-11). Set a spend cap from day one.
The arithmetic behind the numbers (for a Staff-level follow-up)
Assumed session: 40 steps, 20,000 starting tokens, 3,000 tokens added per step, 800 output tokens per step. Prices: $2 per 1M input, $0.20 per 1M cached input, $10 per 1M output.
- One session without caching: 40 × 20,000 + 3,000 × 40 × 41 ÷ 2 = 3,260,000 input tokens ($6.52) + 32,000 output tokens ($0.32) = $6.84.
- With caching: about 140,000 new input tokens ($0.28) + 3,120,000 cached ($0.62) + output ($0.32) ≈ $1.22.
- 10 sessions a day × 22 working days = 220 sessions: about $1,500 or $270 a month.
Pitfalls
- Generating the whole program in one prompt. You then have to explain code you didn’t shape.
- Leaving tests until the end. Hello Interview’s guide warns against it, and you lose your definition of done.
- Shipping the agent’s first draft. Working code that doesn’t read well still fails “readability”.
- Working silently while the interviewer watches. They can’t grade reasoning they can’t hear.
- One giant commit at the end. The history is your evidence of workflow; small commits tell the story.
Go deeper
- Family walkthrough: Drive a coding agent through a product-shaped build, especially “Plan before code” and “Verification”.
- Small Go codebases to rebuild from scratch with an agent and compare: Build Your Own Feature Flag Service and Build Your Own Distributed Rate Limiter.