Anthropic Agent Coding Interview

The “Agents / Coding with LLMs” round, from real candidate reports

This is the round almost no prep site covers: you write code that uses the Anthropic API as a building block, designing prompts and a tool-use loop to build an agent. Below is what it actually is, the reported task, the format, and how to prepare — reconstructed from real candidate reports, not a job description.

Key facts

  • ~55-minute coding round over Google Meet, screen-share, in a Colab notebook — open-book on docs.
  • Tests building a Claude agent loop with tool use: the recruiter brief says it evaluates "writing code with LLMs as a building block, and prompting to create an agent."
  • Reported task: extend a single-tool-call stock-price agent into a loop that handles multi-step, multi-tool questions.
  • Three-part scored variant: fix the bugs → answer all questions in 2 turns → compress to 1 turn.
  • Appears in SWE phone screens and on the research track (Research Engineer / Research Scientist / Fellowship).
  • Reconstructed from real candidate reports · refreshed monthly · last updated August 2026.

What this round is

Anthropic’s recruiter brief for this interview is explicit: “This interview will test writing code with LLMs as a building block, and prompting to create an agent. You should be conceptually familiar with Tool Use and Agent Loops and how they are handled in our API. The interview is open-book and we provide starter code for using the API, so there’s no need to memorize exact API syntax.”

In plain terms: it is not a LeetCode round. You get a working starter cell that wraps the Messages API and a tool-use schema, and your job is to build the agent looparound it — parse the model’s response, dispatch its tool_use calls to your code, feed tool_result blocks back, and iterate until the model is done.

Two variants candidates report

Most reported
Build an agent

You write a Claude agent loop that uses tools to solve a multi-step problem. This is the distinctive Anthropic flavor and the focus of this guide.

Emerging
Code with an AI tool

A newer rotation reframes the round as coding WITH an assistant (e.g. the Claude Code CLI in a hosted VS Code-like environment) — graded on how well you delegate, verify, and review AI-written code. Reported externally / industry-wide; not yet confirmed in an Anthropic-specific candidate report here.

The reported task: a stock-price agent

The most concrete instance candidates describe is a stock-price agent. The starter code answers questions that need only a single tool call; you extend it into an agent loop that handles questions requiring multi-step reasoning or multiple tool calls. A second part asks you to reduce the number of turns the agent needs — part prompt engineering, part loop structuring.

A closely related three-part variant scores the progression explicitly, and this is the shape most recent reports describe:

  1. Repair the supplied bugs until the agent works.
  2. Make it answer the full question set within two turns.
  3. Compress the workflow to one turn.

One candidate who completed all three parts in 55 minutes noted the interview version felt like the published one “with a slight variation” — so drilling the exact loop, not memorizing one answer, is what pays off.

Format & logistics

  • ~55 minutes, over Google Meet with screen-share, typically in a Colab notebook.
  • Starter cell wraps the Messages API and the tool-use schema — no need to memorize syntax.
  • Open-book on documentation; the interviewer watches how you iterate on prompts and structure the loop.
  • Appears in SWE phone screens (portal may show only “coding interview”, no question number) and on the research track (RE / RS / Fellowship).
  • The coding round is team-dependent — some candidates get a concurrency/systems prompt instead. Confirm the flavor with your recruiter.

How to prepare

  • Run through Anthropic’s public tool-use documentation once, end to end: define a tool, route tool_use turns back to your code, return tool_result blocks, and loop until end_turn.
  • Practice writing an agent loop from a blank notebook in under 20 minutes.
  • Keep a mental template for the prompt: role description, tool-catalog summary, output contract, exit condition — so you can refactor mid-round when the interviewer pushes on turn count or robustness.
ProInside the full breakdown

