Code RoomProperty test with wrong oracle
HardPrep Room Coding #4112

Property test with wrong oracle

Vibe & agenticAlgorithms & data structuresSenior–Staff~21 min

An AI agent wrote a property-based test (fast-check, TypeScript) for your dedupe(arr) function. The property looks principled:

It passes. A teammate says 'great, the property proves dedupe is correct.' What's the subtle problem with using [...new Set(arr)] as the oracle here, and when does this pattern bite?

Implement
dedupe_violations(original: list[int], candidate: list[int]) → list[str]
Examples
in[[3,1,3,2],[3,1,2]]out[]
in[[3,1,3,2],[3,2,1]]out["not_subsequence"]
in[[1,1,2],[1,1,2]]out["has_duplicates"]
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 21 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.