14. Interview Questions & MCQs
Framework Interview Questions (LangChain, CrewAI, MCP, Multi-Agent)
Questions and answers
- What is LangChain used for in agentic apps?
Answer A toolkit to compose LLM calls, prompts, tools, retrievers, and memory into chains or agents. It speeds wiring; your app still owns auth, budgets, and tool execution safety.
- LangChain vs LangGraph — when pick each?
Answer LangChain shines for linear/RAG chains and simple tool agents. LangGraph fits stateful, branching, cyclical workflows with explicit nodes/edges, checkpoints, and human-in-the-loop interrupts.
- What is a LangGraph node and edge?
Answer A node is a unit of work (model call, tool node, function). Edges route state to the next node — fixed or conditional — forming a graph the runtime executes with shared state.
- How does LangGraph persist state?
Answer Via checkpointers that save graph state between steps so runs can pause, resume, time-travel, or wait on HITL without losing the conversation/tool history.
- What is CrewAI optimized for?
Answer Role-based multi-agent “crews”: agents with goals/backstories, tasks, and process types (sequential/hierarchical) that collaborate with tools — strong for team-style workflows.
- CrewAI Process sequential vs hierarchical?
Answer Sequential runs tasks in order. Hierarchical uses a manager-style agent to delegate and coordinate workers — closer to supervisor–worker when span of control grows.
- What is AutoGen (AG2) known for?
Answer Multi-agent conversation patterns: agents chat to solve tasks, with options for tool use, group chat, and human proxy patterns — flexible dialogue-centric orchestration.
- OpenAI Agents SDK — core ideas?
Answer Code-first agents with tools, handoffs to specialists, guardrails on input/output, and tracing. Handoffs transfer ownership; guardrails validate; traces debug runs.
- What problem does MCP solve?
Answer Model Context Protocol standardizes how hosts discover and call tools, resources, and prompts on MCP servers — one integration shape instead of one-off tool adapters per app.
- MCP client vs MCP server?
Answer The host embeds clients that connect over a transport, list capabilities, and invoke them. Servers advertise tools/resources/prompts and execute against backends under their own auth.
- MCP tools vs resources vs prompts?
Answer Tools are side-effecting calls with JSON schemas. Resources are URI-addressed read context. Prompts are reusable message templates the host can fetch and fill.
- How do you secure MCP tool use?
Answer Allowlist servers/tools, validate args, scoped credentials on the server, sandbox risky executors, audit every call, and never let the model invent new server endpoints.
- What is A2A used for vs MCP?
Answer MCP connects an agent to tools/context servers. A2A connects agents to other agents for discovery and task delegation with a task lifecycle and artifacts.
- LlamaIndex — when over LangChain?
Answer When the hardest problem is data/RAG: indexing, retrieval quality, and query engines. Many stacks use LlamaIndex for retrieval and LangGraph/Crew for orchestration.
- Semantic Kernel in one sentence?
Answer Microsoft’s SDK for plugging LLMs into apps via plugins/functions and planners — strong in .NET/enterprise plugin-style tool calling.
- Haystack’s sweet spot?
Answer Production search/RAG pipelines with clear components (readers, retrievers, pipelines) — less about multi-agent crews, more about robust document QA.
- PydanticAI — why mention it in interviews?
Answer Typed Python agents with Pydantic models at boundaries — structured outputs and tool args validated by types, reducing parse bugs in production loops.
- How do frameworks implement tool calling differently from “raw” APIs?
Answer They wrap provider tool schemas, bind Python/TS functions, run the propose→execute→observe loop, and manage message history — same protocol, less boilerplate.
- What is a handoff in multi-agent frameworks?
Answer Transfer of control to another agent specialized for the intent (e.g., billing). The new agent owns the next turns with its tools/instructions until it finishes or hands back.
- Supervisor–worker in LangGraph or Crew terms?
Answer A supervisor node/agent plans and routes; worker agents/nodes execute narrow tasks and return structured results; supervisor joins, retries, or escalates.
- When is multi-agent overkill?
Answer When one tool-using agent with clear prompts meets the SLA. Extra agents add latency, failure modes, and cost — split only for real specialization or isolation needs.
- How do you evaluate LangChain/LangGraph apps?
Answer Dataset of prompts with expected tool traces and answers; assert trajectory (tools called) and output quality; track cost/latency; regression on prompt/graph changes.
- Memory modules across frameworks — common pitfall?
Answer Dumping full history into every call. Prefer windowing, summarization, or retrieval of long-term facts with tenant filters — and redact secrets from stored memory.
- How do CrewAI “tools” relate to MCP tools?
Answer Crew tools are framework-bound function wrappers. MCP tools are protocol-advertised capabilities any compliant host can call. You can bridge MCP into Crew/LangChain tool adapters.
- LangGraph interrupt / HITL pattern?
Answer Pause before a sensitive node, persist checkpoint, wait for human approval payload, then resume. Keeps irreversible tools behind an explicit interrupt edge.
- AutoGen group chat — risk to mention?
Answer Unbounded agent chatter can loop and burn tokens. Set max rounds, clear speaker selection, termination conditions, and tool allowlists per agent.
- How do you choose LangGraph vs CrewAI in a design interview?
Answer Pick LangGraph for explicit state machines, durable execution, and fine-grained HITL. Pick CrewAI for fast role/task crew demos and hierarchical team metaphors. Either needs your safety layer.
- What belongs in framework config vs your product code?
Answer Framework: wiring models, tools, graph/crew topology. Product: authN/Z, tenant isolation, budgets, PII redaction, audit, SLOs, and kill switches — never outsource those to the LLM.
- How do MCP resources help RAG agents?
Answer Servers can expose documents or data as resources the host reads into context under ACL — cleaner than ad-hoc file reads, with URI identity for citations.
- Give a crisp opener for “Compare agent frameworks.”
Answer “I compare by orchestration model (chain vs graph vs crew vs chat), state/HITL support, tool ecosystem (including MCP), and how easily I can enforce allowlists and evals — not by hype.”