Skip to content

Interview question · Build-an-Agent Coding Rounds

What does a build-an-agent coding round test, and how would you prepare for one in a week?

The orientation question for the coding round. The strong answer names what is being assessed, gives the skeleton to know by heart, plans the clock, explains why a scripted fake model makes the tests deterministic, and lays out a week of preparation that builds the skeleton into reflex.

easyNewUpdated Nov 2026

TL;DR: The round tests judgement under time, not cleverness: can you get a minimal loop running in the first fifteen minutes, add the controls the prompt is about, validation, budgets, errors as results, idempotency, and talk through why as you go. Prepare by making the skeleton a reflex: the loop, a tool registry, a dispatcher that validates and returns errors as observations, a step and token budget, and a scripted fake model that returns fixed replies so your tests run offline and deterministically. A week is enough if every day ends with a loop you wrote from memory and a failure path you tested.

How to approach it

Say what the interviewer is scoring, then show the skeleton and the clock. Interviewers ask this question to hear whether you know that the first fifteen minutes decide the round. Then give the preparation plan as days with an output each, not as topics to read.

A strong answer

The round gives you a prompt like "build a tool-calling loop with a step budget and error handling" and forty-five to sixty minutes. What is scored is visible in the order you do things: whether something runs end to end early, whether you add the controls the prompt is really about, whether failure paths are tested rather than described, and whether you narrate decisions as you make them (What the Live Build Round Tests).

The skeleton to know by heart:

loop(messages, tools, budget)
  for step in 1..budget.steps:
    reply = model(messages, tools)          # the model is injected
    if reply has no tool calls: return reply.text, exit="done"
    for call in reply.tool_calls:
      result = dispatch(call)               # validate, run, catch
      messages.append(tool_result(call.id, result))
    if budget.tokens exceeded: return exit="token_budget"
  return exit="step_limit"

dispatch(call)
  tool = registry.get(call.name)  or  error "unknown tool, options: ..."
  args = validate(tool.schema, call.arguments)  or  error "invalid: ..."
  try: return tool.run(args)
  except ToolError as e: return error str(e)   # errors are observations

The piece people skip is the model. Calling a real model in the round makes every test slow, non-deterministic and dependent on a key. Inject the model instead, and write a scripted one for the tests: a list of replies it returns in order, the first a tool call, the second another, the third a final answer. Now the loop is a pure function of its inputs, and the test for "unknown tool" is a scripted reply that calls a tool that does not exist, with an assertion that the next message is an error result and the loop continues. That one move turns the round from a demo into engineering.

Plan the clock:

 0-15   minimal loop runs end to end with the scripted model; one test
15-35   the controls the prompt names: validation, budgets, error results,
        idempotency keys on writes; a test per control
35-50   the failure paths the interviewer will ask about: bad arguments,
        tool exception, step limit, the model calling the same tool again
50-60   walk through the trace of one run; say what you would add next

Narrate as you go: "I am returning the schema error to the model instead of raising, because the model can fix its arguments and an exception would end the run." That sentence is worth more than the code it describes.

A week of preparation, one output per day:

DayBuildTest
1The loop and a scripted model, from memoryHappy path: two tool calls then an answer
2Registry and dispatcher with schema validationUnknown tool; invalid arguments return errors
3Step and token budgets with named exitsLoop ends with the right exit and the trace says why
4Idempotency keys on write toolsThe same call twice performs one write
5Loop detection and a tool-error pathRepeated call warns then stops; a raised error becomes a result
6Full rebuild from a blank file, timedEverything above in under 40 minutes
7One extension the prompt might add: streaming, parallel reads, approvalWritten, tested, explained aloud

By day six the skeleton is reflex, and the round's clock goes to the interesting part, which is the control the prompt is about and the conversation around it.

Authority line, which you should say in the round: the model proposes tool calls; the dispatcher decides whether they run; the budget decides when the run ends. The model never ends the loop by itself.

What interviewers probe next

"Why not call the real model? It would prove the loop works." It would prove the loop works once, slowly, on today's model output. The scripted model proves the harness handles each shape you force, deterministically, in milliseconds, and the round is about the harness.

"The model keeps calling the same tool with the same arguments." Detect the repeat in the dispatcher, return a note that the call was already made with that result, and end the run with a named exit if it continues. Say which of these the budget would have caught anyway, and later.

"You have ten minutes left and no idempotency. What do you do?" Say so, write the key derivation as a comment on the write tool, and test the one thing that matters most for this prompt. Unfinished and honest scores above finished and silent.

How it's scored

Weak: Starts with a framework or with the real model, has nothing running at twenty minutes, or describes error handling without a test.

Hire: Gets the loop running early with a scripted model, adds validation, budgets and error results with tests, and narrates the decisions.

Strong Hire: Also adds idempotency and loop detection, walks a trace at the end, states the authority line, and shows a preparation plan that produces a rebuild from memory.

Common mistakes

  • Spending the first fifteen minutes on structure instead of a running loop.
  • Testing against a live model and losing time to its variance.
  • Raising exceptions from tools, so the first error ends the run.
  • Budgets that exist but produce no exit reason in the trace.
  • Writing silently; the interviewer cannot score what you did not explain.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.