Code RoomResetting when AI optimizations regress
HardPrep Room Coding #4051

Resetting when AI optimizations regress

Vibe & agenticAlgorithms & data structuresSenior–Staff~22 min

You ask an AI to optimize a C++ hot loop that processes 10M particles per frame. First pass it 'optimizes' by replacing your `std::vector` with `std::list` ('faster insertion'); frame time gets worse. You say slower; it adds `#pragma omp parallel for` over a loop with a shared accumulator — now it's a data race and the output flickers. It's confidently making it worse each turn. How do you recognize the model lacks the real bottleneck and reset?

Implement
rank_profile_hotspots(regions: list[str], self_time_pct: list[float], budget_pct: float) → list[str]
Examples
in[["gravity_pairwise","integrate","render"],[80,12,8],75]out["gravity_pairwise"]
in[["gravity_pairwise","integrate","render"],[80,12,8],90]out["gravity_pairwise","integrate"]
in[["gravity_pairwise","integrate","render"],[80,12,8],0]out[]
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 22 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.