Code Room
Vibe codingHardvc-g138
Subject Ai verificationLevel Senior–Staff~21 minCommon in Databases & SQL interviewsIndustries Software development, Technology

Question

An agent produced a gnarly 60-line SQL query (window functions, multiple CTEs, a correlated subquery) to compute monthly cohort retention for a leadership dashboard. It runs, returns plausible numbers, and you don't fully follow the windowing logic. You're about to wire it into a report executives will make decisions on. How do you verify it's correct before you ship — without just trusting it and without spending a day re-deriving it by hand?

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.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.