← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

SQL-heavy technical screen for a DS role on the ads measurement side at Meta. Two questions, both tied to the same schema, escalating from a basic share calculation to a full stakeholder-facing time series. Felt more like a take-home prompt than a live interview.

Questions Asked (2)

Q1

Given tables for ad revenue and ad conversions broken out by destination (Facebook Shop vs. external website), write SQL to compute the daily share of revenue going to the Shop destination over the most recent 30 days.

Product Analytics & MetricsData Modeling
Author's notes

Pretty standard pivot-and-divide problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the table schemas and the definition of 'destination' (e.g., a column indicating 'shop' vs 'external'). Then, filter both tables to the most recent 30 days, aggregate revenue and conversions by date and destination, and compute the daily share of revenue from the Shop destination using a window function or self-join.

Pro tip: Mention that you would validate the share calculation by checking that daily shares sum to 1 across destinations and handle edge cases like days with zero total revenue to avoid division errors.

1. Clarify table schemas and definitions

Ask about the columns in the revenue and conversion tables, how 'destination' is represented (e.g., a string column), and whether revenue is already aggregated daily. Confirm the date range definition for 'most recent 30 days' (e.g., relative to current date or max date in data).

2. Filter to the last 30 days

Use a WHERE clause to restrict both tables to the most recent 30 days based on the date column. If the data has multiple rows per day per destination, you may need to aggregate first.

3. Aggregate revenue by date and destination

Sum the revenue for each date and destination (Shop vs. external). Ensure you have one row per date-destination combination.

4. Compute daily total revenue and shop share

Calculate the total revenue per day across all destinations, then compute the share of revenue from the Shop destination as shop_revenue / total_revenue for each day.

5. Handle edge cases and validate

Use NULLIF or CASE to avoid division by zero on days with no revenue. Validate that shares are between 0 and 1 and sum to 1 across destinations for each day.

Key Points to Mention

  • Use of window functions (e.g., SUM() OVER (PARTITION BY date)) to compute daily totals without a self-join.
  • Filtering to the most recent 30 days using a subquery or date functions (e.g., DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY)).
  • Handling of NULLs or zero revenue days to prevent division by zero errors.
  • Ensuring that the share is computed correctly by grouping by date and destination before calculating the ratio.
  • Validation of results by checking that shares sum to 1 per day and that the Shop share is between 0 and 1.
  • Consideration of time zones or date truncation if timestamps are involved.

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

Q2

Using the same two tables, build a stakeholder-ready daily time series for the past 30 days that evaluates performance by destination. It should include revenue, conversions, revenue per conversion, and at least one share-style diagnostic showing whether volume is shifting toward Shop versus the website.

Product Analytics & MetricsData ModelingStakeholder Management
Author's notes

This is where it got more interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the two tables and their join keys, then build a daily time series for the past 30 days that aggregates revenue and conversions by destination. Compute revenue per conversion and a share-style diagnostic (e.g., Shop's share of total conversions or revenue) to track volume shifts, and present the results in a stakeholder-friendly format with clear trends and comparisons.

Pro tip: Always validate the time series for completeness (e.g., missing dates, outliers) and consider adding a rolling average to smooth daily noise, which helps stakeholders see the underlying trend rather than day-to-day fluctuations.

1. Understand the data and define metrics

Identify the two tables, their join keys, and the fields needed for revenue, conversions, and destination. Clarify definitions of 'Shop' vs 'website' and ensure the time period is correctly filtered to the past 30 days.

2. Build the daily time series

Aggregate data by date and destination, summing revenue and conversions. Ensure all dates in the 30-day window are present, filling missing dates with zeros if necessary.

3. Calculate derived metrics

Compute revenue per conversion for each destination and day. Also calculate share-style diagnostics, such as Shop's share of total conversions or revenue, to monitor volume shifts.

4. Validate and refine

Check for anomalies, outliers, or missing data that could skew results. Consider smoothing techniques like 7-day rolling averages to highlight trends.

5. Present for stakeholders

Create clear visualizations (e.g., line charts for trends, stacked area for share) and summarize key insights, focusing on whether volume is shifting toward Shop.

Key Points to Mention

  • Join logic between the two tables and handling of any many-to-one relationships
  • Definition of 'destination' (e.g., Shop vs website) and how it's derived from the data
  • Calculation of revenue per conversion and its interpretation
  • Share-style diagnostic: e.g., Shop's share of total conversions or revenue over time
  • Time series completeness: ensuring all 30 days are represented, handling missing data
  • Stakeholder communication: using clear visuals and highlighting actionable insights

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