AI Interviews · Question

"Agentic coding" onsite round, reported as in beta: work with an AI agent in a large existing codebase. The same prep site says AI is otherwise banned in OpenAI interviews.

AI-assisted coding question reported at OpenAI (2026). Sources, confidence and an answer card.

Researched · updated

eng-095 Both tracks AI-assisted coding rounds AI-assisted coding Low confidence
On this page

What they’re really asking

If you only remember one thing, say this in the first minute: “In a codebase this big, my risk isn’t writing the code, it’s losing track of what changed. So I’ll work in four loops, each ending with evidence. First I’ll have the agent map the code and check its map myself. Then I’ll write a short plan: which files change and which tests prove it. Then I’ll ask for small diffs, one at a time, and run the tests after each. Finally I’ll add a test that fails before my change and passes after, read the whole diff, and explain it.”

The rest of this page explains each part of that answer, so you can say it with understanding.

Most coding interviews give you a small, self-contained problem. This one gives you an existing codebase that is too big to read in the time you have, and a task inside it. You are expected to work through an AI coding agent: a program built on a large language model (an LLM, a model that reads and writes text) that can read files, write code and often run commands. You give it instructions in plain words, called a prompt, and it proposes a diff, the set of line changes it wants to make.

Why is this different from normal work in an unfamiliar repo? Because the agent can change twenty files in the time it takes you to read one. In a large codebase, that speed is the danger. The agent might invent a helper that doesn’t exist, change a shared function that other code relies on, or make a failing test pass by weakening it. The interviewer wants to see that you stay in control of what changed and why, even when you can’t read everything.

interviewing.io describes an OpenAI onsite round, in beta and not given to every candidate, with a prompt, an existing codebase and a problem “too large and complex to tackle by hand”. It also says AI is otherwise “strictly prohibited” in OpenAI interviews (interviewing.iosecondary · 2026). This is a prep site’s report, not an OpenAI statement, and the grading criteria aren’t described, so treat the details as low confidence.

Clarify first

  • Which agent, with what permissions? Can it run tests and shell commands, or only edit files?
  • Is there a test suite, and does it pass now? Run it before changing anything. That gives you a baseline: the failures that were there before you touched anything.
  • What does done mean? A working feature, passing tests, or an explanation of the design as well?
  • Can you add dependencies or change public interfaces? Assume not unless told. A public interface here means any function or type other code calls.
  • Time budget for orientation versus building. Assume about 10 minutes of reading before the first change.

Say it like this: “Before I change anything I’ll run the existing tests, so I know which failures were already there.”

Answer

The four loops

1. Orient ── agent maps the code; you open 2–3 of the files it names to check the map
   │
   ▼
2. Plan ── you write: files that change, interfaces that stay fixed, tests that prove it
   │       agent critiques the plan; it doesn't replace it
   ▼
3. Change ── one small diff per prompt → run the related tests → read the diff → accept or send back
   │        (repeat; full suite at checkpoints)
   ▼
4. Prove and explain ── a test that fails before and passes after; read the final diff top to bottom
  1. Orient. Have the agent map the codebase: entry points, the modules your task touches, how tests run. Check its map against the code by opening two or three of the files it names. A wrong map produces wrong changes later, and the agent will not tell you it guessed.
  2. Plan. Write the plan yourself in a few lines: which files change, which interfaces stay fixed, and which tests will prove it. Ask the agent to critique the plan, not to replace it.
  3. Change in small diffs. One task per prompt, with constraints such as “don’t change exported signatures” and “show only the diff”. Run the relevant tests after every diff, and the full suite at checkpoints.
  4. Prove and explain. Add a test that fails before your change and passes after it. Read the final diff top to bottom, then summarize what changed, what you didn’t touch and what you’d check next.

One worked example

Practise the loops on a repo you haven’t read. The site’s rate-limiter lab is a good stand-in. A rate limiter caps how many requests a caller may make per time window. The lab has a real intermittent bug: its sliding-window limiter checks the count and then adds to it as two separate steps, without a lock. When many requests arrive at once, two of them can both see “under the limit” before either adds itself. This is called a check-then-act race. Its own concurrency test fails intermittently, about 5% to 37% of plain runs depending on load, as run on 2026-10-11.

Here is the task “make the concurrency test pass reliably” run through the loops. The minutes are a suggested time box, not a reported schedule.

