Agents, Tool Use & MCP
One of the most heavily tested AI engineering topics of 2025-2026. Every frontier lab, big tech AI team, and agent startup asks about it, and it dominates system-design rounds for AI engineer, GenAI engineer, and LLM platform roles.
Card 1 of 17
Workflows vs agents
Anthropic's framing (from Building Effective Agents) is the standard interview vocabulary. Workflows orchestrate LLMs and tools through predefined code paths - prompt chaining, routing, parallelisation, orchestrator-workers, evaluator-optimizer. Agents let the LLM dynamically direct its own process: it decides which tools to call, in what order, and when it's done. Agency is a dial, not a binary. Every notch toward agency buys flexibility and costs predictability, latency, money, and evaluability.
The most important design rule: if you can draw the flowchart, write the workflow. Reach for an agent only when the number of steps and the branching genuinely can't be enumerated up front ("fix this failing test", "research this company"), and the value of solving it exceeds the cost of the loop.
All 90 Agents, Tool Use & MCP questions
Basic
- What's the difference between a workflow and an agent?
- When should you NOT build an agent?
- Walk me through the core agent loop. What are the components and stop conditions?
- How does function/tool calling actually work mechanically, end to end?
- A teammate says "the model executes the tool." What's wrong with that, and why does the distinction matter?
- Explain parallel tool calls and tool-choice forcing. When would you use each?
- What is MCP and what problem does it solve?
- Describe MCP's architecture and its primitives.
- What is ReAct, and how relevant is it in 2026?
- What makes a good tool definition? Give concrete design rules.
- Why do we need MCP at all? Why not just hand the model an OpenAPI spec and let it call REST endpoints?
- You're designing an MCP server. How do you decide whether something should be a tool, a resource, or a prompt?
- When should you use a reasoning model inside an agent loop, and when is it a waste of money?
- Your agent charged a customer's card twice. The trace shows one tool call. What happened, and how do you prevent it?
- What does strict mode on a tool schema guarantee, and what does it leave to you?
Intermediate
- How should tool errors be surfaced to the model?
- Consolidated vs granular tools - how do you decide?
- How do you make tool outputs token-efficient, and why does it matter so much for agents?
- Your agent's context window fills up mid-task. What are your options?
- Distinguish working memory from persistent memory in agent design.
- Compare plan-then-execute with reactive (ReAct-style) execution. When does each win?
- When do reflection / self-critique loops actually help, and what do they cost?
- Explain the orchestrator-worker / subagent pattern. What's the real benefit?
- When does multi-agent beat single-agent, and when does it make things worse?
- What are handoffs in multi-agent systems, and how do they differ from orchestration?
- Compare MCP's transports. When would you choose each?
- What are the security risks of connecting a third-party MCP server, and how do you mitigate them?
- How do you evaluate an agent? Compare trajectory evals and final-outcome evals.
- Explain pass@k vs pass^k. Why does the distinction matter for production agents?
- What guardrails does a production agent loop need?
- You've connected six MCP servers. There are now 130 tool definitions and ~45k tokens of schema in context before the user says a word. What do you do?
- Your agent needs to remember things across sessions. Would you use a vector store or rolling summarisation? Defend the choice.
- Your agent's prompt cache hit rate is 20% when you expected 90%. Walk me through the debugging.
- How do you test an agent in CI? Not evals - CI, on every pull request, in under five minutes.
- You're splitting a research agent into an orchestrator and subagents. Design the interface: what exactly crosses the boundary in each direction?
- Design the human approval flow for an agent that files expense reports. Where do the gates go, and how do you stop people from clicking through them?
- What are MCP's sampling and elicitation primitives for, and why does hardly anyone use them?
- Your agent platform's bill jumped from $8k to $40k in a month. Nobody knows why. How do you find out, and how do you make sure this never happens blind again?
- What are Agent Skills, and when do you package knowledge as a skill rather than a tool, an MCP server, or retrieval?
- What are MCP Apps, and what do they change about an MCP server's security model?
- The user hits Stop while your agent is in the middle of a tool call. What should happen, and how do you design streaming and cancellation for an agent UI?
- Your provider now offers server-side compaction and stateful message threads. When would you use them instead of managing context yourself, and what do you give up in portability, auditability and the ability to switch models?
Advanced
- Walk me through the compounding-error math for agents, and what it implies for design.
- How does prompt injection work against agents via tool results, and what actually mitigates it?
- What is the "lethal trifecta," and how do you design agent systems around it?
- How do you sandbox a code-executing agent?
- Why are computer-use / browser agents so much harder to make reliable than API-based agents?
- How do you build agents that survive long-horizon tasks - hours or days of execution?
- How do you engineer an agent for cost and latency without wrecking quality?
- What does good observability look like for an agent system?
- Your agent gets stuck in loops or gives up too early. Diagnose and fix both.
- What is tool-call hallucination, and how do you defend against it?
- What is context pollution in agents, and how do you deal with it?
- Should you build your agent on a framework or roll the loop yourself? Defend a position.
- A customer reports the agent did something wrong three days ago. You have the trace. Can you reproduce it? How do you build a system where the answer is yes?
- You're building a multi-tenant agent platform. Tenants bring their own MCP servers and their own data. What isolates them?
- You want to change your agent's system prompt. How do you ship it without finding out from customers that you broke something?
- Define SLOs for a customer support agent. Every span returns 200 and latency is fine. What do you actually alert on?
- Your agent handles multi-turn conversations where users change their minds. Static test cases can't cover that. Build me an evaluation environment.
- Design the memory and personalisation layer for an assistant serving millions of users. What do you store, when do you summarise versus retrieve, and how do you evaluate memory quality?
- MCP connects an agent to tools. What does A2A solve that MCP does not, and how do the two compose?
- You're exposing one of your agents to another company's agent. What crosses the boundary, and what do you refuse to expose?
- Instead of exposing 130 tools as function definitions, you expose them as a code API the agent writes scripts against. Walk me through the tradeoffs.
- Your agent solves the same class of task 500 times a week and never gets better at it. How would you make it learn, without fine-tuning?
- How does authorisation work for a remote MCP server, and what do teams get wrong when they implement it?
- A tool call takes twenty minutes, or needs the user's answer halfway through. How do you model that over MCP now that the protocol is stateless?
- Your long-running agent compacts its context into summaries. How can a compaction summary become a prompt-injection channel, including one the model writes itself, and how do you detect and contain it?
- A partner's MCP server offers your agent a code-review skill. Walk me through how the host discovers, verifies and loads it under the Skills over MCP extension, and what stops the server swapping the instructions after a user has approved them.
- Your users approve 93% of the agent's permission prompts. Design an auto mode that replaces prompts with a classifier. What runs without review, what does the classifier get to see, can you trust MCP tool annotations like readOnlyHint, and what miss rate would you accept?
- Design an always-on agent that wakes on a schedule or an event, with no user present, and runs until it meets its success criteria or runs out of budget. What identity does it act as, how do you define done, what stops it acting on a stale or poisoned trigger, and how does a human find out what it did overnight?
- A new model generation ships. Which parts of your agent harness, such as planning prompts, step caps, tool restrictions, context resets and retry wrappers, do you expect to delete or loosen, and how do you prove on real customer workloads that removing them does not regress anything? How do you tell a harness change from a model change in your evals?
Quick-fire
- What makes something an agent rather than a single LLM call, and when do you actually need one?
- Explain the ReAct pattern.
- How does function calling / tool use work under the hood?
- What is the Model Context Protocol (MCP) and why does it matter?
- How do you keep an agent from looping forever or running up cost?
- What is agent memory, and what types are there?
- When is a multi-agent system worth it over a single agent, and what are the risks?
- What is the difference between a workflow and an agent, and why prefer workflows when you can?
- How do you evaluate an agent, and why is average accuracy not enough?
- How would you design tools for an agent so it uses them reliably?
- What is the difference between planning-first and reactive (ReAct-style) agents?
- What is reflection or self-critique in an agent, and when does it actually help?
- How do you manage context in a long-horizon agent that runs for many steps?
- What is the orchestrator-worker (sub-agent) pattern, and how do sub-agents communicate?
- What is A2A (agent-to-agent) communication, and how does it relate to MCP?
- Why do agents fail on long tasks even when each step is likely to succeed?
- How do you decide how much autonomy to give an agent (the agency-control tradeoff)?
- How does an agentic coding harness (like a coding agent) work, and what makes it reliable?
- How do you handle handoff from an agent to a human?