πHow Agentic AI Interviews Work
Interviews for AI engineer roles that involve agents usually have four parts: LLM and RAG fundamentals, agent design questions like the ones below, a coding round where you build a small tool-using agent, and an agent system design round. Interviewers care much more about how you make agents reliable, safe and measurable than about which framework you used. Revise the fundamentals with our Generative AI interview questions first.
πFundamentals
What is an AI agent?
An AI agent is a system in which a language model pursues a goal over multiple steps: it decides what to do next, calls tools to act or gather information, observes the results and repeats until the goal is met or a stop condition is reached. The software around the model, meaning tools, state, limits, logging and evaluation, is what makes it an agent rather than a chatbot.How is agentic AI different from generative AI?
Generative AI produces a single output for a single request. Agentic AI wraps generative models in a control loop with tools, memory and decision making so the system can complete multi-step tasks and take actions in other systems. A fuller comparison is in Generative AI vs Agentic AI.What is the agent loop?
The core cycle is observe, think, act: the model sees the goal and the current context, decides on an action such as a tool call, the runtime executes it, and the result is added to the context for the next step. The loop ends on a final answer, a step or budget limit, an error or a request for human input.What is the ReAct pattern?
ReAct interleaves reasoning and acting: the model reasons about what it needs, takes an action with a tool, observes the result and reasons again. It made tool-using agents practical and is the basis of most simple single-agent designs.When should you not use an agent?
When the steps are known in advance. A fixed workflow, where code calls the model at defined points, is cheaper, faster, easier to test and more predictable. Use an agent only when the path genuinely varies with the input or with what is discovered along the way.πTools and Function Calling
How does tool calling work?
You give the model a list of tools, each with a name, description and JSON schema for its arguments. The model returns a structured request to call a tool with specific arguments; your code validates and executes it and returns the result to the model, which continues. The model never executes anything itself.What makes a good tool definition?
A clear name, a description that says when to use the tool and what it returns, a tight input schema with types and enums, compact structured output, and helpful error messages the model can recover from. Fewer, well-separated tools beat many overlapping ones.How do you handle a tool call that fails?
Validate arguments before execution, return a clear error message to the model so it can correct itself, retry transient failures with backoff in code, cap the number of retries, and escalate to a human or end gracefully when recovery is not possible.How do you make write actions safe?
Apply least privilege, make operations idempotent so retries cannot duplicate them, create pending actions that require human approval above a risk threshold, add spending and rate limits, and log every action with the user it ran for.πPlanning, Memory and State
What planning strategies do agents use?
Simple agents plan one step at a time inside the loop. More complex ones produce an explicit plan first and then execute it step by step, re-planning when a step fails or reveals new information. Hierarchical designs let a supervisor break the goal into subtasks for worker agents.What is the difference between short-term and long-term memory?
Short-term memory is the context of the current run: the messages, tool calls and results so far, often summarised when it grows long. Long-term memory persists across runs, for example user preferences or past resolutions, and is usually stored in a database or vector store and retrieved when relevant.Why do agents need checkpointing?
Long runs can fail midway because of timeouts, rate limits or crashes. Checkpointing the state after each step lets the agent resume instead of starting again, enables human approval pauses, and makes runs reproducible for debugging. LangGraph provides this out of the box.How do you stop an agent from looping forever?
Set a maximum number of steps, a token or cost budget and a wall-clock timeout, detect repeated identical tool calls, and define clear completion criteria in the instructions. When a limit is hit, return the partial result and the reason.πRAG and Context
How does RAG change in an agentic system?
Retrieval becomes a tool the agent calls when it decides it needs information, possibly several times with refined queries, instead of a single fixed retrieval before generation. This is often called agentic RAG. See the RAG guide for the underlying pipeline.What is context engineering?
Deciding exactly what goes into the model's context at each step: instructions, relevant tool definitions, retrieved documents, summarised history and the current state. Good context engineering keeps prompts short and relevant, which improves accuracy and reduces cost and latency.πMCP and Frameworks
What is MCP?
The Model Context Protocol is an open standard for exposing tools, resources and prompts to AI applications through MCP servers, so integrations can be written once and used by any MCP client. Details are in the MCP guide.MCP vs function calling?
Function calling is the model feature that lets a model request a call to a function. MCP standardises how tools are packaged, discovered and served across applications. Inside one app, direct function calling is enough; MCP pays off when tools must be shared.Compare LangGraph and CrewAI.
LangGraph models an agent as a graph of nodes and edges with explicit state, which gives fine control over branching, retries, checkpoints and human approval steps. CrewAI is higher level and role based, quick for multi-agent prototypes where agents have roles and tasks. Production teams often prefer LangGraph or provider SDKs for control. See AI agent frameworks compared.πMulti-Agent Systems
When do multiple agents beat one?
When the task splits into areas that need different tools, instructions or permissions, such as billing, technical support and refunds, and one agent with every tool becomes confused or unsafe. Otherwise a single agent with good tools is simpler and easier to debug.What is the supervisor pattern?
A supervisor agent receives the request, routes subtasks to specialist agents, collects their results and decides on the next step or final answer. It keeps specialists focused and makes permissions easier to scope.What are the risks of multi-agent systems?
Higher cost and latency, error propagation between agents, agents talking past each other in loops, and much harder debugging. Mitigate with clear handoff contracts, shared state, step limits and end-to-end tracing.πSafety and Guardrails
What is prompt injection, and how do you defend against it in agents?
Prompt injection is untrusted content, such as a web page, email or document returned by a tool, containing instructions that try to hijack the agent. Defend by separating instructions from data, treating all tool output as untrusted, enforcing permissions in code rather than in the prompt, limiting what tools can do, and requiring human approval for high-impact actions.What guardrails would you put on a customer-facing agent?
Input checks for abuse and out-of-scope requests, output checks for policy, personal data and tone, tool permission limits, spending caps, approval steps for refunds or account changes, rate limits per user and a clean handoff to a human agent.πEvaluation and Observability
How do you evaluate an agent?
Build a test set of realistic tasks with expected outcomes, then score both the final result and the trajectory: did it call the right tools with valid arguments, in a reasonable number of steps, within cost limits, without unsafe actions. Use automated checks plus LLM-as-judge, spot-checked by humans, and run the suite on every change to prompts, tools or models.What is tracing, and why does it matter?
Tracing records every step of a run: prompts, model outputs, tool calls, arguments, results, latency and cost. It is how you debug why an agent made a decision, find slow or expensive steps and build evaluation sets from real failures. Tools such as LangSmith, Langfuse or OpenTelemetry-based tracing are common.How do you control the cost of agents?
Use smaller models for routing and simple steps and larger ones only where needed, keep context lean, cache repeated results, limit steps and tokens per run, batch where possible and monitor cost per successful task, not per call.πSystem Design
Design an agent that triages production alerts.
Trigger the agent from the alerting system with the alert payload. Give it read-only tools for logs, metrics, recent deployments and runbooks via MCP servers. It gathers evidence, classifies severity, links the likely cause and posts a summary to the incident channel. Restarting services or rolling back requires human approval. Add step and cost limits, tracing for every run, and an evaluation set built from past incidents with known root causes.Design a research and reporting agent.
A planner breaks the question into sub-questions, a retrieval tool searches approved sources, a reader extracts facts with citations, and a writer drafts the report from those facts only. Store intermediate state with checkpoints, deduplicate sources, enforce a budget, and evaluate on citation accuracy, coverage of the question and factual consistency.How would you deploy an agent to production?
Package it as a service behind an API with authentication, run long tasks asynchronously with a queue and status endpoint, persist state for resumption, stream progress to users, version prompts and tools, roll out changes behind evaluation gates, and monitor success rate, latency, cost and escalations.πHow to Prepare
Build two portfolio agents end to end: a tool-using agent with an MCP server and approval steps, and a multi-step research or support agent with tracing and an evaluation set with reported scores. Be ready to explain every design decision and failure you hit. The Agentic AI roadmap gives the learning order.
πPrepare Live
Prakalpana's Agentic AI course includes mock interviews on agent design and system design, taught live online with an optional 1-on-1 track. WhatsApp or call +91 9180377502 for a free consultation.