Find Users Who Never Opened a Push Notification
Last updated: November 29, 2026
Quick Overview
Given tables of Facebook push notifications sent and notification opens, return users who received at least one notification in the last 30 days but opened none of them.
Meta
November 29, 20260
0
0 solved
Given tables of Facebook push notifications sent and notification opens, return users who received at least one notification in the last 30 days but opened none of them.
Notification fatigue work at Meta starts by finding people who receive pushes but ignore them. The interviewer is checking that you write an anti join correctly and know the NULL trap with NOT IN.
What the Interviewer Expects
- Writes a correct anti join with NOT EXISTS or LEFT JOIN ... IS NULL
- Explains why NOT IN breaks when the subquery returns NULL
- Scopes both sent and opens to the same 30 day window
- Dedupes users in the output
- Clarifies whether an open must match a specific notification id
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- What changes if an open can arrive a day after the 30 day window closes?
- How would you instead compute the open rate per user and bucket users?
- How would you make this fast when the sends table has billions of rows?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
notif_sent(notif_id, user_id, sent_at) and notif_open(notif_id, user_id, opened_at). I will ask whether notif_open.user_id can be NULL (logging gaps do happen); I will assume it can. An open cou...
Approach
Start from distinct recipients in the window, and keep those with no matching open. I prefer NOT EXISTS because it is NULL-safe and states intent. `WHERE user_id NOT IN (SELECT user_id FROM notif_op...