Skip to content

Interview question · Planning & Control Patterns

ReAct, plan-and-execute, or an explicit state graph: pick one for a refund workflow.

The question offers three options; the strong answer uses two, at different levels. The graph owns the rules and the money; a small ReAct loop does the one part nobody can script.

mediumEssentialNewUpdated Nov 2026

TL;DR: An explicit state graph for the process, because refunds have rules that must hold every time (verify the order, check eligibility and limits, get approval above a threshold, refund once) and an auditor will ask how each refund was decided. Inside one node, the dispute investigation, a bounded read-only ReAct loop, because the path through order history, delivery records and messages is not known in advance. Plan-and-execute adds little here: the process is already known, so there is nothing for a planner to decide.

How to approach it

Ask what the workflow must guarantee (money moves only under policy, every decision explainable) and where the uncertainty is (most refunds are routine; disputes need investigation). Choose by matching each pattern to the part of the problem it fits, and say why the others lose.

A strong answer

What the workflow needs.

NeedImplication
Verify before refunding, every timeA rule, not a suggestion: structure
Limits and approvals by amount and customer historyGuards in code
Idempotent refund, exactly onceA single refund node with a key
Investigate unclear disputes across several systemsOpen-ended reads: model-driven
Explain each decision to the customer and to auditA transition log with reasons

The design. Intake → verify order (code) → classify (model chooses "clear" or "unclear") → investigate (ReAct, read-only tools, eight steps at most) → policy guard (code) → human approval above ₹5,000 → refund (idempotent) or close with a reason. The model's freedom is real but placed: it decides how to investigate and how to classify, never whether to verify or whether a refund is within policy.

Why not ReAct alone. It would work in demos. But "verify before refunding" becomes an instruction followed most of the time, refunds become reachable on paths nobody tested, and the audit trail is a transcript rather than a list of decisions. Every run is a new path.

Why not plan-and-execute. A planner earns its cost when the steps are unknown until the request is read. Here the steps are the company's process, known in advance; letting a model rewrite them per request adds a call and a way to drop a step.

Where each pattern sits.

pattern              where it is used                 why
state graph          the whole process                rules, approvals, audit, recovery
ReAct                inside "investigate"             unknown path, read-only data
plan-and-execute     not used                         the process is already the plan

What interviewers probe next

"Investigation finds the courier's proof of delivery is a forgery. What happens?" The investigate node returns findings, not decisions. The graph routes "fraud suspected" to a human queue, an edge added for that case, rather than letting the model act on it.

"Ninety percent of refunds are routine. Does every one go through the model?" Only through classify, which can be cheap; routine cases skip investigation entirely. Many teams make classify a rules check first and call the model only when the rules are unsure.

"How do you test it?" Guards with table tests, routed nodes with labelled examples, the investigation node with recorded disputes and expected findings, and an enumeration of graph paths to confirm none reaches refund without verify and policy.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

Refunds run as a state graph with a ReAct investigation node.

  1. Start here

    What if the business adds partial refunds and store credit as outcomes?

How it's scored

Weak: Picks one pattern by preference ("ReAct is the standard") without mapping it to the workflow's needs.

Hire: Chooses a state graph for the rules and explains why free-running ReAct is risky for money.

Strong Hire: Combines a graph for the process with bounded ReAct inside the open-ended node, explains why plan-and-execute adds nothing, places guards, approval and idempotency, and describes testing and audit.

Common mistakes

  • Treating the three as exclusive choices.
  • Enforcing "verify first" with a prompt instruction.
  • Letting the investigation node also decide the refund.
  • Adding a planner to a process the business has already defined.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 6, and the site remembers where you stopped in each one.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in raises your free answers from 5 to 6 per topic, adds an applied lesson in every topic and easy practice tests, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

Nobody has commented. Post a correction or another way to answer.