Code RoomTest selection from diffs
MediumPrep Room Coding #27

Test selection from diffs

Vibe & agenticAI agents & automationMid–Senior~15 min

Full regression takes four hours, so your team wants an agent that looks at each diff and picks which tests actually need to run. Walk me through the design — what signals does it use, what can it decide alone, and what happens when it's unsure? A missed regression escaping to production is the nightmare here, so how do you evaluate the miss rate before trusting it? And give me the one-minute case for why this is worth building.

Implement
select_tests_for_diff(test_records: list[str], changed_files: list[str]) → list[str]
Examples
in[["test_auth|unit|src/auth.py;src/util.py","test_billing|unit|src/billing.py","test_smoke_login|smoke|src/app.py"],["src/billing.py"]]out["test_billing","test_smoke_login"]
in[["test_auth|unit|src/auth.py;src/util.py","test_billing|unit|src/billing.py","test_smoke_login|smoke|src/app.py"],["src/new_feature.py"]]out["test_auth","test_billing","test_smoke_login"]
in[["test_auth|unit|src/auth.py;src/util.py","test_billing|unit|src/billing.py","test_smoke_login|smoke|src/app.py"],[]]out["test_smoke_login"]
What a strong answer looks like

Turn the fuzzy goal into a bounded agent task. Say what the agent reads, what it may do on its own versus draft for a human, and what it must never touch. Then earn the trust: how you’d verify it before rollout, and the pitch (the problem, what you built, why it matters).

0:00 of about 15 min

Agent build: design the agent in plain language (or narrate it). The coach grades the decomposition, the guardrails, the verification plan, and the pitch.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.