Test clamp with 2-3 inputs
An AI assistant generated a Python function `clamp(value, low, high)` that returns `value` constrained to the `[low, high]` range. You can't easily prove it's correct by reading, so you decide to pick exactly 2-3 inputs that would expose a bug if one exists. Which inputs do you choose, and why those?
Implement
clamp_values(values: list[int], low: int, high: int) → list[int]Examples
in
[[5,-3,12],0,10]out[5,0,10]in
[[0,10],0,10]out[0,10]in
[[7,-2,99],10,0]out[7,0,10]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 12 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.
Run or narrate your approach, then ask the coach.