Articles / careerinterviewagents
AI agent interview questions, with answers that show real experience
20 AI agent interview questions on tool calling, memory, multi-agent design, evals, safety, cost and debugging, with answers and what each one tests.
A good agent interview goes past "what is an agent" and checks whether you've built one that broke and then fixed it. The questions below are the kind I'd expect for an AI engineer role that involves agents. Each has a short answer and a note on what the interviewer is checking.
Don't memorize the answers. Use them to find the gaps in your own experience, then go and build the thing you couldn't answer.
Fundamentals#
1. What makes something an agent and not just an LLM call?#
An agent runs a loop. The model decides the next step, usually a tool call. The program runs the tool and gives the result back, and this repeats until the model gives a final answer or a limit is hit. A single LLM call, or a fixed chain of calls, has its control flow decided by your code. In an agent, the model decides part of the control flow.
What they're checking: that you see agents as a design trade-off. You give up predictability to gain flexibility, so you should only build one when the steps can't be known in advance.
2. When would you not use an agent?#
When the steps are known. If the task is always "retrieve, then summarize, then format", a fixed workflow is cheaper, faster, easier to test and easier to debug. Agents are worth it when the path depends on what earlier steps return, such as investigating an issue or researching across sources.
What they're checking: judgement. Candidates who reach for an agent every time are a warning sign.
3. What is the difference between a workflow, a graph and an agent loop?#
A workflow is a fixed sequence of steps. A graph adds branches, joins and loops that your code defines, and nodes can be LLM calls or plain functions. An agent loop lets the model choose the next action each turn. Real systems often mix them: a graph whose nodes include one or two small agent loops.
What they're checking: that you can pick the least flexible design that still works.
Tool calling#
4. How does tool calling actually work?#
You send the model tool definitions: a name, a description and a JSON schema for the arguments. The model can return a structured request to call a tool with certain arguments. It does not run anything. Your code validates the arguments, runs the tool, and sends the result back as a new message. The model then continues.
What they're checking: that you know the model only proposes and your code executes. All the security follows from that.
5. The model keeps calling the wrong tool. What do you do?#
First, look at the traces to see which tools it confuses. The usual fixes, in order: - Rewrite the tool descriptions so they don't overlap. Say what each tool does not do. - Reduce the number of tools the model sees at once, for example by routing to a smaller set first. - Rename tools and arguments so they're unambiguous. - Add a few examples to the prompt. - Then measure with an eval set that checks tool choice.
What they're checking: whether you debug from traces and measure the fix, or just keep editing the prompt and hoping.
6. How do you handle a tool that fails?#
Return the error to the model as the tool result, in plain words it can act on ("no order with ID 123; IDs look like ORD-0000"), not a stack trace. Retry transient failures (timeouts, rate limits) in code with backoff before the model ever sees them. Cap the total number of steps so a failing tool can't cause an endless loop.
What they're checking: that you separate errors the model can fix from errors the infrastructure should handle.
7. How do you stop the model from passing dangerous arguments?#
Validate every argument in code against the schema and against business rules. Never pass model output directly into a shell, SQL string or file path. Give tools the narrowest permissions possible, for example a read-only database role, and keep identity-related values like user ID or recipient outside the model's control.
What they're checking: whether you treat model output as untrusted input. You should.
Memory and state#
8. What kinds of memory does an agent need?#
- Working memory: the current conversation and tool results, held in the context window.
- Session state: structured data your program keeps between turns, such as a plan, a cart or selected items.
- Long-term memory: facts kept across sessions, usually stored in a database and retrieved when relevant.
What they're checking: that "memory" means a design choice for you, not one feature you switch on.
9. The conversation gets too long for the context window. What are your options?#
Summarize older turns. Drop large tool outputs after they've been used, keeping a short note of what they showed. Move facts into structured state rather than keeping them in chat history. Retrieve old content only when it's needed. Each one loses something, so decide what must survive, such as user constraints and decisions already made.
What they're checking: that you know summarization is lossy and you've thought about what you lose.
10. How do you make an agent resumable after a crash or a human pause?#
Save the state at each step to durable storage (a checkpoint). After a crash or a pause, load the last checkpoint and continue. Frameworks like LangGraph do this with a checkpointer per thread. Make tool calls idempotent where you can, so replaying a step doesn't send an email twice.
What they're checking: production thinking. Idempotency is the detail that separates people who've shipped this from people who've read about it.
Multi-agent systems#
11. When are multiple agents better than one?#
When the tasks need different tools, permissions or prompts, when they can run in parallel, or when one agent's toolset has grown so large it picks the wrong tools. The cost is more LLM calls, more latency at the routing step, and more parts to test.
What they're checking: that you can argue both sides.
12. How do agents share information?#
Either through shared state, where each agent reads and writes defined fields in a common structure, or through messages, where an orchestrator passes outputs on. Shared state is easier to inspect. Either way, define exactly what each agent can read and write, so one agent can't overwrite another's results.
What they're checking: whether you've hit merge and overwrite bugs. Anyone who has built a parallel graph usually has.
13. What is a supervisor or router pattern, and how does it fail?#
A routing step, often an LLM call, decides which agents handle a request. It fails by choosing the wrong agent, choosing too many or returning invalid names. Validate its output against a schema with a fixed set of allowed names, retry a limited number of times, and test routing on its own with a set of labelled requests.
What they're checking: that you test the router as its own component.
Evaluation#
14. How do you evaluate an agent?#
At three levels: - Final answer: is it correct? Checked by exact match, rules or an LLM judge against a reference. - Trajectory: did it call the right tools, with the right arguments, in a sensible order? - Operational: steps, tokens, latency and cost per task.
Run it on a golden set of real tasks, more than once each, because agents aren't deterministic. Track the pass rate and the worst run, not only the average.
What they're checking: whether you go beyond checking final answers.
15. How do you trust an LLM judge?#
Calibrate it. Have humans label a sample, run the judge on the same sample and measure agreement. Use a clear rubric with specific criteria, ask for a short reason before the score, and check it for known biases such as favoring longer answers. Recheck agreement whenever you change the judge model or prompt.
What they're checking: that you treat the judge as a model that also needs testing.
Safety and human-in-the-loop#
16. Which actions need human approval?#
Anything that can't be undone, costs money, or leaves the system: sending messages, payments, deleting data, changing permissions. The agent drafts, the graph pauses, a person approves, edits or cancels, and only then does code run the action.
What they're checking: that you design the pause into the system, instead of telling the model to "ask first" and hoping it does.
17. What is prompt injection, and how do you limit it in an agent?#
Text from a tool result, such as a web page or email, contains instructions the model then follows. You can't fully prevent it with prompts. Limit the damage instead: least-privilege tools, require approval for side effects, treat retrieved content as data, keep sensitive actions out of reach of agents that read untrusted content, and log everything.
What they're checking: that you say "limit the damage", not "prevent".
Cost, latency and debugging#
18. The agent is too slow. Where do you look?#
At the trace. Count the LLM calls and how long each takes. The usual fixes: run independent steps in parallel, use a smaller model for routing and simple steps, cache repeated calls and stable prompt prefixes, stream the output, and cap the number of steps. Sequential tool calls that could run together are a common cause.
What they're checking: whether you measure before optimizing.
19. Costs doubled last week. How do you find out why?#
Log tokens, model and cost per request, tagged by feature and step. Compare this week to last. The usual causes: longer prompts or retrieved context, more steps per task, retries, a model change, or a loop that only appears on certain inputs. Fix the cause, then add an alert on cost per task.
What they're checking: that cost is something you watch continuously.
20. An agent works in testing and fails in production. How do you debug it?#
Get the trace of a failing run: the inputs, every model call, every tool call and its result. Reproduce it offline with the same inputs. Common causes are real data that looks different from test data, a tool that times out under load, a silent fallback to a stub, and a model version change. Then add the failing case to your eval set so it can't come back unnoticed.
What they're checking: whether you turn production failures into test cases.
How to use this list#
Go through the questions and mark each one: "I've done this", "I've read about this", or "I don't know". The middle group matters most, because that's where follow-up questions will catch you. Pick two of them and build something small that forces you to deal with them, such as an eval harness with trajectory checks, or a graph that pauses for approval.
One real story of your own, in the shape "this broke, this is how I found it, this is how I fixed it and checked the fix", is worth more in an interview than any of the textbook answers above.