forked from rohitg00/ai-engineering-from-scratch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.json
More file actions
90 lines (90 loc) · 3.43 KB
/
Copy pathquiz.json
File metadata and controls
90 lines (90 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
"lesson": "13-langgraph-stateful-graphs",
"title": "LangGraph: Stateful Graphs and Durable Execution",
"questions": [
{
"stage": "pre",
"question": "What does LangGraph treat as the core unit of the agent?",
"options": [
"A free-form LLM call",
"A state machine with typed state, function nodes, and conditional edges",
"A single tool registry",
"A vector index"
],
"correct": 1,
"explanation": "LangGraph models the agent as a state graph: nodes are pure functions, edges are transitions, state is typed and immutable."
},
{
"stage": "pre",
"question": "Which problem does durable execution solve?",
"options": [
"Reducing inference cost",
"Resuming a 40-step run from step 38 when it fails, with exact state, instead of starting over",
"Generating embeddings faster",
"Translating between providers"
],
"correct": 1,
"explanation": "Checkpoints after every node let the runtime resume from the last successful step."
},
{
"stage": "check",
"question": "Which of these is NOT one of the three topologies LangGraph supports?",
"options": [
"Supervisor",
"Swarm (peer-to-peer)",
"Hierarchical (nested subgraphs)",
"Gradient ring"
],
"correct": 3,
"explanation": "Topologies are supervisor, swarm, and hierarchical. Gradient ring is not a LangGraph topology."
},
{
"stage": "check",
"question": "Why must nodes be deterministic for resume to work cleanly?",
"options": [
"Providers require determinism",
"Resume assumes the same inputs produce the same state update; random seeds, wall-clock, and external APIs must be captured",
"Determinism reduces token cost",
"It is required by the GIL"
],
"correct": 1,
"explanation": "If a node depends on uncaptured nondeterminism, resume cannot reconstruct the post-step state."
},
{
"stage": "check",
"question": "What is a conditional edge?",
"options": [
"An edge weighted by training loss",
"An edge chosen by a function of state, used to branch the graph",
"An edge that runs only on GPUs",
"An edge with a TTL"
],
"correct": 1,
"explanation": "Conditional edges branch based on state; overusing them makes the graph hard to reason about."
},
{
"stage": "post",
"question": "What goes wrong when checkpoints are too small?",
"options": [
"Tool state and memory writes are not recoverable; full state must serialize",
"The disk fills up",
"The graph cannot reach END",
"The model produces shorter answers"
],
"correct": 0,
"explanation": "Only checkpointing conversation turns leaves tool state and memory writes outside resume's reach."
},
{
"stage": "post",
"question": "Where does human-in-the-loop fit into LangGraph's design?",
"options": [
"It requires a fork of the runtime",
"Pause before a critical node, surface serialized state to a human, accept modifications, resume; the checkpointer makes this cheap",
"Only at START and END",
"Through a separate provider API"
],
"correct": 1,
"explanation": "Because state is already serialized between nodes, human review and edit is a natural pause-and-resume pattern."
}
]
}