SQL filter excludes restaurants
An AI assistant produced this query for a dashboard showing the average rating per restaurant. Product reports that some restaurants show suspiciously high averages, and a few new restaurants are missing from the list entirely.
What are the data-correctness problems here?
Implement
summarize_ratings(restaurant_ids: list[str], review_lines: list[str]) → list[list[int]]Examples
in
[["r1","r2"],["r1|5","r1|1","r2|4"]]out[[300,2],[400,1]]in
[["r1","r_new"],["r1|4","r1|5"]]out[[450,2],[-1,0]]in
[["r1"],["r1|NULL","r1|3"]]out[[300,2]]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 14 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.