← Interview prep
Topic 0410 questionsFree

Agents & Tool-Use Questions

Ten questions on autonomy, workflows vs agents, stopping criteria, loops, resumability, tools and evaluation.

  1. Q1What makes an application agentic?show answer

    In plain words: The AI chooses its own next step based on results, using tools in a loop. It is a scale, and more freedom means more cost and risk.

    Full answer · A model decides the next action dynamically based on intermediate results, using tools and state in a loop until a stopping condition — as opposed to a single model call or a fixed pipeline. It sits on a spectrum of autonomy, and an architect should justify where on that spectrum a system needs to be, because more autonomy means more cost, latency and risk.

  2. Q2When should you use a workflow instead of an agent?show answer

    In plain words: Use a workflow when the steps are known and must be checked. Use an agent only when the path depends on what it finds.

    Full answer · When the steps are known, rules are stable and auditability matters: a deterministic workflow is cheaper, faster, easier to test and to audit. Use an agent when the path depends on information discovered during execution or on choosing among tools dynamically. The strongest production pattern is often hybrid: deterministic orchestration around bounded agentic steps, with deterministic policy gates for high-risk actions.

  3. Q3How do you design stopping criteria?show answer

    In plain words: Set clear success checks plus hard limits on steps, time and cost. Also stop if it makes no progress, and record why it stopped.

    Full answer · Combine goal-based and limit-based stops: success conditions that are checkable (required fields filled, tests passing, evidence cited), and hard limits on iterations, tokens, time, tool calls and spend that cannot be argued with by a prompt. Add no-progress detection (repeated identical calls or states), explicit failure and 'needs human' states, and record the termination reason for every run so you can analyze why runs end.

  4. Q4How do you prevent infinite tool loops?show answer

    In plain words: Cap the number of steps and tool calls, stop repeated identical calls and add a spending limit. Test it with a tool built to loop.

    Full answer · Enforce a hard max-steps and per-tool and total tool-call budgets in the control loop, detect repeated identical calls or lack of state change, bound retries by error class, apply a global spend circuit-breaker, and alert on runs that hit limits. When a budget is exceeded, return a partial result with an honest explanation rather than continuing. Test it deliberately with a tool designed to loop.

  5. Q5How do you make an agent resumable?show answer

    In plain words: Save its progress after each step, run it in the background and make actions safe to repeat. A crash then continues from the last save.

    Full answer · Persist explicit state (goal, messages, evidence, tool results, budget, status) after every step to durable storage, run the loop on a queue or workflow engine rather than inside a request, and make side effects idempotent with idempotency keys so replays don't duplicate actions. A worker that dies resumes from the last checkpoint; users get a run ID and status endpoint, and can cancel safely.

  6. Q6How do you handle a failed tool call?show answer

    In plain words: Retry short-lived errors with waiting, do not retry bad requests, and give the AI a clear error to react to. Never let a retry double an action.

    Full answer · Classify the error: transient (timeout, 429, 5xx) → bounded retries with exponential backoff and jitter, perhaps a fallback; permanent (bad arguments, auth) → don't retry, return a structured error the model can act on or escalate; policy denial → never retry, explain or escalate. Return errors as tool results so the model can adapt, validate results to catch silent empty payloads, and make sure retries can't double-execute side effects.

  7. Q7How do you design tools for an agent?show answer

    In plain words: Make small tools with clear names and strict inputs. Check permissions in code, limit result size and test whether the AI picks the right tool.

    Full answer · Narrow, composable tools around business capabilities rather than raw database access; names and descriptions that say when to use and not use each; flat, typed arguments with enums and ranges; bounded, structured results with actionable errors; idempotency for side effects; and an authorization boundary enforced in code. Tool descriptions are part of the model's decision environment, so test tool selection accuracy, not just execution.

  8. Q8Single agent or multiple agents?show answer

    In plain words: Start with one agent and measure it. Add more only for different information, different permissions or clearly better results.

    Full answer · Start with one agent plus deterministic tools and measure it. Add agents only when roles genuinely need different contexts, permissions, expertise or execution environments, or when parallelism and independent verification clearly pay off. Multi-agent systems add coordination cost, latency, token use and failure modes, so justify each agent against the single-agent baseline and keep one supervisor in charge of delegation and policy.

  9. Q9How would you evaluate an agent?show answer

    In plain words: Check the final result in the real world first, run each case several times and look at tools used, steps and cost. Add real failures as tests.

    Full answer · Evaluate outcomes first — did the end state of the world match the goal — across a labelled set of realistic tasks including edge, adversarial and policy cases, with multiple trials per case for consistency. Then evaluate trajectory properties: right tools, valid arguments, forbidden calls avoided, step and cost efficiency, termination reasons. Track cost per successful task and escalation rate, and add every production failure as a regression case.

  10. Q10What state would you store for an agent run?show answer

    In plain words: Store the goal, status, messages, tool results, plan, limits, versions and why it ended. Keep secrets out of what the AI can see.

    Full answer · Run ID, tenant and user, goal, status (planning, waiting for tool, validating, needs human, completed, failed), messages, retrieved evidence, tool calls and results with their own IDs, the plan, budgets and usage, retry counts, model and prompt versions, parent run for sub-agents, timestamps and termination reason. Keep machine state separate from conversation text, and keep secrets out of model-visible state.

Read the full lesson & do the exercise
← RAG Interview QuestionsMCP, Protocols & Multi-Agent Questions →
Agents & Tool-Use Questions — interview prep · Route To AI