MinutesLoopWhat happensWhat to say in the interview
0–3BaselineRun the suite several times; one concurrency test fails only sometimes”It’s intermittent, so one green run won’t prove anything.”
3–10OrientAgent names the limiter file and the test; you open both”The agent’s map says the count check is here. I’m confirming it.”
10–15PlanChange only the limiter’s check-and-add; keep its public interface”The test is right. The limiter is wrong. I won’t touch the test.”
15–30ChangeAsk for one diff: make check-and-add a single locked step”Show only the diff, don’t change exported signatures.”
30–40ProveRun the test many times in a row; read the full diff”Before the fix it failed some of the time; after, zero out of many runs.”

Notice one detail. Go’s race detector (go test -race) reports no data race in this lab, because every single memory access is atomic. The bug is in the logic, the gap between two correct steps. Only repeated runs show it. That is a good thing to say out loud, because it shows you know the difference between a tool’s silence and a proof.

What to watch for in a large codebase

A large codebase multiplies the usual review risks:

  • Invented code. The agent may call a helper that doesn’t exist. A Meta candidate reports exactly this (Aced (formerly Exponent)first-hand · 2026).
  • Shared code changes. It may change a shared utility that other callers rely on. Ask: “Who else calls this?”
  • Weakened tests. It may “fix” a failing test by loosening the assertion, adding a retry or skipping it.

So watch the diff for files outside your plan and for any edit to a test, and ask why each one is there. Say it like this: “This diff touches a file that wasn’t in my plan. Before I accept it, I want to know why.”

Senior vs Staff

Agentic work in a large codebase

Senior

  • Verifies the agent's map of the code, plans the change, ships small tested diffs and can explain every changed line.

Staff

  • Bounds the blast radius before starting (which interfaces are frozen, who else calls the code), notices when the agent's change crosses an ownership boundary, and leaves a summary another engineer could review.

In plain words: a Senior candidate stays in control of their own change. A Staff candidate also protects everyone else’s code from it, and leaves a trail another engineer could review.

Small-team version

This round is close to the daily job of a small team’s AI owner: an inherited or fast-growing codebase, with an agent doing most of the edits. The controls that matter are cheap:

  • Run the tests before the agent starts, so you know the baseline.
  • Give the agent no production credentials.
  • Keep diffs small enough to review in minutes.
  • Keep a conventions file that records each mistake the agent made, so it isn’t repeated.

Measure, don’t trust the feeling. Track lead time (first commit to production) and change-failure rate (the share of deploys that cause a problem) rather than trusting how fast it feels. METR’s 2025 developers believed they were faster while measuring slower (METR, 2025-07-10).

What the agent costs. Agents are billed per token, a chunk of text of roughly ¾ of a word. On each step the agent re-sends everything so far: instructions, files it read, diffs and test logs. That accumulated text is the context. In a large codebase the context grows fast, because orientation reads many files. Prompt caching, where the provider charges much less to re-read text it has just seen, helps a lot. An assumed 40-step session costs about $6.84 uncached and $1.22 with caching. Splitting orientation and each change into separate short sessions also cuts input tokens: two 20-step sessions use 37% fewer than one 40-step session.

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. Claude Sonnet 5 list prices, fetched 2026-10-11: $2 per 1M input, $0.20 per 1M cached input, $10 per 1M output.

  • Total input without caching = steps × starting context + added per step × steps × (steps + 1) ÷ 2 = 40 × 20,000 + 3,000 × 40 × 41 ÷ 2 = 3,260,000 tokens, $6.52; output 32,000 tokens, $0.32; total $6.84.
  • With caching: about 140,000 new input tokens ($0.28) + 3,120,000 cached ($0.62) + output ($0.32) ≈ $1.22.
  • Two 20-step sessions: 2 × (20 × 20,000 + 3,000 × 20 × 21 ÷ 2) = 2,060,000 tokens, 37% fewer.

Pitfalls

  • Exploring and editing at the same time. You can’t tell the agent’s exploration from its changes.
  • Accepting edits to tests that make failures go away. The test was the evidence; now it proves nothing.
  • No baseline run. You end up blaming your change for failures that were already there.
  • Presenting a large diff you haven’t read. “Can’t explain it” is exactly what the round is looking for.
  • Trusting one green run of a flaky test. Intermittent bugs need repeated runs as evidence.

Go deeper

Family

Drive a coding agent through a product-shaped build

Agent-assisted rounds at Stripe, Canva, Shopify, Snowflake, OpenAI and Cursor: you own the plan and the tests, the agent types, and you stop a growing spec from quietly changing what earlier rules mean.

Other questions in this family