← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Meta DS technical screen, three SQL problems back to back with a shared schema. The questions escalated pretty fast from basic aggregation to funnel metrics with dedup logic. Felt like a timed exam more than a conversation.

Questions Asked (3)

Q1

Given a posts table and a comments table, for each calendar day compute the total number of posts created and what percentage of those posts received at least one non-deleted comment within 24 hours of the post being created.

Product Analytics & MetricsData Modeling
Author's notes

The is_deleted filter is easy to forget under pressure and I almost did.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and definitions (e.g., what counts as a post, comment, non-deleted, and the 24-hour window). Then outline a SQL solution using a LEFT JOIN between posts and comments with a time condition, aggregate per post to flag if it received a qualifying comment, and finally group by post date to compute daily totals and percentages.

Pro tip: Mention that you would validate the 24-hour window using timestamp differences and consider time zones, as Meta operates globally and day boundaries can shift. Also, discuss how to handle posts with no comments (they should count in the denominator but not numerator).

1. Clarify requirements and schema

Ask about table structures, definitions of 'non-deleted', and whether the 24-hour window is inclusive. Confirm that the percentage is based on posts created each day, not comments.

2. Identify posts with qualifying comments

Use a subquery or CTE to join posts with comments on post_id, filter for non-deleted comments, and check if comment timestamp is within 24 hours of post creation. Then flag each post as having at least one such comment.

3. Aggregate per post and per day

Group by post to get a binary flag per post, then group by the post's creation date to count total posts and sum the flag to get the number of posts with comments.

4. Compute percentage and handle edge cases

Calculate the percentage as (posts with comments / total posts) * 100. Ensure days with zero posts are handled (e.g., excluded or shown as 0%).

5. Optimize and validate

Consider indexing on post_id and timestamps, and validate results with a small sample. Discuss potential performance issues with large datasets.

Key Points to Mention

  • Use of LEFT JOIN to ensure posts without comments are included in the denominator.
  • Time window logic: comment timestamp between post creation and post creation + 24 hours.
  • Filtering out deleted comments (e.g., is_deleted = false).
  • Grouping by post creation date (calendar day) and handling time zones.
  • Calculating percentage as a ratio of distinct posts with comments to total posts.
  • Performance considerations: indexing, partitioning, and avoiding cross joins.

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

Q2

For the past 30 days, find the top 3 users by their rate of posts that received at least one non-deleted comment within 24 hours. Only include users with at least 5 posts. Break ties by higher post count first, then lower user_id.

Product Analytics & MetricsAlgorithms & Data Structures
Author's notes

This builds directly on the first question which is either helpful or a trap depending on how you structured your CTE.

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 post, comment, and non-deleted). Then outline a SQL-based solution that computes per-user post counts and the number of posts with a qualifying comment within 24 hours, filters users with at least 5 posts, calculates the rate, and ranks users with the specified tie-breaking rules.

Pro tip: Explicitly state your assumptions about the data model (e.g., timestamps, deletion flags) and mention how you would handle edge cases like posts with no comments or users with exactly 5 posts. This shows attention to detail and prevents misinterpretation.

1. Clarify requirements and data model

Ask clarifying questions about the tables (users, posts, comments), definitions of 'non-deleted comment', 'within 24 hours', and whether the 30-day window applies to post creation or comment creation. Confirm tie-breaking rules.

2. Filter posts and comments for the period

Select posts created in the last 30 days and comments that are non-deleted. Ensure you consider only comments made within 24 hours of the post's creation time.

3. Compute per-user metrics

For each user, count total posts (with at least 5 posts) and count posts that received at least one qualifying comment within 24 hours. Compute the rate as qualifying posts divided by total posts.

4. Rank and select top 3 users

Order users by rate descending, then by total post count descending, then by user_id ascending. Select the top 3.

5. Validate and discuss edge cases

Mention potential edge cases: posts with multiple comments, comments exactly at 24 hours, users with exactly 5 posts, and how to handle ties beyond the top 3. Suggest validating results with a small sample.

Key Points to Mention

  • Use of window functions (e.g., ROW_NUMBER) or subqueries to rank users with tie-breaking.
  • Definition of 'rate': qualifying posts / total posts, ensuring denominator is total posts in the 30-day window.
  • Handling of time zones and timestamp precision for the 24-hour window.
  • Filtering out deleted comments and ensuring comments are linked to posts correctly.
  • Efficiency considerations: indexing on post creation date and comment timestamps.
  • Assumption that a post can have multiple comments but only needs one qualifying comment to count.

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

Q3

For the reengage_v1 email campaign, compute daily unique open rate and click-through rate. The denominator should be delivered sends only (exclude bounced sends). Count at most one open and one click per send_id. Return campaign, date, delivered send count, unique opens, unique clicks, open rate, and CTR.

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

This one got me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data model and definitions (e.g., what constitutes a delivered send, an open, and a click). Then outline a SQL-based approach that filters to the campaign, excludes bounced sends, deduplicates opens and clicks per send_id, and aggregates daily metrics. Finally, compute open rate and CTR as unique opens/clicks divided by delivered sends, ensuring the denominator is correct.

Pro tip: Always confirm whether 'delivered' means successfully sent (excluding bounces) or also excluding unsubscribes/complaints; in many email systems, delivered = sent - bounced. Also, consider time zone alignment for daily aggregation, as opens/clicks may be recorded in UTC while the business expects local dates.

1. Clarify definitions and data model

Ask about the schema: how sends, opens, and clicks are tracked (e.g., separate event tables or flags). Confirm that 'delivered' excludes bounced sends and that unique opens/clicks are per send_id.

2. Filter and deduplicate events

Filter to campaign 'reengage_v1' and exclude bounced sends. For opens and clicks, use DISTINCT on send_id (and date) to count at most one per send per day.

3. Aggregate daily metrics

Group by campaign and date. Count delivered sends, unique opens, and unique clicks. Ensure the date is derived consistently (e.g., from send timestamp or event timestamp).

4. Compute rates

Calculate open rate = unique opens / delivered sends, and CTR = unique clicks / delivered sends. Use safe division to avoid divide-by-zero errors.

5. Validate and present results

Sanity-check numbers (e.g., opens ≤ delivered, clicks ≤ opens). Present the final table with campaign, date, delivered sends, unique opens, unique clicks, open rate, and CTR.

Key Points to Mention

  • Denominator should be delivered sends only (exclude bounced sends).
  • Count at most one open and one click per send_id (deduplication).
  • Daily aggregation: group by date, which may require time zone conversion.
  • Use DISTINCT or window functions to ensure uniqueness.
  • Handle divide-by-zero when computing rates.
  • Validate that unique opens and clicks do not exceed delivered sends.

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