← Meta Interview Insights

Meta·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

SQL-heavy technical screen for a DS role at Meta. Two questions, both around aggregations and joins, but the second one had enough edge cases to slow me down a bit.

Questions Asked (2)

Q1

Given a table of buyer-seller listing interactions and a product dimension table, write SQL to find how many sellers have more than 3 distinct products where that product's total interaction count (summed across all rows for that seller-product pair) is greater than 1.

Product Analytics & MetricsData Modeling
Author's notes

The definition of 'multiple interactions' tripped me up at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Break the problem into two stages: first, aggregate interactions per seller-product pair to filter those with total count > 1, then join with the product dimension to ensure distinct products, and finally count sellers with more than 3 such products. Use a subquery or CTE to compute the aggregated counts, then apply a HAVING clause on the seller level.

Pro tip: Clarify whether 'distinct products' means unique product IDs or unique product names; in a product dimension table, these might differ. Also, consider if interactions should be counted only for valid products (e.g., not deleted) and if the interaction table might have duplicates that need deduplication before summing.

1. Understand the tables and relationships

Identify the interaction table (buyer-seller listing interactions) and the product dimension table. Determine the join key (likely product_id) and the seller identifier (seller_id).

2. Aggregate interactions per seller-product

Group the interaction table by seller_id and product_id, summing the interaction count (or counting rows) to get total interactions per pair. Filter to only those with total > 1.

3. Join with product dimension

Join the aggregated result with the product dimension table on product_id to ensure we are considering valid products and to potentially use product attributes if needed for distinctness.

4. Count distinct products per seller

Group by seller_id and count distinct product_id (or product_key) from the filtered set. Then filter sellers having count > 3.

5. Final count of sellers

Count the number of sellers that satisfy the condition. Optionally, return the seller list or just the count as required.

Key Points to Mention

  • Use of CTEs or subqueries for readability and logical separation.
  • Correct aggregation: SUM(interaction_count) vs COUNT(*) depending on table structure.
  • Filtering with HAVING after GROUP BY to apply conditions on aggregates.
  • Ensuring distinct products: COUNT(DISTINCT product_id) after filtering.
  • Handling potential NULLs or duplicates in the interaction table.
  • Considering performance implications: indexing on join keys and grouping columns.

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

Q2

Among products created in the US within the last 7 days, what percentage of total listing interactions comes from the 'vehicle' category? Return the result as a value between 0 and 100.

Product Analytics & MetricsData Modeling
Author's notes

This one felt straightforward until I started writing it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the definitions of 'products created in the US within the last 7 days', 'total listing interactions', and 'vehicle category'. Then outline a SQL-based approach that joins product, listing, and interaction tables, filters by creation date and country, and computes the percentage of interactions from vehicle listings.

Pro tip: Always confirm the time zone and whether 'created' refers to product creation or listing creation, as this can significantly affect the result. Also, consider if interactions should be counted per listing or per product.

1. Clarify Definitions

Define 'product created in the US', 'last 7 days', 'listing interactions', and 'vehicle category'. Confirm whether interactions are unique users, total events, or something else.

2. Identify Data Sources

Locate the relevant tables: products (with creation date and country), listings (linked to products and categories), and interactions (linked to listings).

3. Filter and Join Data

Filter products created in the US within the last 7 days. Join with listings and interactions to get all interactions for those products.

4. Aggregate and Compute Percentage

Sum interactions for vehicle category and total interactions. Compute (vehicle interactions / total interactions) * 100.

5. Validate and Present

Check for data quality issues (e.g., nulls, duplicates) and ensure the result is between 0 and 100. Present the final percentage.

Key Points to Mention

  • Definition of 'product created in the US' (e.g., based on seller location or product origin)
  • Time zone considerations for 'last 7 days'
  • Definition of 'listing interactions' (views, clicks, messages, etc.)
  • How to handle products with multiple listings or categories
  • Data quality checks (e.g., missing country, missing category)
  • SQL techniques: joins, filters, aggregation, and percentage calculation

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