← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Meta data scientist SQL round, two questions back to back with a strict time window and some tricky edge cases baked in. The self-call exclusion and the double-counting trap in Q2 were clearly there to see if you'd actually read the problem.

Questions Asked (2)

Q1

Given a video_calls table, find the top 10 callers by number of distinct recipients they called over the last 7 days. Exclude self-calls. Break ties by total calls, then caller_id ascending. Return caller_id, distinct recipient count, and total calls.

Product Analytics & MetricsAlgorithms & Data Structures
Author's notes

The tie-breaking part is where I almost slipped up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and definitions, then write a SQL query that filters calls to the last 7 days, excludes self-calls, and aggregates by caller_id to compute distinct recipients and total calls. Finally, rank the results using the specified tie-breaking rules and limit to the top 10.

Pro tip: Explicitly state your assumptions about the date range (e.g., last 7 days from today) and whether 'distinct recipients' counts unique recipient IDs per caller. Also, mention that you would validate the results by checking edge cases like callers with only self-calls or ties.

1. Clarify requirements and schema

Confirm the table structure, date range definition, and what constitutes a 'call' (e.g., any row in video_calls). Ask if there are any additional filters like call status.

2. Filter and aggregate data

Write a subquery or CTE to filter calls from the last 7 days and exclude self-calls (caller_id != recipient_id). Then group by caller_id to compute COUNT(DISTINCT recipient_id) and COUNT(*).

3. Rank and select top 10

Use a window function or ORDER BY with the specified tie-breaking rules: ORDER BY distinct_recipients DESC, total_calls DESC, caller_id ASC. Limit to 10 rows.

4. Validate and discuss edge cases

Mention potential edge cases: callers with no calls in the period, ties beyond the top 10, and how the query handles them. Suggest validating with sample data.

Key Points to Mention

  • Use of COUNT(DISTINCT recipient_id) to get distinct recipients per caller.
  • Filtering with a date condition like call_date >= CURRENT_DATE - INTERVAL '7 days' (or equivalent).
  • Excluding self-calls with caller_id != recipient_id.
  • Tie-breaking logic: ORDER BY distinct_recipients DESC, total_calls DESC, caller_id ASC.
  • Using LIMIT 10 to get top 10 callers.
  • Considering performance: indexing on call_date and caller_id if the table is large.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Using a daily_users table joined with video_calls, calculate what percentage of active French users (dau_flag = 1) on a specific date appeared as either a caller or recipient in at least one call that same day. Return the numerator, denominator, and the percentage.

Product Analytics & MetricsData Modeling
Author's notes

This one got me for a second because of the union approach.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, filter the daily_users table to active French users on the given date to get the denominator. Then, identify distinct users who were either caller or recipient in video_calls on that same date, and intersect with the active French users to get the numerator. Finally, compute the percentage as numerator divided by denominator times 100.

Pro tip: Clarify whether 'active French users' means users with dau_flag=1 and country='France' on that date, and ensure you handle potential duplicates in video_calls by using DISTINCT on user IDs. Also, consider timezone alignment between the daily_users date and video_calls timestamp.

1. Define active French users

Filter the daily_users table for the specific date where dau_flag = 1 and country = 'France'. This set forms the denominator.

2. Identify users in calls

From video_calls on the same date, extract distinct user IDs from both caller and recipient columns. Union these to get all users who participated in at least one call.

3. Intersect and count

Join the active French users with the call participants to find those who appeared in at least one call. Count distinct users for the numerator.

4. Calculate percentage

Compute the percentage as (numerator / denominator) * 100. Return numerator, denominator, and percentage.

Key Points to Mention

  • Use of DISTINCT to avoid double-counting users who made multiple calls or appeared as both caller and recipient.
  • Filtering conditions: dau_flag = 1, country = 'France', and date matching the specific date.
  • Handling of NULLs or missing values in caller/recipient columns.
  • Timezone considerations: ensure the date in daily_users aligns with the timestamp in video_calls.
  • Efficiency: use JOINs or subqueries appropriately to avoid performance issues.
  • Definition of 'active' and 'French' based on the given columns.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.