The part you actually get graded on

  • 🔒A runnable reference agent loop, walked through step by step — parse the response, dispatch tool_use to your code, return tool_result, loop until end_turn. Run it, modify it, see the multi-tool-call flow.
  • 🔒How to collapse the workflow from two turns to one — the prompt-structuring and parallel-tool-use moves, grounded in Anthropic’s tool-use docs.
  • 🔒A 20-minute drill template so you can build the loop from a blank notebook under time pressure.

Related

FAQ

What is the Anthropic 'Agents / Coding with LLMs' interview?
A ~55-minute coding round where you write code that uses an LLM (the Anthropic API) as a building block — designing prompts and a tool-use loop to build an agent that solves a multi-step problem. Anthropic's recruiter brief states it tests "writing code with LLMs as a building block, and prompting to create an agent," and expects you to be conceptually familiar with Tool Use and Agent Loops in their API. It is open-book on documentation, with starter code provided so you don't memorize API syntax.
What is the actual task in the Anthropic agent-coding round?
The most-reported task is a stock-price agent: you're given starter code that answers questions needing a single tool call, and you extend it into an agent loop that handles questions requiring multi-step reasoning / multiple tool calls. A closely related three-part variant scores you explicitly: (1) fix the supplied bugs so the agent works, (2) make it answer all questions within two turns, (3) compress the workflow to one turn.
How long is it and what environment is used?
About 55 minutes over Google Meet with screen-share, typically in a Colab notebook. A starter cell wraps the Messages API and the tool-use schema. It is open-book on docs; the interviewer watches how you iterate on prompts and structure the loop.
Who gets the agent-coding round at Anthropic?
It shows up in standard SWE phone screens (the portal may list only "coding interview" with no question number) and on the research-adjacent track (Research Engineer / Research Scientist / Fellowship). The coding round is team-dependent — some candidates get a concurrency/systems prompt instead — so confirm with your recruiter which flavor you'll get.
How do I prepare for the Anthropic agent-coding interview?
Run through Anthropic's public tool-use documentation end to end at least once: define a tool, route the assistant's tool_use turns back to your code, return tool_result blocks, and loop until end_turn. Practice writing an agent loop from a blank notebook in under 20 minutes, and have a mental template for prompt structure (role, tool catalog, output contract, exit condition) so you can cut turns when the interviewer pushes on efficiency.
Is the Anthropic agent-coding interview hard?
Candidates describe it as unusual rather than algorithmically hard — it doesn't test data-structure tricks, it tests whether you can build and control an agent loop and reason about tool use. The difficulty is that it's unfamiliar: most prep sites don't cover it, the grading criteria are not clearly telegraphed, and the later parts (answering in two turns, then one) require deliberate prompt and loop structuring, not just a working loop.
What is the difference between 'building an agent' and 'coding with AI' at Anthropic?
They are two different rounds people conflate. Building an agent (the round this page covers) means you write the agent loop and tool-use code yourself, using the Anthropic API as a building block. Coding with AI means you use an AI assistant (for example the Claude Code CLI in a hosted editor) to build or review a codebase, and you're graded on how well you direct, verify, and review the AI's output. The build-an-agent flavor is the one confirmed across Anthropic candidate reports; the code-with-AI flavor is an emerging, industry-wide pattern.
Does Anthropic let you use Claude Code in the interview?
In the build-an-agent round, no — you write the agent loop yourself; it's open-book on documentation but you are not driving an AI assistant to write the code. There is a separate, emerging 'code with AI' rotation where using an assistant like the Claude Code CLI is the point of the exercise, but that variant is not yet confirmed in an Anthropic-specific candidate report. Confirm the format with your recruiter.

Reconstructed from real Anthropic candidate reports. The recruiter brief, the stock-price task, the three-part scoring, and the 55-minute Colab format are all corroborated across multiple reports. The “code with an AI tool” variant reflects an industry-wide pattern and is labelled as emerging; it is not yet confirmed in an Anthropic-specific report. Refreshed monthly. Spot something off? Email support@aceoffer.app.