← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Sep 2025Remote

Summary

Meta DS technical screen, two SQL problems back to back with a schema I hadn't seen before. The questions were genuinely hard and the edge case callouts felt like the real test, not the queries themselves.

Questions Asked (2)

Q1

Given a schema with users, calls, and call_participants tables, write SQL to find how many distinct users initiated completed video calls with more than 3 different other callees during a specific 7-day window, excluding test accounts.

Product Analytics & MetricsData Modeling
Author's notes

The join between calls and call_participants tripped me up at first because you have to be careful not to count the initiator as one of their own callees.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and definitions (e.g., what constitutes a completed video call, how to identify initiators, and how to exclude test accounts). Then build a query that filters calls by the 7-day window, completion status, and video type, joins to participants to count distinct callees per initiator, and finally filters initiators with more than 3 distinct callees. Use CTEs for readability and to avoid nested subqueries.

Pro tip: Mention that you would validate the results by checking edge cases like calls with the initiator also listed as a participant, and ensure the time window is inclusive/exclusive as specified. Also, discuss performance considerations such as indexing on call date and participant user IDs.

1. Clarify requirements and schema

Confirm the meaning of 'completed video calls', how to identify initiators (e.g., initiator_id in calls table), and how test accounts are flagged (e.g., is_test_account boolean). Also confirm the exact 7-day window (inclusive dates).

2. Filter calls

Select calls within the specified date range, with status = 'completed' and call_type = 'video'. Exclude calls initiated by test accounts.

3. Join with participants

Join the filtered calls to the call_participants table to get all callees for each call. Exclude the initiator from the callee list to avoid self-counting.

4. Aggregate per initiator

Group by initiator_id and count distinct callee_ids. Filter to only those with COUNT(DISTINCT callee_id) > 3.

5. Count distinct initiators

Count the number of distinct initiator_ids that satisfy the condition. This is the final answer.

Key Points to Mention

  • Use of COUNT(DISTINCT ...) to ensure distinct callees per initiator.
  • Filtering out test accounts at the appropriate stage (e.g., in the calls table or users table).
  • Handling of the 7-day window with proper date functions (e.g., BETWEEN or >= and <).
  • Exclusion of the initiator from the callee list to avoid counting self as a callee.
  • Use of CTEs or subqueries for clarity and maintainability.
  • Consideration of performance: indexing on call date, status, and participant user IDs.

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

Q2

Write SQL to compute what percentage of French DAUs were on a video call on a given day, returning numerator, denominator, and percentage. Also provide a version that handles users joining the same call multiple times.

Product Analytics & MetricsData ModelingRoot Cause Analysis
Author's notes

This one had layers.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the definitions of DAU, French users, and video call participation, then write a SQL query that computes the numerator (distinct French DAUs on a video call) and denominator (all French DAUs) for a given day, and finally calculate the percentage. For the version handling multiple joins, use DISTINCT or a subquery to deduplicate users who joined the same call multiple times.

Pro tip: Always clarify ambiguous terms like 'French' (based on user country or IP?) and 'video call' (any participation or only initiations?) before writing SQL, as these definitions significantly impact the metric.

1. Clarify Definitions and Assumptions

Define what constitutes a French DAU (e.g., users with country='France' active on the given day) and what counts as being on a video call (e.g., any call event). Confirm the date format and time zone.

2. Identify Relevant Tables and Columns

Assume tables like user_activity (user_id, date, country) for DAU and call_events (user_id, call_id, date, event_type) for video calls. Ensure you know how to join them.

3. Compute Numerator and Denominator

Write subqueries: denominator = COUNT(DISTINCT user_id) from user_activity where date = given_date and country = 'France'; numerator = COUNT(DISTINCT user_id) from call_events where date = given_date and user_id in French DAUs.

4. Calculate Percentage

Combine numerator and denominator in a single query, computing percentage as (numerator * 100.0 / denominator). Handle division by zero if no DAUs.

5. Handle Multiple Joins

For the version with multiple joins, ensure the numerator counts distinct users who joined any call at least once, using DISTINCT or a subquery with GROUP BY user_id.

Key Points to Mention

  • Use COUNT(DISTINCT user_id) to avoid double-counting users who join multiple calls.
  • Filter for French users based on a reliable country field, not IP if possible.
  • Define 'video call' clearly: does it include audio calls or only video-enabled?
  • Consider time zone differences when defining 'a given day'.
  • Handle edge cases like zero DAUs to avoid division by zero.
  • For multiple joins, use a subquery to deduplicate before joining to the DAU table.

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