Skip to main content

80 Intermediate Interview Questions

#QuestionExpected answerReasoningCommon wrong answerFollow-upChapter
Q081What is LangGraph?Low-level runtime for long-running stateful workflows/agents with explicit graph control.Distinguishes orchestration from model abstraction.“Another LLM.”Why use it over a chain?131–132
Q082Why model an AI workflow as a graph?Branches, loops, parallelism, checkpoints, HITL become explicit.Control flow matters.“Graphs make prompts better.”When is a graph unnecessary?132
Q083What belongs in graph state?Durable data needed for control/continuation, not arbitrary clients/secrets.Persistence boundary.“Everything in memory.”How version state?133, 148
Q084What is StateSchema?Modern schema-based way to define typed LangGraph state.Current JS API knowledge.“Legacy Annotation only.”Why Zod/Standard Schema?134
Q085What is a reducer in LangGraph state?Rule for combining multiple updates to a field.Parallel/accumulating correctness.“A node that summarizes state.”Example?135
Q086What is a graph node?Logical step reading state/services and returning updates/control.Testable orchestration unit.“One prompt only.”Good node boundary?136
Q087Static vs conditional edge?Fixed transition vs route selected from state.Graph control semantics.“Sync vs async.”Where should auth branching live?137–139
Q088What are START and END?Explicit graph entry/terminal sentinels.Termination design.“First/last message.”Why test every END path?138
Q089What is Command?Primitive to update state/control routing or resume interrupts.Current graph API.“Shell command tool.”How is resume used?140, 150
Q090What does graph compilation do?Builds/validates executable graph and attaches runtime/checkpointer config.Construction vs execution.“Compiles TypeScript.”Why separate build from invoke?141
Q091What is a thread ID?Persistent pointer identifying graph workflow/conversation state.Resume semantics.“User authorization token.”Security implication?147
Q092What is a checkpoint?Persisted graph state at execution boundaries for resume/fault tolerance.Durable workflows.“Model cache.”In-memory vs durable?146
Q093What is an interrupt?Dynamic pause that persists state and waits for external input.HITL primitive.“Throwing app error.”What payload can it expose?149
Q094How do you resume an interrupt?Same thread plus Command({resume:value}).Correct continuation.“Call node directly.”What validates resume value?150
Q095Why are side effects before interrupt() dangerous?Resumed node restarts from beginning and may repeat them.Replay/idempotency insight.“Execution resumes at next line.”Safe pattern?151
Q096What is durable execution?Persisted progress plus replay-safe steps across failures/restarts.Operational definition.“Long timeout.”What makes a write replay-safe?152
Q097What are subgraphs useful for?Encapsulated reusable workflows with typed boundaries.Complexity/ownership.“Nested prompts only.”What state should cross boundary?154
Q098How do you stop infinite agent loops?Step/time/token/cost budgets, repeated-action detection, terminal routes.Reliability.“Tell model to stop.”Where store budgets?144, 170
Q099What is parallel branching risk?Merge semantics, partial failures, cancellation, conflicting side effects.Concurrency correctness.“Only faster.”Which operations parallelize well?145
Q100What makes a graph production-ready?Durable checkpoints, auth, idempotency, errors, cancellation, migration, observability, tests.Framework alone is insufficient.“It compiles.”What about old checkpoints?146–155
Q101Define an agent.Model-directed loop using state/tools/observations with bounded control.Avoids hype.“Any chatbot.”Workflow vs agent?156–157
Q102Workflow vs agent?App defines flow vs model chooses more next actions/routes.Complexity trade-off.“Same thing.”Which is easier to test?157
Q103What is ReAct?Interleave action selection/tool observations with continued model decisions.Agent pattern.“Reflection only.”Production safeguards?158
Q104Planner/executor pattern?Planner decomposes; executor performs/observes; plan may revise.Useful for variable tasks.“Always two models.”When overkill?159
Q105Router vs supervisor?Router picks path/capability; supervisor delegates/coordinates workers.Agent architecture vocabulary.“Same role.”What controls supervisor recursion?160, 166
Q106What is reflection/critique?Evaluate a draft/trajectory against rubric then revise.Quality loop.“Expose chain-of-thought.”Main trade-off?161
Q107What is orchestrator/workers?Central decomposer dispatches specialized subtasks, often parallel, then synthesizes.Multi-task pattern.“All workers share everything.”Why typed worker output?162
Q108What is agentic RAG?Agent dynamically decides retrieval/tool retrieval strategy.Advanced control.“Any RAG chatbot.”When fixed RAG is better?163
Q109When do multiple agents help?Real specialization/decomposition improves eval results enough to justify cost.Evidence-based adoption.“More agents = smarter.”What metrics compare?164
Q110Why can multi-agent be worse?Coordination, latency, cost, conflict, loops, evaluation complexity.Anti-hype reasoning.“No downside.”Simpler alternative?164
Q111Shared vs isolated agent state?Share minimal typed artifacts; isolate unnecessary context/secrets.Privacy/coupling.“One global transcript.”How track provenance?165
Q112What is convergence in multi-agent systems?Explicit condition/budget for finishing/resolving disagreement.Prevents loops.“Agents eventually agree.”Example stop rule?166
Q113What does “memory” mean in AI apps?Could mean context, history, checkpoint, profile, semantic/episodic DB.Requires specificity.“Vector DB.”Which is short-term?167
Q114What are risks of long-term memory?Privacy, stale facts, conflicts, retention/deletion, user control.Persistence obligations.“Only storage cost.”How expire memory?168
Q115What is HITL?Persisted pause/review/approve-modify-reject/resume workflow.Approval as protocol.“Human watches logs.”Why re-auth after wait?169
Q116Why bind approval to exact arguments?Prevent action mutation after user reviewed different payload.Integrity of consent.“Approval is generic.”What metadata bind?169
Q117What belongs in an agent reliability budget?Steps, tokens, time, cost, tool calls, retries.Bounded autonomy.“Temperature only.”How enforce?170
Q118Why need an agent kill switch?Immediate deterministic capability shutdown during incident.Operational containment.“Prompt update is enough.”Scope by tool/model?170
Q119What is MCP?Protocol standardizing AI app connections to tools/resources/prompts.Correct protocol definition.“Agent framework.”What does it not solve?171
Q120What are MCP host/client/server roles?Host owns clients; client connects to one server; server exposes capabilities.Architecture.“Server is LLM.”Where is trust boundary?172
Q121MCP tool vs resource vs prompt?Action vs readable context vs reusable prompt template.Primitive semantics.“All are functions.”Give example of each.173
Q122Stable MCP transports?stdio local/process; Streamable HTTP remote; legacy SSE deprecated.Current stable guidance.“WebSocket required.”Security for HTTP?174
Q123What is capability discovery?Client learns supported tools/resources/prompts/capabilities.Interoperability.“Auto-authorize everything.”What should host do next?175, 177
Q124Why label 2026-07-28 MCP behavior version-sensitive?It is draft/migration behavior at this baseline, not stable default.Docs-first discipline.“Newest date means stable.”Stable spec version?baseline, 175
Q125What does McpServer.registerTool do?Registers typed tool definition/handler for clients.TypeScript server basics.“Calls model.”Who authorizes handler?176
Q126Why log to stderr for stdio MCP?stdout carries protocol messages and must stay clean.Transport correctness.“stdout is normal logs.”How test server?176
Q127What should MCP client do with discovered tools?Intersect with local permissions/allowlist/risk policy.Discovery ≠ authority.“Expose all.”What if new tool appears?177
Q128What is tool poisoning?Malicious metadata/description influences model toward unsafe behavior.Supply-chain/context threat.“Corrupted JSON only.”Main mitigation?178
Q129Why are MCP resources injection vectors?Untrusted content enters model context and can issue malicious instructions.Indirect injection.“Resources are trusted by protocol.”How contain capability?178
Q130Why use OAuth for remote tools?Delegated scoped authorization without sharing user credentials.Access-control model.“Encrypt prompt.”Which flow for user consent?179
Q131What is authorization code + PKCE?User consent flow with verifier/challenge protecting code exchange.OAuth fundamentals.“Refresh token flow.”Why PKCE?179
Q132Access token vs refresh token?Short-lived API credential vs longer-lived token for new access tokens.Token lifecycle.“Same token.”Storage difference?179
Q133What are OAuth scopes?Requested/granted capability boundaries.Least privilege.“User roles only.”Read vs send example?179–180
Q134What is token audience/resource validation?Ensure token is intended for the resource receiving it.Prevent token misuse.“Any valid JWT works.”What is token passthrough risk?179
Q135Why separate read/write tool scopes?Different risk and consent; least privilege.Permission design.“One broad scope simpler.”Approval for which?180
Q136What is per-tool authorization?Check actor+resource+action before each execution.Dynamic capability control.“Authorize agent once forever.”Why re-check?180
Q137What is an eval dataset?Versioned representative inputs with expected properties/judgments.Quality engineering.“Random prompts.”Where source cases?181–182
Q138Golden answer vs rubric?Exact expected value for deterministic task; criteria for open-ended output.Evaluator design.“Always exact string.”Example?182
Q139Deterministic grader vs LLM judge?Code for objective properties; model for subjective rubric dimensions.Reliability.“Judge everything with LLM.”Why combine?183
Q140Risks of LLM-as-judge?Bias, variance, prompt/model drift, self-style preference.Judge is probabilistic.“It is objective.”How calibrate?184
Q141What is pairwise evaluation?Judge/human compares candidate A vs B under rubric.Useful for relative quality.“Two independent scores only.”Position bias mitigation?184
Q142What is a trajectory eval?Score agent path/tool selections/args/efficiency/safety, not only final answer.Agents are processes.“Answer score only.”Example failure?185
Q143What should an AI trace capture?Model/retrieval/tool/graph spans, versions, latency, usage, errors.Reconstruct behavior.“Raw prompt only.”What redact?186
Q144Why record prompt/model version in traces?Reproduce and segment regressions/rollouts.Behavior changes by version.“Version irrelevant after deployment.”What about retriever version?186
Q145What is a production feedback loop?Connect outcomes/ratings/corrections to traces and curated eval cases.Operational learning.“Train on every rating.”Why curate?187
Q146Direct vs indirect prompt injection?User prompt vs malicious instructions arriving through external content.Threat paths.“Only direct chat matters.”Example indirect source?188
Q147What is data exfiltration risk in agents?Model/tool chain can send confidential data to unauthorized destination.Capability security.“Only hallucination.”Which controls?188–190
Q148What is confused deputy problem?Privileged app acts on untrusted request without verifying requester/resource authority.Agent-specific security.“Model confusion.”Example with email?189
Q149How enforce tenant isolation in RAG?Trusted server tenant/ACL filters at retrieval/storage/cache plus tests.Model cannot enforce.“Prompt says only tenant data.”What about traces?189
Q150What is SSRF risk for AI tools?URL tool reaches internal/metadata/private network resources.Tool security.“Bad webpage content only.”Controls?190
Q151Why sandbox code execution?Limit filesystem/network/process/resource damage from generated/untrusted code.Capability containment.“Generated code is trusted.”What limits?190
Q152Why rate-limit agents?Prevent abuse, runaway loops, denial-of-wallet/capacity exhaustion.Reliability/security/cost.“Only provider rate limit matters.”Per user or workspace?190, 195
Q153What is a production AI orchestrator?Layer coordinating model, prompt, graph, tools, RAG, policy, eval hooks.Architecture separation.“One giant prompt.”Which parts async?191–192
Q154Why use queues for long AI work?Durability, retry/backpressure, decouple HTTP lifetime from execution.Distributed-system design.“Models require queues.”How expose progress?192
Q155What is model routing?Select model/provider based on task, quality, latency, cost, capability/health.Optimize task utility.“Random load balancing.”How evaluate routes?193
Q156What makes a fallback safe?Capability/quality/schema/tool semantics compatible and evaluated.Resilience with correctness.“Any available model.”If no compatible fallback?193
Q157What can AI systems cache?Responses, prompt prefixes, embeddings, retrieval, reranking, safe tool results.Performance/cost.“Everything globally.”Main security concern?194
Q158What should cache keys include?All semantic/security/version inputs including tenant scope.Correctness/isolation.“Prompt text only.”How invalidate RAG cache?194
Q159What is cost per successful task?Total relevant platform spend divided by successful task completions.Product metric.“Cost per model call.”Why better?195
Q160What is time-to-first-token?Delay until first generated token/event; one component of latency UX.Performance vocabulary.“Total latency.”How reduce it?196