Four lines of SQL, and one of the three obvious ways to write it returns an empty result set instead of an answer. Not wrong rows. Zero rows, silently, on production data that looks fine.
Find the users who were active in January but not in February.
Four lines of SQL, and one of the three obvious ways to write it returns an empty result set instead of an answer. Not wrong rows. Zero rows, silently, on production data that looks fine.
Updated Aug 2026 · Grounded in real Forward Deployed Engineer interview loops and written to a senior-engineer editorial bar.
This is asked because it separates people who have written SQL from people who have debugged it. The NOT IN trap does not corrupt a few rows, it collapses the entire result to nothing the moment a single NULL appears in the subquery, and it does it without an error. Candidates who write NOT EXISTS and cannot say why score adequately; candidates who write NOT IN, then catch themselves and explain three-valued logic, usually score higher, because that is what the interviewer wanted to talk about.
No comments yet — be the first to share your approach.
