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.44 KB
/
Copy pathquiz.json
File metadata and controls
90 lines (90 loc) · 3.44 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": "34-repo-memory-and-state",
"title": "Repo Memory and Durable State",
"questions": [
{
"stage": "pre",
"question": "What is the durability test that decides whether a piece of information belongs in repo memory?",
"options": [
"Whether it is JSON",
"Whether it would be useful three months from now in a CI rerun; if yes, repo; if no, telemetry",
"Whether the user marked it as important",
"Whether it fits in 4 kB"
],
"correct": 1,
"explanation": "Repo memory is for durable, three-months-from-now-useful state; transient data is telemetry."
},
{
"stage": "pre",
"question": "What schema field carries the agent's contract version?",
"options": [
"schema_version",
"build_hash",
"model_id",
"session_uuid"
],
"correct": 0,
"explanation": "schema_version is the integer contract; the manager refuses to load from an unknown version."
},
{
"stage": "check",
"question": "How does atomic write work?",
"options": [
"tempfile.mkstemp in the same directory, write, fsync, os.replace (atomic rename) over the target",
"Truncate-then-write to the target",
"Append-only with a CRC",
"Encrypt and overwrite"
],
"correct": 0,
"explanation": "Atomic rename on POSIX and Windows is what prevents partial-write corruption."
},
{
"stage": "check",
"question": "Why are idempotency keys required for non-idempotent tool calls?",
"options": [
"For billing",
"If the agent crashes after a tool call but before checkpointing the result, retry safely; log call ID before execution and skip the call on retry",
"To deduplicate logs",
"To shorten output"
],
"correct": 1,
"explanation": "pending_calls.jsonl carries the call IDs; recovery checks and skips already-executed work."
},
{
"stage": "check",
"question": "Where should large artifacts (CSVs, long transcripts, generated files) live relative to state?",
"options": [
"Inline in agent_state.json",
"As separate files (or object storage) with only the path kept in state, so checkpoints stay small and fast",
"In environment variables",
"Concatenated into one giant log"
],
"correct": 1,
"explanation": "Separate artifacts grow independently of state; checkpoints stay cheap to read and write."
},
{
"stage": "post",
"question": "What does event sourcing for audit + snapshots for resume buy you?",
"options": [
"Lower disk usage",
"Replay agent decisions verbatim by reading the snapshot then replaying events after it; same shape as Postgres WAL",
"Faster inference",
"Native voice support"
],
"correct": 1,
"explanation": "Append to state.events.jsonl on every mutation; periodically snapshot to state.json; replay events after the snapshot timestamp."
},
{
"stage": "post",
"question": "What does the lesson say happens when schema_version mismatches?",
"options": [
"The manager silently upgrades",
"The manager refuses to load until a migration script in tools/migrate_state.py runs",
"The state is deleted",
"The agent retries"
],
"correct": 1,
"explanation": "Schema migrations or refuse-to-load; never silent upgrade."
}
]
}