LangGraph interview questions and answers
10 questions from the LangGraph Interview Mock practice bank, spread across its domains. Pick your answer, then open the explanation to see why each option is right or wrong.
- Question 1Graph Fundamentals
What does this loop receive on each iteration (default v1 format)?
for item in graph.stream(inputs, stream_mode=["updates", "custom"]): print(item)- A
A
(mode, data)tuple, e.g.('custom', {...}) - B
A plain dict, and you cannot tell which of the two modes produced it
- C
A dict with
type,nsanddatakeys - D
A
(namespace, data)tuple
Show the answer and explanation
Answer: A
v1 output shape depends on options: one mode gives raw data, several modes give
(mode, data),subgraphs=Trueadds a namespace.version="v2"replaces all of these with one{"type", "ns", "data"}dict.Why the other options are wrong
B. That is the single-mode v1 shape; lists of modes add the mode name.
C. That is the v2
StreamPartshape, which needsversion="v2".D. Namespaces are added only with
subgraphs=True.
- A
- Question 2Agents and Memory
In the subagents pattern, a subagent is wrapped as a
@tool. Which techniques do the docs show for controlling the context that crosses the boundary? (Choose two.)Choose 2.
- A
Read
runtime.state["messages"]throughToolRuntimeand pass a transformed history to the subagent when it needs prior context - B
Return a
Commandwhose update carries extra state keys plus aToolMessagewith the matchingtool_call_id - C
Have the subagent write straight into the supervisor's checkpoint with
update_state - D
Set
graph=Command.PARENTin the subagent's tool so it takes over the supervisor's conversation - E
Use
output_mode="full_history"oncreate_agent
Show the answer and explanation
Answer: A and B
Inputs: decide how much of the parent's state the subagent receives (query only for isolation, history to continue work). Outputs: return text, or a
Commandthat also updates parent state keys while still answering the tool call with a ToolMessage.Why the other options are wrong
C. The docs do not show this, and it bypasses the tool-call/response pairing.
D. That is the handoff mechanism, which transfers control instead of returning a result to the caller.
E.
output_modebelongs tocreate_supervisor;create_agenthas no such parameter.
- A
- Question 3Persistence and Human-in-the-Loop
An approval node must send the graph to
proceedwhen the reviewer approves and tocancelotherwise, with no separate routing function. Which implementation does this?- A
def approval(state): ok = interrupt({"details": state["action"]}) return "proceed" if ok else "cancel" - B
def approval(state) -> Command[Literal["proceed", "cancel"]]: ok = interrupt({"details": state["action"]}) return Command(goto="proceed" if ok else "cancel") - C
def approval(state): target = interrupt("Type proceed or cancel") return Command(goto=target, resume=True) - D
def approval(state): ok = interrupt({"details": state["action"]}) graph.invoke(Command(goto="proceed" if ok else "cancel"))
Show the answer and explanation
Answer: B
The interrupts guide's approve-or-reject pattern returns
Command(goto=...)from the node that calledinterrupt(), annotatedCommand[Literal["proceed", "cancel"]]so the graph knows the possible destinations. The caller resumes withCommand(resume=True)to approve orCommand(resume=False)to reject.Why the other options are wrong
A. A node must return a state update or a
Command; returning a bare node name is how routing functions behave, not nodes.C.
resumebelongs in graph input, not in a node's return value, and letting the reviewer type a node name is fragile.D. Invoking the graph from inside its own node starts a separate run; routing is done by returning a
Command.
- A
- Question 4Production and Operations
Which statements about assistants, threads and runs on Agent Server are true? (Choose three.)
Choose 3.
- A
Passing a graph ID such as
"agent"asassistant_iduses that graph's default assistant - B
A run can be stateless: pass
Noneasthread_idand no conversation is kept - C
A thread is permanently bound to the assistant that created it
- D
A second assistant can run on the same thread and see the checkpoints the first assistant wrote
- E
Each new assistant needs its own deployment of the graph code
Show the answer and explanation
Answer: A and B and D
Assistants hold configuration, threads hold state, and runs are workloads. A run pairs an assistant with an optional thread. Graph IDs resolve to default assistants. Because threads are not tied to an assistant, you can switch configuration mid-conversation or chain specialised assistants on one thread.
Why the other options are wrong
C. A thread is not tied to one assistant. A different assistant can continue on the same thread.
E. Many assistants can share one deployed graph. They differ only in configuration.
- A
- Question 5Graph Fundamentals
Which of these are keyword arguments of
StateGraph.compile()in LangGraph 1.2? (Choose three.)Choose 3.
- A
store - B
cache - C
interrupt_before - D
recursion_limit - E
thread_id - F
stream_mode
Show the answer and explanation
Answer: A and B and C
The 1.2 signature is
compile(checkpointer=None, *, cache=None, store=None, interrupt_before=None, interrupt_after=None, debug=False, name=None, transformers=None). Anything that varies per request (thread id, recursion limit, context, stream mode) belongs on the call.Why the other options are wrong
D. This is a per-call config key, not a compile argument.
E. The thread id goes in
config["configurable"]on each call.F. Stream mode is chosen per
stream()/invoke()call.
- A
- Question 6Agents and Memory
Your team uses
create_agenteverywhere. Which requirements justify hand-writing aStateGraphinstead? (Choose two.)Choose 2.
- A
The flow is mostly fixed: always classify, then look up the account, then branch to one of three specialist sub-flows, with the model used only inside some steps
- B
Retrieved documents must be graded, with a bounded rewrite-and-retry loop and a parallel web-search branch
- C
The agent must remember earlier turns of the conversation
- D
One tool must pause for human approval before it runs
- E
The final answer must be a validated Pydantic object
Show the answer and explanation
Answer: A and B
create_agentcovers memory (checkpointer), approval (middleware), typed output (response_format), custom state (state_schema) and runtime context (context_schema). Drop to a hand-writtenStateGraphwhen the shape of the flow must be guaranteed: required deterministic steps, custom loops, parallel branches. The two can be combined, because acreate_agentgraph can be a node inside your graph.Why the other options are wrong
C.
create_agentaccepts acheckpointer; pass athread_idto keep history.D.
HumanInTheLoopMiddlewarehandles that oncreate_agent.E.
response_format=oncreate_agentreturnsstructured_response.
- A
- Question 7Persistence and Human-in-the-Loop
A graph
START -> node_a -> node_b -> ENDhas finished on thread1. What dovaluesandnextshow after this update?class State(TypedDict): foo: str bar: Annotated[list[str], operator.add] # node_a returns {"foo": "a", "bar": ["a"]}; node_b returns {"foo": "b", "bar": ["b"]} graph.update_state(cfg, {"foo": "m", "bar": ["manual"]}) snap = graph.get_state(cfg) print(snap.values, snap.next)- A
{'foo': 'm', 'bar': ['manual']} () - B
{'foo': 'm', 'bar': ['a', 'b', 'manual']} () - C
{'foo': 'm', 'bar': ['a', 'b', 'manual']} ('node_a',) - D
{'foo': 'b', 'bar': ['a', 'b']} (), because a finished thread cannot be updated
Show the answer and explanation
Answer: B
update_statebehaves like a node write: values go through the reducers, so an update to a list withoperator.addaccumulates instead of replacing it. Keys without a reducer are simply overwritten. The new checkpoint hassource == "update".Why the other options are wrong
A.
barhas an add reducer, so the update is appended, not swapped in.C. An update does not restart the graph;
nextfollows from the node it is attributed to.D. Finished threads accept updates; this is how you correct state after the fact.
- A
- Question 8Production and Operations
An assistant's configuration has
model,system_promptandmax_search_results. A developer changes the prompt like this:await client.assistants.update(asst_id, context={"system_prompt": NEW_PROMPT})Afterwards, runs use the graph's default model and search limit. Why?
- A
contextcan only hold one key at a time - B
The update failed silently, so runs fall back to defaults
- C
Updating an assistant always resets it to the graph's default assistant
- D
Assistant updates do not merge. The new version contains only the fields that were sent
Show the answer and explanation
Answer: D
Each
assistants.updatecreates a new version from the payload you send, and it does not merge with the previous version. Include every field you want to keep. The fix is to send the full configuration. Rolling back is easy as well: older versions remain and can be made active again.Why the other options are wrong
A. Context can hold many keys. They all have to be sent together.
B. The update worked. The prompt changed. The other fields were dropped because they were not sent.
C. Each update creates a new version of that assistant. It is not a reset to the default assistant.
- A
- Question 9Graph Fundamentals
For a graph built on
MessagesState, which of these are accepted as themessagesvalue ingraph.invoke({"messages": ...})? (Choose three.)Choose 3.
- A
[{"role": "user", "content": "hi"}] - B
"hi" - C
[("user", "hi")] - D
[{"content": "hi"}] - E
42
Show the answer and explanation
Answer: A and B and C
add_messagescoerces message-like input: message objects, strings, (role, content) tuples and dicts with a role. A dict missing its role, or a non-message value, fails during conversion, before any node runs.Why the other options are wrong
D. A message dict without
role(ortype) raisesValueErrorbecause the reducer cannot tell what kind of message it is.E. An integer is not a message-like value, and conversion raises
NotImplementedError.
- A
- Question 10Agents and Memory
To expire scratch memories automatically, a developer writes
store.put(ns, key, value, ttl=60)againstInMemoryStore(). What happens?- A
The item is stored and deleted 60 seconds later
- B
It raises
NotImplementedErrorbecauseInMemoryStoredoes not support TTL - C
The item is stored, and the TTL is quietly ignored
- D
The item expires after 60 reads
Show the answer and explanation
Answer: B
BaseStore.putraisesNotImplementedErrorwhenttlis set on a store whosesupports_ttlisFalse.InMemoryStoreis one of those stores. Stores that support TTL (for exampleSqliteStorefromlanggraph-checkpoint-sqlite) accept a TTL per item or aTTLConfigwithdefault_ttl,refresh_on_readandsweep_interval_minutes.Why the other options are wrong
A. TTL is not supported by
InMemoryStore, and TTL values are minutes, not seconds.C. It is not ignored.
ttl=Noneis the only value accepted without TTL support.D. TTL is time-based. Reads can refresh the timer but are not counted.
- A
Practise all 450 LangGraph questions
Start with the free 15-question diagnostic. It shows where to focus, and your results carry over if you sign up.