Skip to content
Tech Interview Prep
Technical interview guide

Agent Frameworks, Orchestration & MCP

Stateful agent orchestration frameworks (LangGraph and peers) and MCP, the emerging standard protocol for connecting models to tools and data.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: MCP 2026-07-28 and TypeScript SDK v2, JSON-RPC 2.0, JSON Schema 2020-12, OpenAPI 3.2.0, LangGraph reference reviewed 2026-09-04, AutoGen, ReAct, Toolformer, OpenTelemetry, W3C Trace Context, NIST GenAI, and OWASP Prompt Injection/Excessive Agency.

Overview

Curated: · Written: · Reviewed:

Agent Frameworks, Orchestration & MCP

In one line

A stateful orchestration framework (LangGraph and peers) persists the state of a multi-step agent run so it survives crashes, branches and human approvals. MCP is the protocol that connects a host to tools, resources and prompts served by separate servers. Reach for a state graph when you need interrupts, parallel joins or durable resume, and for MCP when a tool surface must work across many hosts.

Key definitions

  • Checkpoint: persisted typed state written after each node, holding node position, attempt count, recorded effect results and deadlines.
  • Interrupt: a state transition that persists state and returns a handle. Resume is a fresh process loading that state.
  • Idempotency key: an identifier sent with an external side effect so a repeated call does not repeat the effect.
  • Host, client, server: the app the user runs, the per-server connector inside it, and the program exposing capabilities.
  • Tools, resources, prompts: model-controlled actions, application-controlled context, and user-invoked templates.
  • Capability negotiation: the initialize handshake in which each side declares what it supports. Neither side guesses.

How it works

  • The model is stateless. The conversation is re-sent on every call, so orchestration state is a separate typed record you own.
  • After each node the checkpointer persists state. On a crash, a new process loads the last checkpoint.
  • Nondeterministic results (model output, clock, RNG, tool effects) are recorded and replayed, never re-executed.
  • For a card charge: persist intent, call the payments API with an idempotency key, then persist the result.
  • Over MCP, the client sends initialize with its version and capabilities, the server answers, the client sends initialized, and both sides use only the features declared.
Node starts Persist intent External effect with idempotency key Persist result Next node Worker crash Load last checkpoint

When to use and when not to

ApproachUse whenAvoid when
Single call + toolsOne decision, few toolsMulti-step work that must survive restarts
Simple loopIterate until a stop condition you ownBranching, parallelism or approvals needed
Fixed chain / DAGSteps known up frontBranching changes often
State graphConditional edges, parallel joins, interrupts, durable resumeSimple tasks: you then own checkpointing, determinism and migration
MCPTools consumed by many hosts, or ecosystem serversYou control both ends and have three tools; hand-rolled schemas are simpler
Direct decorators or hand-written schemasFull control, no extra hopMany tool sources, so every app writes its own adapters

Traps interviewers probe

  1. Replaying a side effect after a crash. Fix: persist intent before the effect, pass an idempotency key, and record the result after. Retries from JSON-RPC transport can duplicate requests, so application-level idempotency is still required.
  2. Treating an interrupt as a paused stack frame. Fix: it serializes state and returns. Approval loads the checkpoint, checks the approver against that task, writes an audit record, then continues.
  3. Calling MCP a security boundary. Fix: it is an interoperability boundary. The host owns authorization. Server-reported identity such as serverInfo and clientInfo is display metadata, never a principal.
  4. Trusting server output. Fix: tool results, descriptions and resource contents are untrusted input. Treat them as data, restrict the tool set per task, and require confirmation for consequential actions.
  5. Exposing a whole API as tools. An 84-operation billing API becomes 84 tools, including payout.create. Fix: allowlist the operations each task may use.

Interview tips

Open by drawing the state machine: nodes, branches, approval gates. Then say that frameworks manage state, protocols define boundaries, and neither makes the workflow correct, authorized or safe.

Follow-ups to expect:

  • Why not a while loop with function calling? For simple tasks, do exactly that. Graphs earn their cost with interrupts, parallel branches and durable resume.
  • What is in your checkpoint? Typed state, node and attempt, recorded effect results, deadlines. Not a pickled stack frame.
  • What breaks on replay? Anything unrecorded: model calls, clocks, RNG, side effects.
  • A community MCP server is installed. What can it do? Whatever its OS sandbox allows. Run it as a low-privilege user or in a container, mount only what it needs, block egress by default, and pass credentials per server.
  • How do you test it? A framework-free baseline for outcomes, contract tests for the handshake and version negotiation, and fault injection for duplicate delivery and revoked tokens.

30-second answer outline:

  1. Name the state machine: nodes, branches, approval gates.
  2. Say where state lives and what the checkpoint holds.
  3. Name the replay boundary: effects recorded, with an idempotency key on each external call.
  4. Say MCP is for interoperability, the host authorizes, and tools are limited per task.
  5. Name one test: kill the worker after the charge and assert exactly one charge.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.