Code RoomTime-dependent token tests
HardPrep Room Coding #4113

Time-dependent token tests

Vibe & agenticCode quality & reviewMid–Senior~17 min

An AI agent wrote this Python test for a token generator that embeds an expiry. It passes today:

Identify two distinct reliability/quality problems with these tests and rewrite them to be sound.

Implement
token_expiry_states(issued_at: int, ttl_seconds: int, check_times: list[int]) → list[str]
Examples
in[1000,3600,[1000,4599,4600,4601]]out["valid","valid","expired","expired"]
in[0,1,[0,1,2]]out["valid","expired","expired"]
in[1000,3600,[]]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 17 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.