← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Meta DS interview with a SQL-heavy technical screen. Two questions back to back, both pulling from the same notification/survey dataset. Not a vibe check, they wanted to see you think through join semantics and aggregation grain in real time.

Questions Asked (2)

Q1

Using a surveys table and a survey responses table, write a SQL query that computes the overall survey response rate, defined as the number of responses divided by the number of surveys sent. Make sure to handle the case where some surveys have no response.

Product Analytics & MetricsData Modeling
Author's notes

My first instinct was an inner join and I almost went with it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the schema and definitions first, then write a SQL query that counts distinct surveys sent and responses received, using a LEFT JOIN or subqueries to handle surveys with no responses. Compute the response rate as responses divided by surveys sent, ensuring the denominator includes all surveys sent even if they have zero responses.

Pro tip: Mention that you would validate the response rate by checking for edge cases like duplicate responses or surveys sent to the same user multiple times, and consider whether to use COUNT(DISTINCT) to avoid overcounting.

1. Clarify schema and definitions

Ask about the table structures: what columns exist in surveys and survey_responses, and how they relate (e.g., survey_id). Confirm that 'surveys sent' means all records in the surveys table, and 'responses' means records in the responses table.

2. Choose the right join or subquery approach

Decide between using a LEFT JOIN from surveys to responses to include surveys with no responses, or using separate subqueries to count surveys and responses independently. Both are valid; LEFT JOIN is more intuitive for this metric.

3. Write the SQL query

Construct the query: SELECT COUNT(r.survey_id) * 1.0 / COUNT(DISTINCT s.survey_id) AS response_rate FROM surveys s LEFT JOIN survey_responses r ON s.survey_id = r.survey_id; or use subqueries. Ensure proper handling of NULLs and division by zero.

4. Validate and discuss edge cases

Mention potential issues: duplicate responses per survey, surveys sent to multiple users, or missing survey_id in responses. Suggest using COUNT(DISTINCT) for responses if duplicates are possible, and consider if the denominator should be distinct surveys or total sends.

Key Points to Mention

  • Use LEFT JOIN to include surveys with no responses.
  • Use COUNT(DISTINCT) to avoid overcounting if there are duplicate responses or multiple sends.
  • Handle division by zero (e.g., using NULLIF or CASE).
  • Clarify whether 'surveys sent' means distinct surveys or total survey invitations.
  • Consider if response rate should be computed per survey or overall.
  • Validate results with sanity checks (e.g., rate between 0 and 1).

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

Q2

Write a query that compares the average survey rating between new users (signed up less than 30 days before the survey was sent) and existing users. Think carefully about how you define and control the aggregation level.

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

This one tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, define the aggregation level: one row per survey response, with a flag indicating whether the user was new (signed up <30 days before survey sent). Then compute the average rating for each group, ensuring you filter to only valid responses and handle potential duplicates. Finally, compare the averages, possibly with a statistical test or confidence intervals.

Pro tip: Always clarify the grain of your data before writing the query—many candidates mistakenly aggregate at the user level instead of the survey response level, which can skew results if users have multiple responses. Also, consider using a window function or subquery to avoid double-counting users who may have multiple surveys.

1. Clarify the aggregation level

Determine whether the analysis should be at the survey response level or user level. Typically, each survey response is a separate observation, so aggregate at that level unless instructed otherwise.

2. Define new vs. existing users

Calculate the time difference between signup date and survey sent date. Flag users as 'new' if the difference is less than 30 days, otherwise 'existing'.

3. Filter and clean data

Exclude invalid or incomplete survey responses (e.g., null ratings) and ensure each survey response is unique. Consider deduplicating if necessary.

4. Compute average ratings by group

Use a GROUP BY on the user type flag to calculate the average rating for new and existing users separately.

5. Compare and interpret

Present the averages side by side, and optionally include counts and a statistical test (e.g., t-test) to determine if the difference is significant.

Key Points to Mention

  • Aggregation level: survey response vs. user level, and why it matters
  • Definition of 'new user': signed up <30 days before survey sent
  • Handling of multiple survey responses per user (deduplication or weighting)
  • Filtering out invalid or incomplete responses
  • Use of SQL window functions or subqueries to compute time difference
  • Statistical significance testing to compare averages

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