← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Meta Data Scientist technical screen, heavy SQL focus. The whole thing was basically one long multi-part query problem built around survey response rates and quality scoring. Felt like a take-home but live.

Questions Asked (5)

Q1

Given an impressions table, a clicks table, a surveys table, and a survey_responses table, write SQL to compute the daily survey response rate (unique clicked impressions divided by total impressions) broken out by survey version, for a 7-day window ending today.

Product Analytics & MetricsData Modeling
Author's notes

The join to the surveys table to pull in version was the easy part.

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 unique clicked impression, how survey versions are linked). Then, write a SQL query that joins the tables appropriately, filters for the last 7 days, and aggregates daily metrics by survey version, ensuring correct handling of unique counts and division.

Pro tip: Always confirm whether 'unique clicked impressions' means distinct users or distinct click events, and whether the denominator should include only impressions that had a chance to be surveyed. This shows attention to metric definition and avoids misinterpretation.

1. Clarify schema and definitions

Ask about table structures, join keys, and precise definitions of 'unique clicked impressions', 'survey version', and 'daily'. Confirm the time window and timezone.

2. Identify relevant tables and joins

Determine how impressions, clicks, surveys, and survey_responses relate. Typically, impressions link to clicks via impression_id, clicks link to surveys via click_id or survey_id, and survey_responses link to surveys via survey_id.

3. Filter and aggregate daily metrics

Filter all tables to the last 7 days. For each day and survey version, compute total impressions and unique clicked impressions (e.g., COUNT(DISTINCT click_id) or user_id).

4. Compute response rate and handle edge cases

Calculate the ratio of unique clicked impressions to total impressions per day per survey version. Use NULLIF or CASE to avoid division by zero. Consider if multiple surveys per impression affect the denominator.

5. Write and validate SQL

Construct the final SQL with CTEs for clarity, ensuring correct grouping and ordering. Validate with sample data or explain how you'd test for correctness.

Key Points to Mention

  • Definition of 'unique clicked impressions' (distinct users vs. distinct clicks)
  • Join logic between impressions, clicks, surveys, and survey_responses
  • Time window filtering (last 7 days including today, timezone considerations)
  • Handling of division by zero and NULL values
  • Aggregation by day and survey version
  • Potential data quality issues (e.g., multiple surveys per impression, missing links)

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

Q2

Compute the overall response rate for the full 7-day window as a single number, and then also break it out by survey version.

Product Analytics & MetricsData Modeling
Author's notes

Pretty mechanical once you have the daily CTE set up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the definition of response rate (e.g., completed surveys divided by delivered invitations) and confirm the data sources. Then compute the overall rate for the full 7-day window by aggregating all responses and all invitations, and break it out by survey version using the same definition. Present both the overall and segmented rates, and briefly discuss any notable differences.

Pro tip: Always check for data quality issues like duplicate responses or partial completes, and consider whether the 7-day window is consistent across survey versions. Mentioning these nuances shows you think like a data scientist, not just a calculator.

1. Clarify definitions and scope

Confirm what 'response rate' means (e.g., completed surveys / delivered invitations) and ensure the 7-day window is clearly defined for all versions.

2. Aggregate data for overall rate

Sum the total number of completed responses and total invitations across all survey versions for the 7-day period, then compute the overall response rate.

3. Break out by survey version

For each survey version, calculate the response rate using the same formula, ensuring consistent handling of the 7-day window.

4. Validate and sanity-check

Check for anomalies such as missing data, duplicate responses, or version misclassification, and verify that the sum of version-specific numerators and denominators matches the overall totals.

5. Present and interpret

Report the overall rate and the breakdown by version, and briefly comment on any significant differences or trends that could inform product decisions.

Key Points to Mention

  • Definition of response rate: typically completed surveys divided by delivered invitations, but could vary (e.g., including partials).
  • Data aggregation: summing numerators and denominators across versions for the overall rate, not averaging the rates.
  • Consistency of the 7-day window: ensuring the same time period is used for all versions and that no data is double-counted.
  • Handling of edge cases: e.g., surveys with zero invitations, missing version labels, or incomplete responses.
  • Statistical significance: if comparing versions, consider whether differences are meaningful given sample sizes.
  • Business context: why the breakdown matters—e.g., to identify underperforming survey versions or to optimize future surveys.

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

Q3

For the same 7-day window, compute two quality metrics by survey version: one using only each user's chronologically first score per survey, and one averaging all scores including duplicates from the same user.

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

The first-score-only metric needed a ROW_NUMBER() partitioned by user_id and survey_id ordered by ts, then filter to rank = 1.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the data model and define the 7-day window and survey version field. Then, for each metric, write SQL that deduplicates by user using a window function for the first-score metric, and a simple average for the all-scores metric, ensuring both are computed over the same window and grouped by survey version.

Pro tip: Mention that the 'first score' metric is essentially a user-level deduplication to avoid bias from power users, and that you'd validate the difference between the two metrics to understand duplicate behavior—this shows you think about data quality and metric reliability.

1. Clarify requirements and data schema

Confirm the definition of the 7-day window (e.g., rolling or fixed), the survey version field, and how to identify a user. Ask about the expected output format (e.g., one row per survey version with both metrics).

2. Compute first-score metric

Use a window function like ROW_NUMBER() OVER (PARTITION BY user_id, survey_version ORDER BY timestamp) to select each user's first score per survey version, then average those scores grouped by survey version.

