Prompt & Context Engineering·Question 18 of 68Intermediate

Describe the ReAct pattern. How does it relate to modern native tool calling?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

ReAct (Yao et al., 2022 - "Reasoning and Acting") interleaves three moves in a loop: Thought (free-text reasoning about what to do next), Action (a tool invocation, e.g. a search query), and Observation (the tool's result fed back into context), repeating until the model emits a final answer. Its contribution was showing that reasoning and acting are better interleaved than separated: reasoning-only (CoT) hallucinates facts it can't verify, and acting-only lacks the deliberation to plan, recover from dead ends, or synthesise across steps. Each Thought conditions on real observations; each Action is grounded in explicit reasoning. On knowledge tasks (HotpotQA, FEVER) it reduced hallucination versus CoT; on interactive environments (ALFWorld, WebShop) it beat imitation-based baselines.

Full worked answer with diagram

ReAct (Yao et al., 2022 - "Reasoning and Acting") interleaves three moves in a loop: Thought (free-text reasoning about what to do next), Action (a tool invocation, e.g. a search query), and Observation (the tool's result fed back into context), repeating until the model emits a final answer. Its contribution was showing that reasoning and acting are better interleaved than separated: reasoning-only (CoT) hallucinates facts it can't verify, and acting-only lacks the deliberation to plan, recover from dead ends, or synthesise across steps. Each Thought conditions on real observations; each Action is grounded in explicit reasoning. On knowledge tasks (HotpotQA, FEVER) it reduced hallucination versus CoT; on interactive environments (ALFWorld, WebShop) it beat imitation-based baselines.

Original implementation detail worth knowing: it was pure prompting - few-shot exemplars of Thought/Action/Observation traces, with the runtime parsing the model's text to extract actions and stopping generation at the Observation marker. That parsing was the fragile part: malformed actions, invented tool names, format drift.

Relation to modern tool calling: native function calling (OpenAI tools, Anthropic tool use, MCP-served tools) is ReAct with the structure enforced by the API and training rather than by regex. The model emits a typed, schema-validated tool call; the runtime executes it and returns a structured result message; the loop continues. The "Thought" step became either the visible text preceding a tool call or the internal reasoning of thinking models - some APIs support explicit reasoning/thinking blocks interleaved with tool use, which is ReAct's Thought step productised. Models are now RL-trained on multi-step tool-use trajectories, so the pattern is a trained capability, not a prompt trick.

What survives of ReAct in 2026 engineering: the loop architecture of every agent framework; the insight that observations must return into context for iterative reasoning; and its failure modes - looping on a failing action, context bloat from accumulated observations - which is exactly what context engineering (truncating observations, compaction) addresses.

Worth sketching. Most candidates draw the loop and forget the exits, so putting both stop conditions on the board is the differentiator.

flowchart LR
    A["Thought"] --> B["Action:<br/>schema-validated tool call"]
    B --> C["Observation<br/>appended to context"]
    C --> D{"Answer ready?"}
    D -->|"no"| A
    D -->|"yes"| E["Final answer"]
    C --> F{"Same error twice,<br/>or step budget spent?"}
    F -->|"yes"| G["Stop and report<br/>what was tried"]

What a good answer covers

  • ReAct (Yao et al., 2022 - "Reasoning and Acting") interleaves three moves in a loop
  • Its contribution was showing that reasoning and acting are better interleaved than separated
  • Each Thought conditions on real observations; each Action is grounded in explicit reasoning
  • On knowledge tasks (HotpotQA, FEVER) it reduced hallucination versus CoT; on interactive environments…
  • Original implementation detail worth knowing

Key terms: Thought · Action · Observation

Interviewer follow-ups to expect

  1. How do you stop a ReAct-style agent that keeps retrying a failing tool?

  2. Why does interleaving beat plan-everything-then-execute - and when does plan-first win?

  3. What does the Observation step imply for how you design tool output formats?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep