← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Sep 2025Remote

Summary

Meta DS interview with a meaty ambiguous product analytics question that required defining cohorts, writing multi-step SQL, and then extending it to stratification and bias discussion. The whole thing was basically one long question dressed up in four parts, and it got progressively harder to keep track of what you were supposed to be solving.

Questions Asked (4)

Q1

You're asked whether existing users are more active than new users over the last 28 days. Before writing any SQL, propose two reasonable and mutually exclusive definitions for 'existing' vs 'new' users, and two defensible definitions of 'active'. Walk through the pros and cons of each, then pick one pair to move forward with.

Product Analytics & MetricsAdaptability & Ambiguity
Author's notes

This part felt manageable but I second-guessed myself on the 'mutually exclusive' constraint.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that 'existing' vs 'new' and 'active' are ambiguous and need clear, mutually exclusive definitions. Propose two definitions for each, discuss their trade-offs, and then select one pair that best balances business relevance and analytical rigor for the given context.

Pro tip: Tie your chosen definitions to a specific business decision or metric (e.g., retention or engagement) to show you understand the 'why' behind the analysis, not just the 'how'.

1. Clarify the ambiguity

Acknowledge that 'existing' vs 'new' and 'active' are not universally defined and depend on business context. State that you will propose two reasonable, mutually exclusive definitions for each.

2. Define 'existing' vs 'new' users

Propose two definitions: (1) based on account creation date relative to the 28-day window (e.g., new = created within window, existing = created before), and (2) based on first activity date (e.g., new = first activity within window, existing = first activity before). Discuss pros and cons of each.

3. Define 'active' users

Propose two definitions: (1) any user with at least one session or event in the 28-day window, and (2) users meeting a threshold of engagement (e.g., at least 3 sessions or 10 actions). Discuss pros and cons of each.

4. Evaluate and select a pair

Compare the definitions, considering factors like business goals, data availability, and potential biases. Choose one pair that is most defensible and aligns with the analysis objective, explaining your rationale.

5. Outline next steps

Briefly mention how you would translate the chosen definitions into SQL (e.g., using date filters and aggregation) and what metrics you would compute (e.g., active rate per group).

Key Points to Mention

  • Mutual exclusivity: Ensure the definitions for 'existing' and 'new' do not overlap (e.g., a user cannot be both).
  • Time window alignment: The 28-day window should be consistently applied to both user classification and activity measurement.
  • Business context: Definitions should reflect the company's product and goals (e.g., for a subscription service, 'new' might mean first subscription).
  • Data limitations: Consider how data availability (e.g., tracking first activity) might affect definition choices.
  • Edge cases: Address users who signed up but never activated, or users who churned and returned.
  • Metric interpretation: Explain how the chosen definitions impact the comparison (e.g., using a strict activity threshold may show lower activity for new users).

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

Q2

Using the provided schema and sample data, write SQL that labels users as new or existing, computes a 7-day rolling active rate and average daily events per user over the last 28 days, adjusts for partial observation windows for users who signed up within the window, and outputs a table with date, cohort, active_users, total_users_observed, active_rate_7d, and avg_events_per_user. Use window functions and avoid double-counting.

Product Analytics & MetricsData Modeling
Author's notes

Okay this is where I started sweating.

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 an active user, how to label new vs. existing). Then outline a step-by-step SQL approach using CTEs and window functions to compute rolling metrics, ensuring proper handling of partial observation windows and avoiding double-counting. Finally, discuss how to validate results and handle edge cases.

Pro tip: Explicitly state your assumptions about the data (e.g., daily grain, event timestamps) and how you'd handle users with no events—this shows you think about data quality and edge cases, which is crucial for product analytics at Meta.

1. Clarify schema and definitions

Identify the tables, columns, and grain of the data. Define what 'active' means (e.g., at least one event on a day) and how to label users as 'new' (signed up within the last 28 days) or 'existing'.

2. Compute daily user activity

Aggregate events per user per day to get daily active users and event counts. Use a CTE to avoid double-counting if multiple events occur.

3. Calculate rolling metrics with window functions

For each date and cohort, compute 7-day rolling active rate and average daily events per user over the last 28 days. Use window functions like AVG() OVER (PARTITION BY cohort ORDER BY date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) for 7-day, and similar for 28-day.

4. Adjust for partial observation windows

For users who signed up within the window, adjust denominators to only include days they were observed. This may require calculating the number of days each user was active or observed and using that in the denominator.

5. Output final table and validate

Join and aggregate to produce the final table with date, cohort, active_users, total_users_observed, active_rate_7d, and avg_events_per_user. Validate by checking for double-counting and ensuring rates are between 0 and 1.

Key Points to Mention

  • Use of CTEs to break down the problem and improve readability.
  • Window functions for rolling calculations (e.g., ROWS BETWEEN 6 PRECEDING AND CURRENT ROW for 7-day).
  • Handling partial observation windows by adjusting denominators based on user signup date.
  • Avoiding double-counting by aggregating at the user-day level before applying window functions.
  • Defining cohorts clearly: new users (signed up within last 28 days) vs. existing users.
  • Considering edge cases like users with zero events or missing dates.

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

Q3

Extend your query to stratify results by country, then produce a cohort-level weighted average that controls for country mix differences between the new and existing cohorts.

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

I knew this was a Simpson's paradox setup the second they said 'control for country mix.' Wrote the country-level breakdown first, then did a weighted average using the existing cohort's country distribution as the reference weights.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, extend the query to include country-level breakdowns for both new and existing cohorts, then compute weighted averages using each country's share as weights. To control for country mix differences, use the existing cohort's country distribution as the standard and apply it to the new cohort's country-level metrics. This standardization ensures a fair comparison by removing confounding from differing country compositions.

Pro tip: When presenting, clarify that you're using direct standardization with the existing cohort as the reference population, and mention that this is equivalent to a weighted average where weights are the reference country shares. Also, check for countries with small sample sizes and consider pooling or excluding them to avoid unstable estimates.

1. Stratify by country

Modify the query to group results by country for both new and existing cohorts, ensuring you capture the metric of interest (e.g., conversion rate) and sample sizes per country.

2. Compute country-level metrics

Calculate the metric for each country within each cohort. For rates, compute the numerator and denominator per country to allow proper weighting later.

3. Determine weights

Use the existing cohort's country distribution as the standard weights. Compute each country's share of the total existing cohort population (or relevant denominator).

4. Calculate weighted average

For the new cohort, multiply each country's metric by its corresponding weight from the existing cohort, then sum these products to get the standardized weighted average. Optionally, do the same for the existing cohort to verify it matches the overall existing metric.

5. Validate and interpret

Check that the weighted average for the existing cohort equals its overall metric (if weights are based on it). Compare the standardized new cohort metric to the existing cohort metric to assess the true difference, controlling for country mix.

Key Points to Mention

  • Stratification by country to account for heterogeneity in metrics across countries.
  • Weighted average using country shares as weights to combine country-level metrics.
  • Direct standardization (or post-stratification) to control for confounding by country mix.
  • Choice of reference population (existing cohort) for weights to ensure comparability.
  • Handling of small sample sizes or missing data in certain countries (e.g., pooling, exclusion, or smoothing).
  • Interpretation: the standardized metric represents what the new cohort's metric would be if its country distribution matched the existing cohort's.

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

Q4

Name two bias risks in this analysis and one SQL-side mitigation you actually implemented in your query.

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

Easy to talk through, harder to sound like you're not just reciting a list.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Name two concrete bias risks relevant to the analysis (e.g., selection bias and survivorship bias), then describe a specific SQL-side mitigation you implemented (e.g., using a LEFT JOIN with COALESCE to handle missing data). Keep the answer focused on the query you wrote, not general theory.

Pro tip: Choose biases that are directly tied to the data pipeline or query logic, and explicitly state how your SQL mitigation reduced the bias—this shows you understand both the statistical concept and its practical implementation.

1. Identify the analysis context

Briefly state the analysis you performed (e.g., A/B test on user engagement) to ground the biases in a concrete scenario.

2. Name two bias risks

Select two biases that are plausible given the data and query, such as selection bias (e.g., only including users who logged in) and survivorship bias (e.g., analyzing only users who completed the experiment).

3. Explain the SQL-side mitigation

Describe one specific SQL technique you used to mitigate one of the biases, such as using a LEFT JOIN to include all users, filtering with WHERE clauses to avoid conditioning on post-treatment variables, or using window functions to handle missing data.

4. Connect mitigation to bias reduction

Explain how the SQL mitigation directly addresses the bias risk, e.g., 'By using a LEFT JOIN, I ensured that users with no events were still included, reducing selection bias.'

Key Points to Mention

  • Selection bias: e.g., only including users who were active during the experiment period
  • Survivorship bias: e.g., analyzing only users who remained in the experiment until the end
  • SQL mitigation: e.g., LEFT JOIN to include all users, COALESCE to handle NULLs, or using a subquery to filter pre-treatment
  • Avoiding conditioning on post-treatment variables in WHERE clauses
  • Using window functions to compute metrics without dropping rows
  • Explicitly stating how the mitigation reduces the bias

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