Compute callers contacting >3 people last 7 days
Company: Meta
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Onsite
Using the schema below, write a single SQL query to return the number of unique callers who started calls with more than 3 distinct other users during 2025-08-26 00:00:00 to 2025-09-01 23:59:59 UTC (inclusive). Count a "started call" only by the caller_id (ignore inbound rings), treat multiple calls to the same callee_id as one, exclude self-calls (caller_id = callee_id), and ignore calls outside the window. Assume UTC timestamps.
Schema:
- calls(call_id INT, caller_id INT, callee_id INT, started_at TIMESTAMP, ended_at TIMESTAMP, media_type TEXT, status TEXT)
Sample rows (subset):
+---------+-----------+----------+---------------------+------------+-----------+
| call_id | caller_id | callee_id| started_at | media_type | status |
+---------+-----------+----------+---------------------+------------+-----------+
| 1001 | 10 | 21 | 2025-08-26 09:01:00 | video | completed |
| 1002 | 10 | 22 | 2025-08-27 11:15:00 | audio | completed |
| 1003 | 10 | 21 | 2025-08-28 12:00:00 | video | missed |
| 1004 | 10 | 23 | 2025-08-29 08:20:00 | video | completed |
| 1005 | 10 | 24 | 2025-08-30 17:45:00 | audio | completed |
| 1006 | 10 | 25 | 2025-09-01 07:30:00 | video | completed |
| 1007 | 11 | 12 | 2025-08-31 10:00:00 | video | completed |
| 1008 | 11 | 12 | 2025-09-01 10:00:00 | video | completed |
| 1009 | 12 | 12 | 2025-08-31 10:05:00 | audio | completed |
| 1010 | 13 | 30 | 2025-08-25 10:05:00 | video | completed |
+---------+-----------+----------+---------------------+------------+-----------+
Return a single integer column named caller_cnt.
Quick Answer: This question evaluates a candidate's ability to perform event-level data manipulation in SQL, including time-window filtering, deduplication of callee targets, exclusion of self-calls, and aggregation of distinct callee counts per caller.