Code RoomProfile update missing input validation
MediumPrep Room Coding #4467

Profile update missing input validation

Vibe & agenticAlgorithms & data structuresEntry–Mid~13 min

An AI agent wrote this Express route to update a user's profile from a JSON body. It works in your manual test. On review, what's missing around the incoming data, and what kind of bad request would cause a problem in production?

Implement
validate_profile_update(fields: list[str]) → list[str]
Examples
in[["displayName=Ada Lovelace","age=31","role=admin"]]out["accept displayName=Ada Lovelace","accept age=31","reject role forbidden"]
in[["age=old","nickname=Ada"]]out["reject age not_an_integer","reject nickname unknown"]
in[[" displayName = Ada ","age=031"]]out["accept displayName=Ada","accept age=31"]
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 13 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.