Skip to content

Lesson 1 of 3 · 3 min read

What the Live Build Round Tests

Free lessonReviewed By the AIAgentInterviews editorial team
Reading position
In this lesson

TL;DR: The round is less about clever code than about judgement under time. Get a minimal end-to-end loop running in the first fifteen minutes, add the controls the prompt is really about (validation, budgets, error results, idempotency), drive it with a scripted fake model so tests are deterministic, cover the failure paths the interviewer will ask about, and say what you are doing and why as you go. Know the skeleton by heart so the clock goes to the interesting part.

After this lesson, you should be able to describe what interviewers look for in an agent build round, write the core loop skeleton quickly, plan the time, and test with a scripted model.

Before you read

Commit to an answer now. The lesson that follows explains it, and having guessed first, even wrongly, makes the explanation easier to remember.

  1. 1With 45 minutes to 'build an agent loop that calls tools', a candidate spends 25 minutes on a nice tool-registration decorator and has no loop running. What should the first fifteen minutes have produced instead?

What is being assessed

SignalWhat it looks like
Working skeleton earlyEnd-to-end path running before refinements
Controls firstValidation, step budget, error results, stop conditions before features
Failure pathsUnknown tools, bad arguments, tool exceptions, budget exhaustion handled on purpose
TestabilityA scripted fake model; deterministic tests on behaviour, not output text
StructureSmall functions, clear names, state you can inspect
CommunicationSaying what you are building next and why; naming trade-offs

The skeleton

import json

class ScriptedModel:
    def __init__(self, replies):
        self.replies = iter(replies)
    def __call__(self, messages, tools):
        return next(self.replies)

def run(model, tools, task, max_steps=6):
    messages = [{"role": "user", "content": task}]
    for step in range(max_steps):
        reply = model(messages, list(tools))
        if reply["type"] == "final":
            return {"answer": reply["text"], "steps": step, "exit": "final"}
        name, args = reply["tool"], reply["args"]
        if name not in tools:
            result = {"error": "unknown_tool", "retryable": False}
        else:
            try:
                result = {"ok": tools[name](**args)}
            except (TypeError, ValueError) as e:
                result = {"error": "bad_arguments", "message": str(e),
                          "retryable": True}
        messages.append({"role": "tool", "name": name, "content": json.dumps(result)})
    return {"answer": None, "steps": max_steps, "exit": "budget"}

model = ScriptedModel([{"type": "tool", "tool": "weather", "args": {"city": "Pune"}},
                       {"type": "final", "text": "It is 19°C in Pune."}])
out = run(model, {"weather": lambda city: {"temp_c": 19}}, "Weather in Pune?")
print(out["exit"], out["steps"])  # => final 1

About thirty lines: a scripted model, a loop with a step budget, an unknown-tool path, argument errors returned as observations, and a named exit. Practise writing it in under ten minutes.

Plan the time

MinutesWork
0 to 5Restate the task, ask about interfaces, say the plan
5 to 15Skeleton running with one test
15 to 35The prompt's core (the part that is actually being tested)
35 to 45Failure-path tests, cleanup, what you would add with more time
FORTY-FIVE MINUTES
Where the clock goes in a build round

A running skeleton by minute fifteen leaves the middle of the round for the part being tested.

What the interviewer sees

Restates the task

asks about interfaces, says the plan out loud

Loop runs end to end

against a scripted model, with one test

Validation, budgets, error results

the controls the prompt is about

Tests for what breaks

and what would come next with more time

Say it in 30 seconds

"Build rounds test judgement under time: a working skeleton early, controls before features, failure paths handled on purpose, deterministic tests with a scripted model, clean structure and narration. I know the thirty-line loop skeleton by heart, get it running with a test in the first fifteen minutes, spend the middle on the part the prompt is really about, and finish with failure-path tests and what I would add next."

Check yourself

Answer aloud or on paper before revealing. Producing the explanation unaided is exactly what a panel listens for.

  1. 1Why use a scripted fake model in a live round instead of a real API?

  2. 2What should the loop return when the step budget runs out?

  3. 3What belongs in the last ten minutes of a 45-minute round?

Practise it as an interviewer asks it

Course lessons that teach this

Related lessons