Mid

What is the ReAct pattern for LLM agents?

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 understand the basic agent loop, why interleaving reasoning with tool results beats reasoning alone, and what controls a production loop needs.

Answer framework

  1. Define it: ReAct (reason plus act) interleaves a short reasoning step, an action such as a tool call, and an observation of the result, repeated until done.
  2. Why it helps: each step is grounded in real tool output instead of the model's memory, which reduces made-up facts.
  3. Relation to tool calling: modern APIs implement the action step as structured function calls.
  4. Controls: a step limit, a token or cost budget, a clear stop condition and error handling for failed tools.
  5. Alternatives: plan-then-execute when the steps are known up front.

Sample answer

ReAct is the loop most tool-using agents are built on. The model thinks briefly about what it needs, takes an action such as searching documentation or querying a database, reads the observation that comes back, and decides the next step. It repeats until it can answer or hits a limit.

The value is grounding. A model reasoning alone can drift into confident guesses. In ReAct, each step can be checked against real results: if the search shows the API was renamed, the next thought builds on that rather than on stale training data. The loop also makes behavior easier to debug, because the trace shows what the model tried and what it saw.

In production I implement the action step with native tool calling rather than parsing free text, and I wrap the loop with controls: a maximum number of steps, a cost budget, timeouts and retries for tools, detection of repeated identical calls, and a defined way to stop and hand off. For tasks where the steps are known in advance, I would use a plan-then-execute flow or a fixed workflow instead, since it is cheaper and more predictable.

Likely follow-ups

How do you stop a ReAct agent from looping? Cap steps and cost, detect repeated calls with the same arguments, and return a partial result or escalate when limits are hit.

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 #42 in the full question bank.