3. Compute all-scores metric

Simply average all scores in the 7-day window grouped by survey version, without deduplication, to include duplicates from the same user.

4. Combine and validate results

Join or union the two metrics into a single result set by survey version. Check for anomalies, such as large discrepancies, and consider edge cases like users with no scores or multiple versions.

Key Points to Mention

  • Use of window functions (e.g., ROW_NUMBER) for deduplication
  • Definition of the 7-day window (e.g., date range, rolling window)
  • Grouping by survey version and ensuring consistent aggregation
  • Handling of ties in timestamps for first score (e.g., using additional tiebreaker)
  • Potential bias from duplicate responses and why both metrics matter
  • Efficiency considerations for large datasets (e.g., indexing, partitioning)

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

Q4

Modify your query so that a survey response is only counted if there is a corresponding impression for that user and survey within the same 7-day window, and the response timestamp is at or after the first click for that user and survey on that day. Responses with no matching impression should be excluded.

Data ModelingTechnical Trade-offs
Author's notes

This is where it got messy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the join logic: you need to join survey responses to impressions on user_id and survey_id, with the impression timestamp within 7 days before the response. Then filter to keep only responses where the response timestamp is at or after the first click for that user and survey on the same day, and exclude any responses without a matching impression. Finally, write the modified query using a LEFT JOIN with conditions and a subquery for first click.

Pro tip: Mention that you would use a LEFT JOIN and then filter out NULLs to exclude responses without impressions, but also consider using an INNER JOIN for efficiency if the dataset is large. Also, highlight the importance of handling time zones consistently, as Meta operates globally.

1. Clarify the requirements

Restate the problem to ensure you understand: we need to count survey responses only if there is an impression for the same user and survey within 7 days before the response, and the response timestamp is at or after the first click on that day. Exclude responses with no matching impression.

2. Identify the necessary tables and joins

Determine that you need to join the survey responses table with the impressions table on user_id and survey_id, and also with a clicks table (or subquery) to get the first click per user per survey per day.

3. Construct the join conditions

Use a LEFT JOIN from responses to impressions with the condition that impression timestamp is between response timestamp - 7 days and response timestamp. Also, join to a subquery that calculates the first click timestamp for each user, survey, and day.

4. Apply filters

Filter out rows where the impression is NULL (to exclude responses with no matching impression) and where the response timestamp is before the first click timestamp on that day.

5. Write the final query

Compose the SQL query with the appropriate joins, subqueries, and WHERE clauses, ensuring correct date/time functions and handling of time zones.

Key Points to Mention

  • Use of LEFT JOIN to identify responses without impressions and then filter them out, or INNER JOIN to directly exclude them.
  • The 7-day window condition: impression timestamp >= response timestamp - INTERVAL '7 days' AND impression timestamp <= response timestamp.
  • The need for a subquery or window function to compute the first click per user, survey, and day.
  • The condition that response timestamp >= first click timestamp on the same day.
  • Consideration of time zones and date boundaries (e.g., using DATE_TRUNC or converting to a common time zone).
  • Performance implications: indexing on user_id, survey_id, and timestamps; potential use of window functions for efficiency.

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

Q5

Combine all of the above into a single result set returning: date, survey version, total impressions, unique clicked impressions, response rate, average score using first-only method, and average score using all scores. State any assumptions you make about timezone and missing joins.

Product Analytics & MetricsData ModelingTechnical Trade-offs
Author's notes

I said I'd assume UTC throughout and that impressions with no clicks get a NULL clicked count (treated as 0 for the rate).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and join relationships, then build the query incrementally using CTEs to compute each metric separately before combining them. Explicitly state assumptions about timezone normalization and how missing joins (e.g., surveys with no responses) are handled, and validate the final result set against edge cases.

Pro tip: Mention that you would validate the response rate denominator by checking whether all impressions are tied to a survey version, and consider using a left join from impressions to responses to avoid dropping surveys with zero responses.

1. Clarify schema and join logic

Identify the fact and dimension tables (impressions, clicks, responses, surveys) and determine the correct join keys and granularity. State whether joins are inner or left, and how missing matches affect counts.

2. Define timezone and date handling

Assume all timestamps are in UTC unless specified, and convert to the reporting timezone (e.g., PT) for date grouping. Mention that date truncation should be consistent across all metrics.

3. Compute base metrics with CTEs

Use separate CTEs to calculate total impressions, unique clicked impressions, and response counts per date and survey version. For average scores, use conditional aggregation to compute first-only and all-scores averages.

4. Combine metrics and handle missing data

Join the CTEs on date and survey version, using left joins to preserve all dates/versions. Use COALESCE to replace nulls with zeros for counts and nulls for averages where appropriate.

5. Validate and state assumptions

Check that response rate is between 0 and 1, and that averages are within expected ranges. Explicitly list assumptions about timezone, missing joins, and how first-only is defined (e.g., first response per user per survey).

Key Points to Mention

  • Timezone normalization: assume UTC storage and convert to reporting timezone for date grouping.
  • Join type: use left joins from impressions to responses to include surveys with zero responses.
  • Response rate definition: responses divided by total impressions, with careful handling of zero denominators.
  • First-only average: use ROW_NUMBER() to pick the first response per user per survey version.
  • All-scores average: simple average of all response scores, ignoring nulls.
  • Unique clicked impressions: count distinct users or sessions that clicked, depending on business definition.

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