Find WhatsApp Delivery Outage Windows From Per-Minute Success Rates
Last updated: November 29, 2026
Quick Overview
From per-minute message delivery stats per region, find every outage window: a run of consecutive minutes where at least 100 messages were attempted and fewer than half were delivered. Return each window's start, end, length and messages affected, keeping windows of three minutes or longer.
Meta
November 29, 20260
0
0 solved
From per-minute message delivery stats per region, find every outage window: a run of consecutive minutes where at least 100 messages were attempted and fewer than half were delivered. Return each window's start, end, length and messages affected, keeping windows of three minutes or longer.
A gaps-and-islands problem in the style of Meta infrastructure and reliability data interviews, framed around WhatsApp delivery monitoring. The interviewer wants the row-number difference trick on time buckets and careful thought about what a missing minute means.
What the Interviewer Expects
- Define an outage minute precisely with a volume floor
- Convert minutes to integer indexes
- Group consecutive minutes with index minus ROW_NUMBER
- Aggregate each island and filter by length
- Discuss missing minutes and low-traffic minutes
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
- A minute with no stats row at all: is that an outage or no traffic?
- How would you merge windows separated by a single healthy minute?
- How do you compute total outage minutes per month for an SLO?
- How would you run this continuously on a stream?
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
delivery_minute_stats(region, minute_ts, attempts, delivered), one row per region per minute with traffic. An outage minute has attempts >= 100 and delivered < 0.5 * attempts. A minute with fewe...
Approach
Filter to outage minutes. Turn each minute into an integer (TO_UNIXTIME(minute_ts) / 60). Within a region ordered by time, consecutive minutes have a constant minute_index - ROW_NUMBER(), so that ...