Agents, Tool Use & MCP·Question 2 of 90Basic

When should you NOT build an agent?

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

When you can enumerate the solution path - if you can draw the flowchart, write the flowchart as code and use LLM calls only for the fuzzy steps. A deterministic workflow beats an agent on cost, latency, testability, and reliability, and those are the default winners.

Full worked answer with diagram

When you can enumerate the solution path - if you can draw the flowchart, write the flowchart as code and use LLM calls only for the fuzzy steps. A deterministic workflow beats an agent on cost, latency, testability, and reliability, and those are the default winners.

Signals an agent is the wrong tool:

  • Fixed or small step count. Extract → validate → format is three LLM calls in sequence, not a loop.
  • Enumerable branching. If there are five ticket categories, use routing: one classification call, then hand-written handlers.
  • Tight latency or cost budgets. Agent loops multiply both by the number of iterations; a 15-step loop at ~5-30s per model call is not an interactive experience.
  • High blast radius, low tolerance for variance. If a wrong action is expensive and you can't gate every action behind approval, the compounding-error math (e.g., 0.95²⁰ ≈ 36% end-to-end success) kills you.
  • You can't evaluate it. If you have no way to check trajectories or outcomes, you can't iterate; an agent you can't measure will quietly regress.

Anthropic's guidance is explicit: find the simplest solution possible, and only increase complexity when simpler solutions demonstrably fall short. Agents make sense for open-ended problems where the number of steps is unpredictable and value per task is high enough to fund the tokens - coding tasks, research, operations triage.

The strong answer also names the failure pattern behind the question: teams build agents for demo appeal, then spend months adding guardrails until the "agent" is a workflow anyway. Starting with the workflow skips those months.

Worth sketching. Drawing the gate order shows you reach for an agent last, not first.

flowchart TD
    A["New task"] --> B{"Can you draw<br/>the flowchart?"}
    B -->|"yes"| C["Write it as code,<br/>LLM only for fuzzy steps"]
    B -->|"no"| D{"Branching enumerable?"}
    D -->|"five categories"| E["Routing workflow"]
    D -->|"step count unknown"| F{"Task value funds tokens,<br/>gates and evals?"}
    F -->|"no"| G["Narrow the scope,<br/>ship the workflow"]
    F -->|"yes"| H["Agent loop"]

What a good answer covers

  • When you can enumerate the solution path - if you can draw the flowchart, write the flowchart as code…
  • A deterministic workflow beats an agent on cost, latency, testability, and reliability, and those are…
  • Fixed or small step count
  • Enumerable branching
  • Tight latency or cost budgets

Key terms: Fixed or small step count · Enumerable branching · Tight latency or cost budgets · You can't evaluate it

Interviewer follow-ups to expect

  1. A PM wants an "agent" for invoice processing with fixed extraction fields - what do you build?

  2. How would you retrofit an over-agentic system into a workflow?

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