Code RoomPerformance refactor verification
MediumPrep Room Coding #4505

Performance refactor verification

Vibe & agenticAlgorithms & data structuresMid–Senior~18 min

An agent rewrote a Python data-processing function and claims it's '10x faster' by replacing a loop with a vectorized NumPy/pandas approach. Spot-checking on your test data, the outputs look the same. Before you accept both the speedup and the correctness, how do you verify a performance refactor you didn't write?

Implement
verify_perf_refactor(baseline_out: list[str], candidate_out: list[str], baseline_ms: list[float], candidate_ms: list[float]) → str
Examples
in[["1","2","3"],["1","2","3"],[40,400],[10,50]]out"accept"
in[["1.0","nan","3.0"],["1.0","0.0","3.0"],[40,400],[4,20]]out"reject_output_mismatch"
in[["a","b"],["a","b"],[100,50],[10,50]]out"reject_no_speedup"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

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