Agentic AI Practice
7 questions: compounding errors, tool overload, durable runs, pass^k, trifecta.
How to use this page
Question 1 · Easy · agent vs workflow
Your team wants to build an 'agent' that classifies incoming support emails into 12 categories and routes them. Is an agent the right design?
Say your approach out loud first.
Answer: no: it's a fixed workflow (classify → route); use a classifier or a single LLM call with structured output
- The path doesn't depend on intermediate results; there's one decision with a fixed set of outcomes.
- A single structured-output call (or a fine-tuned small classifier) is cheaper, faster, easier to test and evaluate.
- Reserve agent loops for parts that need investigation with tools, like resolving the routed ticket.
Follow-up: What would make it agentic? If handling required looking things up and deciding next steps based on what was found.
Question 2 · Easy · compounding
Each step of your agent succeeds 98% of the time. Roughly what is the success rate of a 30-step task, and what are two ways to improve it?
Say your approach out loud first.
Answer: about 0.98³⁰ ≈ 55%; shorten the task and add error detection and recovery
- 0.98^30 = e^(30·ln 0.98) ≈ e^(−0.606) ≈ 0.55.
- Shorten: move deterministic steps into code or tools, so the model makes fewer decisions.
- Detect and recover: validate tool arguments and results, retry failed steps, verify with checks; per-step reliability compounds.
Follow-up: What if errors are correlated (a wrong plan early)? Independent retries help less; add checkpoints that re-plan and human escalation.
Question 3 · Medium · tools
Your agent has 120 tools from several MCP servers and often picks the wrong one. Give three fixes.
Say your approach out loud first.
Answer: load fewer tools per step (tool search / grouping), make tools distinct and well-described, and evaluate tool selection
- Retrieve only the relevant tools for the current task (tool search, RAG over tool descriptions), or route to sub-agents with smaller toolsets; RAG-MCP raised selection accuracy from 13.6% to 43.1% this way.
- Merge overlapping tools, rename them clearly, add examples and parameter constraints (enums, IDs).
- Build a tool-selection test set and track wrong-tool and bad-argument rates per change.
Follow-up: What does each extra tool cost even when unused? Its definition (~100–300 tokens) on every call, plus distraction.
Question 4 · Medium · durable execution
A 150-step nightly agent job has a 1% transient failure rate per step and restarts from scratch on any failure. Estimate how often it finishes cleanly and what you'd change.
Say your approach out loud first.
Answer: 0.99¹⁵⁰ ≈ 22% clean runs; add per-step checkpoints, retries with backoff and idempotent tools
- Clean run probability = 0.99^150 ≈ e^(−1.51) ≈ 0.22.
- Restarting from scratch repeats most of the work (expected executions ≈ (1 − 0.99^150) / (0.01 × 0.99^150) ≈ 350 for 150 steps).
- Checkpoint after each step (≈ 152 executions), retry transient errors with backoff, and make side-effecting tools idempotent so replays are safe.
Follow-up: Which step types need idempotency keys? Anything with side effects: refunds, emails, writes to external systems.
Question 5 · Medium · evaluation
Your agent scores 70% pass@1 on 200 cases. Leadership asks, 'So 70% of customers get a correct resolution?' What do you say and measure?
Say your approach out loud first.
Answer: not necessarily: measure consistency (pass^k), end-state correctness, and cost; run each case several times
- A single run hides flakiness: some cases are solved only sometimes. Run each case k times (e.g. 5) and report pass^5 alongside pass@1.
- Make sure 'success' means the right end state (refund recorded correctly), not a plausible message.
- Report cost and latency per resolved case, and break down failures by type (tool errors, policy mistakes, escalations).
Follow-up: Why might production be worse than the eval? Distribution shift (new issues, phrasing), injected content, tool outages; monitor online resolution and escalation rates.
Question 6 · Hard · safety
A 'personal assistant' agent reads the user's email, can search their documents and can send emails. Threat-model it and propose controls.
Say your approach out loud first.
Answer: it has the lethal trifecta; an injected email can make it exfiltrate documents. Remove or gate a leg.
- Private data (documents, inbox) + untrusted content (incoming email) + external communication (send email) = exfiltration path via prompt injection.
- Controls: require user confirmation for every outbound email (with a clear preview), restrict recipients (allow-list or only replying to existing threads), block auto-rendering of external links/images.
- Architecturally: process untrusted emails in a quarantined model without tools, extract only structured fields; keep the privileged agent's plan independent of email content.
- Least-privilege scopes for document access, logging and anomaly alerts on outbound data volume.
Follow-up: Why not just tell the model to ignore instructions in emails? Injection is precisely overriding instructions; the defence must be outside the model.
Question 7 · Hard · multi-agent
An engineer proposes five parallel coding sub-agents, each editing a different file of the same feature, to finish faster. What are the risks and what would you suggest?
Say your approach out loud first.
Answer: tightly coupled edits by agents with partial context will conflict; prefer one agent owning the change, with sub-agents for read-only exploration
- Each sub-agent makes assumptions (interfaces, names, data formats) the others can't see; merging produces inconsistencies (Cognition's 'share context' principle).
- Multi-agent works best for independent, read-heavy work (research, search, analysis), as in Anthropic's research system.
- Suggest: a single agent writes the change; parallel sub-agents may explore the codebase, run tests or review, returning summaries; or define interfaces first and only then parallelise.
Follow-up: How would you measure whether the multi-agent version is better? Same task set, compare end-state success (tests pass), pass^k, wall-clock time and total tokens.
More practice and sources
7 interview questions, easy to hard · answers hidden until you click · checked 29 Oct 2026
Uses the lessons in this track: What Is an Agent, Tool Calling, Agent Infrastructure, Evaluating Agents, Agent Safety, Multi-Agent Systems. New questions are added over time.