Agents & Tools Interview Prep

Course Content

Agents & Tools Interview Prep

6 sections · 40 lessons

How do planning and feedback loops improve task execution?


One tool result, five possible movesTool result503 timeout —executor retriesBad date — model fixes argsWaitlist 48 —replan the routePermission denied — escalateSame failure twice — stop
The decision is only as good as the signal, so a tool that returns an empty list on error breaks the whole loop.

What you need to know

The loop

  1. Plan — list steps and dependencies.
  2. Execute — run the next step (often a tool call).
  3. Observe — read the tool result and check it against expectations.
  4. Decide — continue, retry, replan, or escalate.
  5. Repeat — until done or a budget is hit.

Mapping signals to decisions

Signal from the toolLikely causeDecision
Timeout, HTTP 503TemporaryRetry with backoff (executor, max 2)
Validation error ("date must be YYYY-MM-DD")Bad argumentsModel fixes arguments and retries
Empty result ("no hotels found")Plan assumption wrongReplan the remaining steps
Permission deniedOut of scopeEscalate or tell the user
Same failure twiceStuckStop; report what is known

The table is why tool results must be informative. A tool that returns [] for both "nothing matched" and "API is down" makes correct feedback impossible.

Limits that keep it bounded

  • Max retries per step (e.g. 2).
  • Max replans per run (e.g. 2).
  • A global step and cost budget.
  • A rule: the same failing action twice ends the run.

A real-life example

A travel agent plans a weekend trip for a family of four from Hyderabad to Coorg:

  1. Search trains to Mysuru. 2. Search a cab from Mysuru to Coorg. 3. Search homestays in Coorg. 4. Build the itinerary.

Feedback 1: the train search returns "Waitlist 48" for every train. Expected: confirmed seats. The agent replans: search flights to Mangaluru instead, with a cab from there. One replan.

Feedback 2: the homestay API returns HTTP 503. The executor retries after 2 seconds; it succeeds.

Feedback 3: the homestay search returns places with 3 rooms but the user profile says the grandparents need a ground-floor room. The validator flags it, and the agent re-queries with ground_floor=true.

The run finishes in 9 tool calls. Without feedback, the agent would have produced an itinerary built on waitlisted train tickets.

Follow-up questions to expect

  • "Who decides between retry and replan?" — The executor handles transient errors automatically; the model decides on logical failures, guided by clear error messages.
  • "How is this different from ReAct?" — ReAct re-decides after every step with no explicit plan; plan-plus-feedback keeps a plan and changes it only when signals say so.
  • "What if the user changes their mind mid-run?" — Treat it as the strongest feedback signal: replan from the current state.