Agentic AI Engineer interview questions
100 real questions with model answers and explanations for Middle candidates.
See a Agentic AI Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
I would use a graph when the task has required stages, bounded branches, or side effects that must be audited.
- Nodes would separate classification, account lookup, policy checks, response drafting, and escalation, with typed state passed between them.
- The LLM can still choose among allowed transitions, but retry limits and terminal states belong to deterministic orchestration.
- I would keep a free loop only for low-risk exploration where the next useful action cannot be enumerated and repeated work is cheap.
Why interviewers ask this: The interviewer checks whether the candidate can trade open-ended flexibility for explicit control based on task risk and structure.
I would treat the plan as an untrusted request for authority, not as a credential carrier.
- The planner receives read-only capability metadata and redacted resource descriptors, then emits a typed DAG whose nodes request specific operations and argument bounds.
- A trusted compiler intersects each request with the authenticated user's grant, task policy, and dependency outputs to produce a per-node authority manifest.
- The scheduler binds that manifest to a just-in-time executor credential; an executor cannot inspect sibling credentials, widen its rights, or alter the manifest.
- Tools enforce the manifest, and any replan that changes resources or operations requires recompilation, with unavailable authority causing a block or explicit approval.
Why interviewers ask this: The interviewer checks whether planner visibility is separated from executable authority through deterministic per-node compilation.
I would require a typed dependency DAG whose edges describe data and completion contracts, not just an ordered list.
- Each step would declare required inputs, producing step IDs, expected outputs, preconditions, and an acceptance test.
- The runtime would schedule only ready steps, preserve immutable outputs by reference, and join branches only when their required evidence is present.
- A failed dependency would mark downstream steps blocked and trigger a bounded repair or replan without rerunning independent completed work.
Why interviewers ask this: The interviewer checks whether decomposition produces executable dependency contracts and predictable fan-out and join behavior.
Replanning should follow material changes to assumptions, feasibility, or required outcomes, not every imperfect observation.
- Valid triggers include a failed dependency, a tool reporting stale data, a newly discovered constraint, or two retries exhausting the current approach.
- The replan request should include completed steps and immutable user constraints so the planner does not discard valid work.
- A low confidence score alone should first cause clarification or a targeted verification step, because repeated global replans can livelock.
Why interviewers ask this: A strong answer defines observable replanning triggers while protecting completed work and preventing churn.
I would choose ReAct for short exploratory tasks and plan-execute for longer work with dependencies, budgets, or approval points.
- ReAct adapts after every observation and works well for two or three uncertain searches, but its implicit plan is hard to inspect or resume.
- Plan-execute exposes dependencies and progress, making parallelism, approvals, and recovery easier at the cost of an extra planning pass.
- I would compare both on per-run task success, repeated tool calls, p95 latency, and cost rather than prompt quality alone.
Why interviewers ask this: The interviewer checks whether the candidate connects reasoning patterns to concrete task shape and operating metrics.
Validation, authorization, state transitions, and side-effect execution should be deterministic even when an LLM proposes the action.
- A model may select refund_order, but code must validate the schema, amount, order ownership, and policy limit before execution.
- Retries, timeout handling, deduplication, and terminal-state checks should not depend on another model judgment.
- LLM nodes are best used where semantic interpretation or option ranking is needed, with their outputs constrained to typed choices.
Why interviewers ask this: A strong answer places probabilistic reasoning inside deterministic safety and workflow boundaries.
I would persist one canonical append log and derive typed workflow checkpoints from committed events.
- A node commit records its input version, output, transition, and outbox intent atomically, or the checkpoint, event, and outbox are written in one database transaction.
- A new worker resumes from the latest committed sequence and rebuilds projections deterministically instead of trusting two independently written stores.
- External effects remain at least once: they need stable idempotency keys, an effect ledger, and reconciliation for ambiguous outcomes rather than an exactly-once claim.
- Model prompts, tool schemas, and workflow definitions carry version IDs so old runs are resumed or migrated under explicit contracts.
Why interviewers ask this: The interviewer evaluates whether durability includes recoverable state, event causality, and versioned execution contracts.
I would assign each business side effect a stable idempotency key within its authorization scope and record its status before retries.
- The key would derive from tenant, operation type, and a caller-visible business operation ID, so a recreated run cannot issue the same intended ticket again.
- A hash of canonical arguments is stored separately; reuse of the key with a different payload is rejected instead of becoming a new operation.
- The ledger tracks proposed, authorized, started, succeeded, and uncertain states together with the external resource ID.
- After an uncertain timeout, the agent queries the provider by key or reconciles externally rather than issuing a blind duplicate call.
Why interviewers ask this: A strong answer handles ambiguous outcomes rather than assuming a network timeout means nothing happened.
I would model each booking as a committed step with a named compensating action and execute compensations in reverse dependency order.
- The ledger stores reservation IDs, cancellation deadlines, fees, and compensation status for every successful tool call.
- A car failure could trigger hotel and flight cancellation, but a nonrefundable flight may require human review rather than pretending rollback is complete.
- Compensation calls also need idempotency keys and retries because the recovery path can fail independently.
Why interviewers ask this: The interviewer checks whether the candidate understands that distributed side effects require explicit, fallible compensation rather than database rollback.
The registry should expose machine-readable contracts for discovery, authorization, routing, and operations.
- Each capability needs an input and output schema, version, side-effect class, required scopes, owner, timeout, and idempotency behavior.
- Runtime health, region, rate limit, data classification, and deprecation status let the orchestrator select a usable endpoint.
- Agents receive a task-specific filtered view of the registry instead of the organization's complete tool catalog.
Why interviewers ask this: A strong answer treats tool discovery as a governed runtime contract rather than prompt text.
I would make initialization, transport liveness, reconnect policy, and shutdown explicit runtime states.
- The client completes MCP initialization, records the selected protocol version and server identity, and builds its registry only from capabilities the server declared.
- MCP ping requests, transport deadlines, and bounded reconnect backoff distinguish a failed connection from a slow tool without creating reconnect storms.
- Reconnection does not prove an in-flight call stopped or failed, so the workflow waits, queries application state, or retries only under the tool's idempotency contract.
- After session loss, the client initializes again and refreshes capability lists before scheduling new calls.
Why interviewers ask this: The interviewer evaluates whether the candidate uses the MCP ping primitive and separates transport recovery from tool-effect recovery.
Initialization selects a protocol version and exchanges asymmetric client and server declarations rather than intersecting one shared feature list.
- The client sends protocolVersion, clientInfo, and client capabilities; the server returns its selected protocolVersion, serverInfo, and server capabilities, then the client sends the initialized notification.
- The runtime exposes only declared server surfaces such as tools, resources, or prompts and enables client behavior only where the corresponding declaration permits it.
- Tool list changes require the server capability tools.listChanged, while resource subscriptions and list changes require resources.subscribe and resources.listChanged respectively. Cancellation is not an initialization capability.
- Unknown optional fields remain forward compatible, while an unsupported protocol version fails initialization explicitly.
Why interviewers ask this: A strong answer describes MCP initialization as version selection plus distinct capability declarations, not symmetric feature negotiation.
I would treat the MCP server as an OAuth protected resource and follow discovery instead of forwarding an existing bearer token.
- The client discovers Protected Resource Metadata and its authorization servers, then uses Authorization Server Metadata to locate supported authorization endpoints.
- For an authorization-code flow, the client uses PKCE and requests a token bound to the MCP resource through the resource indicator and appropriate scopes.
- An insufficient-scope challenge can trigger explicit step-up consent, while refresh tokens stay in the client credential store and are never exposed to the model or tool arguments.
- Token passthrough to another MCP server is forbidden; any internal token exchange is a separate delegation design and must issue a new audience-bound token.
Why interviewers ask this: The interviewer checks current MCP OAuth discovery, resource binding, step-up, token custody, and the prohibition on token passthrough.
I would map the long-running MCP request to one durable workflow operation with separate protocol and effect states.
- When the caller supplies a progress token, MCP progress notifications update monotonic completed work and optional total, but they do not commit the tool result.
- User cancellation sends an MCP cancelled notification for the request and marks cancellation requested; the receiver may already have performed work, so the runtime does not report stopped until it has evidence.
- A workflow timeout closes local waiting and triggers bounded transport cleanup, but disconnecting the client is not proof that server processing or an external side effect stopped.
- Without cancellation, a final result or error completes the protocol request; after cancellation, the workflow expects no result and reconciles unknown effects through an application-specific status or idempotency interface.
Why interviewers ask this: A strong answer uses MCP progress and cancellation semantics without turning advisory cancellation or disconnection into a false side-effect guarantee.
I would mint a short-lived token that grants only the exact operations and resources required for that task.
- The token could allow reading free-busy for named attendees and creating one event in a specific calendar, while denying event deletion and contact export.
- Resource IDs, time bounds, maximum uses, audience, and run ID should be cryptographically bound to the token.
- Child agents receive attenuated tokens with equal or narrower rights, never a copy of the supervisor's broader credential.
Why interviewers ask this: The interviewer evaluates whether least authority is encoded in enforceable, attenuable credentials rather than prompt instructions.
The policy engine should evaluate the authenticated actor, task intent, proposed capability, arguments, current state, and data sensitivity.
- A deterministic rule can allow read-only CRM lookup but require approval for exports over 100 records or any account deletion.
- Policy uses server-derived tenant and ownership facts, because model-provided fields are untrusted input.
- The result should be allow, deny, or require approval with a reason code recorded before the side-effect ledger advances.
Why interviewers ask this: A strong answer defines a concrete pre-execution enforcement point with trusted context and auditable outcomes.
I would prefer DOM or accessibility-tree control for structured web interfaces and use vision when semantic elements are unavailable or the target is graphical.
- DOM APIs expose elements, attributes, text, and input values; accessibility locators expose computed roles and accessible names, making both easier to verify than pixel coordinates.
- Vision is necessary for canvas apps, remote desktops, and visual layout cues, but needs screenshot freshness checks and coordinate normalization.
- A hybrid controller can ground a visual target, map it to a DOM element when possible, and verify the resulting state through both channels.
Why interviewers ask this: The interviewer checks whether the candidate chooses control signals by observability and verification needs rather than model novelty.
I would represent browser state as a versioned snapshot tied to the current tab, document, and interaction epoch.
- The snapshot includes URL, tab and frame IDs, navigation ID, DOM or accessibility-tree digest, visible dialogs, and relevant cookies or storage references.
- Every proposed action cites the snapshot version it was grounded against, and the controller rejects it after navigation or material DOM change.
- Postconditions such as a changed URL, confirmation text, or disabled submit button must be observed before the action is marked successful.
Why interviewers ask this: A strong answer prevents stale observations from becoming unsafe browser actions and verifies state transitions.
I would run each task in an ephemeral sandbox with no ambient host credentials and deny network access by default.
- A container or microVM gets a read-only source mount, writable scratch volume, unprivileged user, syscall restrictions, and CPU, memory, process, and wall-time limits.
- Network egress is allowed only through an audited proxy to named destinations, while secrets are injected per command and never written to the workspace.
- Artifacts crossing the boundary are size-limited and scanned, and the sandbox is destroyed after the task rather than reused across tenants.
Why interviewers ask this: The interviewer evaluates whether containment covers credentials, resources, network access, artifacts, and tenant isolation.
I would consolidate after a task boundary or when context pressure rises, using evidence-backed extraction rather than copying the whole transcript.
- The consolidator selects stable user preferences, verified facts, unresolved commitments, and reusable procedures while discarding transient reasoning.
- Each memory stores provenance, confidence, scope, and expiry, and high-impact claims require confirmation or repeated evidence.
- Consolidation should be evaluated by future task success and false-memory rate, not by how much text it saves.
Why interviewers ask this: A strong answer makes consolidation selective, attributable, and measurable instead of treating summaries as trusted memory.
Locked questions
- 21
How would you design memory retrieval for a graph workflow without injecting all available memory into every node?
designmemory-retrievalmemory - 22
An external document tells the agent to remember a new administrator email for future approvals. How would you defend against memory poisoning?
agentsmemorymemory-poisoning - 23
How should an agent resolve two memories that disagree about a user's preferred shipping address?
agentsconflict - 24
How would you compact a long agent context without losing constraints that must survive until task completion?
agents - 25
When is a supervisor topology useful for a multi-agent workflow, and what bottleneck does it create?
multi-agentsupervisortracking - 26
What conditions justify a peer or swarm topology instead of a supervisor?
swarm - 27
Several candidate agents share one model family and often make the same mistake. How would you select a verifier and measure whether it adds independent signal?
agentsownershipverifier - 28
How would you use a blackboard architecture for agents investigating a production incident?
blackboardincidentsagents - 29
What should a typed handoff protocol contain when one agent delegates work to another?
agentsdelegationtyping - 30
How would you schedule concurrent agents without exceeding provider limits or duplicating dependent work?
agentsconcurrency - 31
A parent agent is cancelled while a remote subagent still holds a work lease and may be calling a tool. How should the runtime recover?
agents - 32
What should a reliable termination protocol look like for an autonomous agent?
agentstyping - 33
How would you route different workflow nodes across models while using vLLM in your stack?
vllm - 34
A primary model provider fails halfway through a workflow. What should provider fallback preserve?
- 35
How should an agent express uncertainty and decide when to abstain?
agents - 36
How would you define human approval tiers for agent tool calls?
agentsapproval - 37
How would you implement interrupt and resume around a human approval that may arrive hours later?
approval - 38
How would you evaluate whether a durable agent recovers semantically correctly from crashes around checkpoint boundaries?
agentsdecision-makingllm-eval - 39
What should a tool-call grader evaluate beyond exact JSON equality?
llm-evaldecision-makinggrader - 40
How would counterfactual tool-result evaluation test whether an agent actually uses observations?
agentsllm-eval - 41
How would you design simulator or fake tools for an agent evaluation harness?
agentsdesignllm-eval - 42
An agent reaches the wrong final state after planning, tool use, replanning, and compensation. How would you identify which decision caused the failure?
agentstool-use - 43
How would you prove that an autonomous agent adds value over a deterministic workflow for the same task?
agents - 44
An MCP tool returns a structured customer record whose annotations target the assistant and whose nested field instructs it to call export_contacts. How would you handle this injection?
injection - 45
How can an agent become a confused deputy when it has broader tools than the requesting user?
agents - 46
What controls would you add to prevent data exfiltration by a tool-using agent?
agents - 47
How would you enforce a per-task token and tool budget without causing arbitrary failures?
tokens - 48
How would you find and reduce the latency critical path in a multi-agent workflow?
latencycommunicationscheduling - 49
A cached planner output is reused after the model, prompt, tool schema, and source data have changed. How would you make this cache correct?
promptingschemacaching - 50
How would concrete control requirements drive your choice among LangGraph, AutoGen, and CrewAI?
langgraph - 51
A free-form ReAct support agent solves most tickets but sometimes spends 80 tool calls and $6 on a simple refund lookup. How would you contain the cost without losing useful autonomy?
reactformsagents - 52
A planner turns a request to update one shipping address into 14 subtasks, including unnecessary research and verification. How would you fix the over-decomposition?
- 53
A deployment planner offers either an in-place upgrade or a clone-and-cutover path, but the scheduler starts mutation steps from both branches. How would you enforce one plan branch?
deployment - 54
A planner emits six required steps, but the executor returns success after silently skipping identity verification. How would you detect and prevent this?
- 55
A LangGraph conditional edge sends a failed validation back to the same node forever. How would you debug and stop the loop?
validationlanggraph - 56
A workflow resumes from a checkpoint after a worker crash and charges the customer's card a second time. What would you change?
- 57
An agent books a flight and hotel, then the car booking fails; the flight cancellation also fails during compensation. How would you design the recovery?
designresilienceagents - 58
Two different customers submit identical invoice requests and one is incorrectly deduplicated. What is wrong with the idempotency design?
queriesidempotencydesign - 59
A tool registry resolves search_orders to a deprecated v1 tool after v2 was deployed. How would you make resolution safe?
deploymentregistries - 60
A Streamable HTTP MCP client reconnects and its Mcp-Session-Id is rejected with HTTP 404. How should it recover?
sessionshttp - 61
An MCP server changes a required tool argument from a string to an object, breaking older clients overnight. How would you prevent this?
mcp - 62
A research subagent receives a delegated token that can also delete documents, although it only needs read access. What would you change?
tokensdelegation - 63
A policy engine approves a tool call before aliases and file paths are normalized, allowing a blocked directory through an alternate path. How would you fix the ordering?
normalization - 64
A browser agent's DOM says a modal is closed, but the screenshot still shows it covering the submit button. Which signal should control the next action?
agentsdom - 65
A computer-use agent clicks 40 pixels below every target after the remote desktop is resized. How would you diagnose it?
agentscomputer-use - 66
A code agent starts a child process that survives its sandbox timeout and consumes a full CPU core. How would you contain it?
agentsconcurrencyresilience - 67
Memory consolidation summarizes a customer's preferences but drops the exception 'never contact me by phone on Fridays.' How would you preserve it?
memoryerror-handling - 68
A user corrects a false memory, but the agent keeps retrieving the old claim for days. How would you remove the poisoned memory?
agentsmemory - 69
A supervisor can create subagents, and those subagents can delegate again. How would you stop authority from expanding down the tree?
delegation - 70
Context compaction removes the sentence requiring manager approval before refunds above $500. How would you make compaction safe?
- 71
A supervisor agent reviews every subagent message, making a four-agent workflow slower than one agent. How would you remove the bottleneck?
agentstracking - 72
Two collaborative agents edit the same deployment manifest from revision 18; one changes memory limits while the other changes health checks, and the last save drops one patch. How would you design shared editing?
deploymenthealth-checksdesign - 73
A coordinator finalizes and returns a multi-agent production incident report. Seconds later, a delayed specialist response arrives and overwrites the shared final result. How would you prevent post-finalization mutation?
agentsincidentsmulti-agent - 74
A pricing agent overwrites a newer blackboard value with a result computed from an older catalog snapshot. How would you stop stale writes?
agentssnapshotpricing - 75
A research agent hands a conclusion to a writer, but the final answer no longer shows which documents support it. How would you preserve provenance?
agents - 76
Two agents concurrently reserve the last warehouse item and both tell their users it succeeded. How would you fix the race?
agentsconcurrencywarehouse - 77
Agent A waits for Agent B's review while Agent B waits for Agent A's revised draft; retries keep both active. How would you handle the deadlock or livelock?
agentslocking - 78
A five-agent workflow requires unanimous termination, but one failed worker never votes. How would you guarantee completion?
agents - 79
A cost router sends a weak local model to approve a high-risk account deletion because the prompt is short. How would you redesign routing?
prompting - 80
A provider fallback keeps the conversation alive but emits tool calls in a different syntax, so no tools execute. How would you make fallback reliable?
- 81
Before an irreversible action, an agent reports a 0.92 chance of success from its own text. How would you estimate whether execution is safe?
agentsestimation - 82
Human approvals for purchase actions sit in a queue for six hours and agent runs time out. How would you redesign the workflow?
agentsdata-structuresapproval - 83
A manager approves a vendor payment, then explicitly withdraws approval while the action is waiting in the dispatch queue, but a queued worker still pays. How would you make withdrawal effective?
procurementdata-structures - 84
Your tool-call grader gives full credit when arguments are beautifully formatted, even if the tool returns no changed records. How would you fix the metric?
gradermonitoring - 85
An agent scores 96 percent on a golden trace suite but fails whenever users take a different valid path. How would you reduce overfitting?
overfittingagents - 86
A fake calendar tool always returns instantly and accepts every meeting, but production has conflicts, rate limits, and partial failures. How would you improve the simulator?
rate-limiting - 87
An LLM judge consistently rates long agent answers above concise correct ones. How would you remove the verbosity bias?
agentsllm - 88
A benchmark advertises 92 percent pass@5, but the product gives a user one attempt per task. What metric would you use?
benchmarkingmonitoring - 89
A security-review queue receives hundreds of suspicious agent actions per hour. What evidence should reviewers see, and how would you reduce rubber-stamp approvals?
agentsdata-structurescode-review - 90
An agent plans from an MCP resource, then the server reports that the resource changed before execution. What should the workflow do?
agents - 91
A computer-use agent changes a setting in a native desktop application with no DOM and no API. How would you target it safely and verify the postcondition?
agentscomputer-useapi - 92
Agent cost doubles after a release even though token prices and traffic stay flat. Traces show more retries. How would you investigate?
tokensagents - 93
End-to-end p99 latency is 48 seconds while most agent steps are fast; one CRM tool dominates the tail. What would you do?
latencye2eagents - 94
A tool-result cache returns an administrator's customer list to a regular user with the same natural-language query. How would you repair it?
queriescaching - 95
Your trace shows the final agent run but tool calls cannot be connected to the planner and subagent that caused them. How would you restore observability?
agentsobservability - 96
After a LangGraph migration, resumed runs lose a custom approved field and repeat the approval node. How would you migrate safely?
migrationslanggraph - 97
An AutoGen application needs both a distributed event-driven runtime and a small conversational review team. How would you choose between Core and AgentChat and define termination?
distributedeventsagents - 98
A CrewAI process must pause for approval, survive a restart, and then continue through deterministic business stages. Would you use a Crew, a Flow, or both?
concurrency - 99
During code review, you find a general-purpose shell tool exposed to a customer-facing agent with network access and no command restrictions. What changes do you request?
agentscode-review - 100
You have one week to fix an agent that succeeds on 72 percent of tasks and costs $1.40 per success; one change raises success to 80 percent at $1.90, while another keeps 72 percent at $0.85. Which do you ship?
agents