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
- Define a chain: a fixed sequence of steps defined by the developer.
- 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.
- Name the pattern: ReAct alternates reasoning, a tool call and reading the observation.
- 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.
- 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
Common mistakes
- Calling any multi-step LLM pipeline an agent.
- Reaching for an agent when the steps are known and a workflow would be cheaper and testable.
- Running agents with no step limit, budget or confirmation for irreversible actions.
- Judging an agent only by its final answer; a correct answer reached through a risky tool call is still a failure.
- Trusting tool outputs, which may contain injected instructions.
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 3Smaller 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.