Skip to content

English · Español

Phase 0 — Quizzes

🇪🇸 Espejo legible de data/quizzes/phase-00-foundations.yaml. Las respuestas viven detrás de bloques <details> para que puedas autoevaluarte sin spoilers.

Source of truth: data/quizzes/phase-00-foundations.yaml. The portal renders the same items; this page is for reading offline.


q-00-01 — Why is a lockfile not just a pinned requirements.txt?

You see two files in a peer's repo: requirements.txt with numpy>=2,<3 and uv.lock with numpy==2.0.1 (sha256=...). Which statement most precisely captures why the lockfile is necessary even though the requirements file already constrains the version?

  1. The lockfile is human-readable while requirements.txt is not.
  2. The constraint is satisfied by different exact versions on different days; the lock pins one version + its artifact hash, so installation fails if upstream is tampered with.
  3. The lockfile records the install order, which requirements.txt cannot.
  4. Only the lockfile is picked up by CI; requirements.txt is ignored.
Answer **Choice 2.** Constraints describe a set; lockfiles record a resolution + content hash. The hash is what makes tampering detectable.

q-00-02 — Which RNG sources does seed_everything NOT make deterministic?

Select every source of nondeterminism that seed_everything(seed) does not fully tame on its own.

  1. Multi-threaded BLAS reduction order
  2. Python's stdlib random module
  3. TF32 vs FP32 on Ampere GPUs
  4. NumPy legacy global RNG (np.random.seed)
  5. Hash randomization of strings between processes that started before seed_everything ran
Answer **Choices 1, 3, 5.** `seed_everything` seeds RNG state. It cannot reorder a threaded reduction, it cannot disable TF32 (a separate flag), and it cannot re-seed `hash(str)` retroactively in a running interpreter.

q-00-03 — Manifest essentials (free)

In one or two sentences, name the three pieces of information an experiment manifest must contain so that a stranger six months later can re-run your script and diagnose any numeric drift.

Answer Minimum: the **seed**, the **git sha**, and the **resolved versions** of every numerically-relevant library. Hardware and wall time are recommended extras.

q-00-04 — Why git_dirty matters in a manifest

A manifest contains git_sha: a1b2c3 and git_dirty: true. Why does the phase-gatekeeper subagent reject this for a DoD artifact?

  1. Because dirty trees confuse uv.lock resolution.
  2. Because the recorded sha no longer identifies the source tree that produced the numbers; the run is not reproducible from the sha alone.
  3. Because pytest skips dirty trees by default.
  4. Because bandit cannot scan a dirty tree.
Answer **Choice 2.** A dirty tree means the actual code that ran differs from any committed snapshot — the sha no longer identifies what was actually executed.

q-00-05 — Pre-commit cost curve (free)

Order the typical cost of fixing a defect from cheapest to most expensive across these five stages: caught-in-editor, caught-by-CI, caught-by-pre-commit, caught-in-review, caught-in-production. Name the cheapest and the most expensive and explain in one sentence why pre-commit sits between editor and CI.

Answer **Cheapest:** editor (seconds). **Most expensive:** production (hours-to-days). **Pre-commit** sits between editor and CI because it runs before push but after the LSP/typecheck loop — cheaper than waiting minutes for CI, costlier than the editor's continuous feedback.