Client-trusted loot values
An AI assistant wrote this server endpoint (Go) for an online RPG's loot pickup. It validates the request shape and exists on the server, so it looks safe — but players are duping legendary items and granting themselves gold. Review the handler and explain why server-side ≠ authoritative here.
Implement
resolve_pickup(world_drops: list[str], request: str) → strExamples
in
[["d1|sword_of_dawn|legendary|50|0|p1","d2|health_potion|common|5|1|p2"],"p1|d1|sword_of_dawn|legendary|50"]out"granted|sword_of_dawn|legendary|50"in
[["d1|sword_of_dawn|legendary|50|0|p1","d2|health_potion|common|5|1|p2"],"p1|d1|crown_of_gods|mythic|999999"]out"granted|sword_of_dawn|legendary|50"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.
Run or narrate your approach, then ask the coach.