← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026Remote

Summary

Meta DS technical screen, basically one long SQL problem about a group calls experiment. The schema was handed to you upfront which was nice, but the three sub-tasks together took up the whole session and there was a lot to keep track of.

Questions Asked (3)

Q1

Write a SQL query to compute, by country, the share of treatment-group users who started or joined at least one group call during the experiment week. Only include users exposed on or before a specified cutoff date.

A/B Testing & ExperimentationProduct Analytics & MetricsData Modeling
Author's notes

The country join tripped me up at first because you pull country from the users table but the experiment table only has user_id.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and definitions: identify the user table with country and exposure date, the experiment assignment table with group, and the group call events table. Then write a query that filters to treatment users exposed on or before the cutoff, left joins to call events within the experiment week, and computes the share of users with at least one call per country.

Pro tip: Explicitly state your assumptions about the experiment week (e.g., 7 days from exposure) and whether 'started or joined' means any call event; this shows you think about metric definitions and avoids ambiguity. Also, use a LEFT JOIN with a conditional COUNT to handle users with zero calls correctly.

1. Clarify requirements and schema

Ask about table structures, column names, and precise definitions: what constitutes a group call event, how exposure date is recorded, and the exact experiment week window. Confirm that 'share' means the proportion of treatment users with at least one call.

2. Filter and prepare user cohort

Select users in the treatment group who were exposed on or before the cutoff date. Ensure you have their country and a unique user identifier.

3. Identify users with group call activity

Join the cohort to the group call events table on user ID, filtering events to the experiment week (e.g., between exposure date and exposure date + 6 days). Use a LEFT JOIN to retain users with no calls.

4. Aggregate by country

Group by country and compute the share as COUNT(DISTINCT users with at least one call) / COUNT(DISTINCT all users in cohort). Use conditional aggregation or a subquery to count distinct users with calls.

5. Validate and present results

Check for edge cases: users with multiple calls, missing country data, or exposure dates outside the cutoff. Present the query with clear comments and explain how you would validate the results.

Key Points to Mention

  • Define the experiment week precisely (e.g., 7 days from exposure) and ensure call events fall within that window.
  • Use LEFT JOIN to include users with zero calls, and COUNT(DISTINCT user_id) for accurate shares.
  • Filter treatment users exposed on or before the cutoff date to avoid including late exposures.
  • Handle potential duplicates in call events by counting distinct users, not events.
  • Consider whether 'started or joined' requires unioning two event types or if a single event table captures both.
  • Validate the query with sample data or sanity checks (e.g., shares between 0 and 1, total users match cohort size).

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

Q2

Write a SQL query to estimate cannibalization of 1:1 calls using a difference-in-differences approach: compare per-user one-on-one call counts between treatment and control, across the experiment week and the pre-period.

A/B Testing & ExperimentationProduct Analytics & MetricsData Modeling
Author's notes

DiD in SQL is not something I practice enough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the experiment design: treatment vs control groups, pre-period and experiment week, and the metric (per-user 1:1 call counts). Then, write a SQL query that aggregates call counts per user per period, computes group-level averages, and calculates the difference-in-differences estimate as (treatment_post - treatment_pre) - (control_post - control_pre).

Pro tip: Always check the parallel trends assumption by comparing pre-period trends; if violated, consider alternative methods like synthetic control. Also, use per-user averages rather than total counts to avoid bias from group size differences.

1. Clarify experiment design and metric

Confirm the treatment and control groups, the pre-period and experiment week dates, and that the metric is per-user 1:1 call counts. Ensure you understand how users are assigned to groups.

2. Aggregate call counts per user per period

Write a subquery to count 1:1 calls for each user in each period (pre and post), joining with the experiment assignment table to label users as treatment or control.

3. Compute group-level averages

Calculate the average per-user call count for each group (treatment/control) and period (pre/post) by aggregating the user-level counts.

4. Calculate difference-in-differences

Compute the DiD estimate as (treatment_post_avg - treatment_pre_avg) - (control_post_avg - control_pre_avg). This isolates the treatment effect from underlying trends.

5. Validate assumptions and interpret

Check parallel trends in the pre-period and consider statistical significance. Interpret the DiD estimate as the cannibalization effect if negative.

Key Points to Mention

  • Difference-in-differences requires parallel trends assumption; verify pre-period trends.
  • Use per-user averages to account for unequal group sizes.
  • Ensure proper join between call logs and experiment assignment tables.
  • Consider using a window function or conditional aggregation for period labeling.
  • DiD estimate formula: (T_post - T_pre) - (C_post - C_pre).
  • Cannibalization is indicated if DiD is negative (treatment reduces calls relative to control).

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

Q3

Write a SQL query to identify the top 5 calls during the experiment week where both treatment and control participants were present in the same call, showing counts of each variant per call.

A/B Testing & ExperimentationData Modeling
Author's notes

Interference check.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data model and defining what constitutes a 'call' and how participants are linked to calls. Then, write a query that joins call participants with experiment assignments, filters to the experiment week, groups by call, and counts distinct treatment and control participants per call. Finally, filter to calls with both variants present, order by total participants (or another metric), and limit to top 5.

Pro tip: Mention that you would validate the query by checking for edge cases like calls with only one variant or missing experiment assignments, and consider using window functions for ranking if ties are possible.

1. Clarify requirements and data model

Ask about the schema: how calls are identified, how participants are linked to calls, and how experiment assignments are stored. Confirm the definition of 'experiment week' and 'top' (e.g., by total participants).

2. Filter and join relevant data

Filter experiment assignments to the experiment week and join with call participants to get each participant's variant per call. Ensure you handle only calls that occurred during the experiment week.

3. Aggregate counts per call

Group by call ID and count the number of distinct treatment and control participants. Use conditional aggregation (e.g., SUM(CASE WHEN variant = 'treatment' THEN 1 ELSE 0 END)) to get counts per variant.

4. Filter and rank calls

Filter to calls where both treatment and control counts are greater than zero. Then order by total participants (or another relevant metric) descending and limit to 5.

5. Validate and optimize

Check for duplicates, missing data, and performance. Consider indexing on join keys and using window functions if ties need handling.

Key Points to Mention

  • Use of conditional aggregation to count treatment and control participants separately
  • Filtering to the experiment week based on assignment date or call date
  • Ensuring both variants are present by using HAVING clause with counts > 0
  • Handling potential duplicates by counting distinct participants
  • Ordering by total participants or another metric to define 'top'
  • Considering performance implications and indexing

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