Entry

What is an AI agent, and how is it different from a chain?

How to answer it in an AI engineer interview: what is being tested, a step-by-step framework, a sample answer and the mistakes to avoid.

$19.99 on Gumroad, instant download40% off with code EARLYBF until Nov 3, 11:59 PM PTEARLYBF: 40% off until Nov 3

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Practiced one out loud? Paste your answer into the free self-check and get a score in 30 seconds

What the interviewer is testing

Whether you can define an agent precisely (a model choosing the next action in a loop), say when not to use one, and show you know what it takes to run one safely.

Answer framework

  1. Define a chain: a fixed sequence of steps defined by the developer.
  2. Define an agent: a loop where the model chooses the next action (which tool, with what arguments) based on observations, until it decides the task is done.
  3. Name the pattern: ReAct alternates reasoning, a tool call and reading the observation.
  4. Give the decision rule: if you can draw the flowchart, build a workflow; use an agent when the path depends on intermediate results you cannot enumerate.
  5. Show production awareness: step limits, timeouts, budgets, argument validation, human approval for irreversible actions, full traces, task-success evaluation.

Sample answer

A chain is a fixed sequence of steps defined by the developer. An agent is a loop where the model chooses the next action, which tool to call and with what arguments, based on observations, until it decides the task is done. ReAct is the common pattern: the model alternates between a reasoning step, a tool call and reading the observation.

Agents handle open-ended tasks but are less predictable. If I can draw the flowchart, I build a workflow with model calls inside, because it is cheaper, testable and predictable. Many good systems are workflows with one agentic step.

In production I bound agents with max steps, timeouts and a budget per task, validate every tool argument, retry transient errors with backoff, checkpoint state, require human approval for irreversible actions and log full traces. I evaluate them on task success over a fixed suite of realistic tasks, plus step count, cost and latency, and I inspect trajectories, not only outcomes.

Likely follow-ups

Explain the ReAct pattern. Reason + Act: the model alternates between a reasoning step, a tool call and reading the observation until it can answer. In production add step limits, structured tool calls and error handling for failed tools.
Workflows vs agents: how do you decide? If you can draw the flowchart, build a workflow. Use an agent when the path depends on intermediate results you cannot enumerate.

Common mistakes

The PlaybookWant the full method?

The 0 to 1 AI Engineer Interview Playbook covers the answer frameworks, system-design walkthroughs and an 8-week plan.

Get the playbook 40% off with code EARLYBF until Nov 3, 11:59 PM PTEARLYBF: 40% off until Nov 3

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Interviewing for PM or TPM? See the full PM package, $59 on Gumroad: a resume system, a PM, TPM and PGM interview handbook, a 1:1 cheat sheet and a PM playbook. PM and TPM content, not AI engineer prep.

Related questions

Based on question #41, #42, #52, #45, #49 in the full question bank.