Code RoomFeature selection data leak
HardPrep Room Coding #4225

Feature selection data leak

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

An AI wrote this feature-selection-then-CV pipeline for a high-dimensional genomics classifier. CV accuracy is 0.97 on 80 samples and 20,000 features. Explain why that number is a mirage.

Implement
select_features_per_fold(feature_rows: list[list[int]], labels: list[int], fold_ids: list[int], top_k: int) → list[list[int]]
Examples
in[[[1,0,7],[1,0,0],[0,9,0],[0,9,0]],[1,1,0,0],[0,1,0,1],2]out[[0,1],[1,2]]
in[[[3,1],[0,4],[2,0]],[1,0,1],[0,1,1],1]out[[1],[0]]
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 20 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.