← Meta Interview Insights

Meta·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

SQL round for a Product Analyst role at Meta. Three questions, all variations on the same calls/users schema, progressively trickier. Nothing brutal but the third one tripped me up a bit.

Questions Asked (3)

Q1

Given a calls table with a pickup flag and call type, write a query returning the total number of calls and the number of picked-up calls broken down by call type.

Product Analytics & Metrics
Author's notes

Pretty standard aggregation warmup.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the table schema and the meaning of the pickup flag (e.g., 1 for picked up, 0 for not). Then write a single aggregation query using GROUP BY call_type, with COUNT(*) for total calls and SUM(pickup_flag) or COUNT(CASE WHEN pickup_flag = 1 THEN 1 END) for picked-up calls. Finally, consider edge cases like NULLs or non-binary flags and mention how you'd validate the results.

Pro tip: Mention that you'd check for NULLs in the pickup flag and decide whether to treat them as not picked up or exclude them, showing attention to data quality. Also, if the flag is stored as a string or boolean, adapt the aggregation accordingly—demonstrating you think about real-world data types.

1. Clarify the schema and definitions

Ask or state assumptions about the calls table columns, especially the pickup flag (e.g., is it 0/1, true/false, or 'Y'/'N'?) and call type. Confirm what 'picked-up' means operationally.

2. Choose the aggregation method

Decide between SUM(pickup_flag) if it's numeric 0/1, or COUNT(CASE WHEN pickup_flag = 1 THEN 1 END) for broader compatibility. Use COUNT(*) for total calls.

3. Write the query with GROUP BY

Construct a SELECT statement with call_type, COUNT(*) AS total_calls, and the picked-up count, then GROUP BY call_type. Optionally add ORDER BY for readability.

4. Handle edge cases and validate

Consider NULLs in pickup flag, call types with no calls, and whether to include all call types or only those present. Mention how you'd test the query with sample data.

Key Points to Mention

  • Use of COUNT(*) for total calls and SUM or conditional COUNT for picked-up calls.
  • GROUP BY call_type to break down metrics by call type.
  • Handling NULLs in the pickup flag (e.g., COALESCE or explicit filtering).
  • Data type of the pickup flag (boolean, integer, string) and adapting the aggregation.
  • Potential need for ORDER BY to present results clearly.
  • Validation: cross-check totals against raw data or use a subquery to ensure no double-counting.

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

Q2

For a given country, compute the pickup rate (as a percentage) for calls placed by senders from that country. You need to join the calls table to a users table to get the sender's country.

Product Analytics & MetricsData Modeling
Author's notes

The join direction matters here and I second-guessed myself for a second.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the metric definition: pickup rate = (calls with status 'picked up' / total calls) * 100, grouped by sender's country. Then write a SQL query that joins the calls table to the users table on sender_id = user_id, groups by country, and computes the percentage using conditional aggregation.

Pro tip: Mention that you would filter out calls with null or invalid sender_id to avoid skewing results, and consider using a LEFT JOIN if you want to include countries with zero calls (though typically an INNER JOIN is fine). Also, discuss how to handle ties or small sample sizes by setting a minimum call threshold.

1. Clarify the metric

Define pickup rate as the percentage of calls that were successfully picked up, and confirm that 'picked up' is indicated by a status column (e.g., status = 'completed' or 'picked_up').

2. Identify tables and join keys

Determine that the calls table contains sender_id and call status, and the users table contains user_id and country. Join on calls.sender_id = users.user_id.

3. Write the aggregation query

Use a GROUP BY on country and compute the pickup rate as 100.0 * SUM(CASE WHEN status = 'picked_up' THEN 1 ELSE 0 END) / COUNT(*).

4. Handle edge cases

Consider filtering out null sender_ids, handling countries with no calls (if needed), and rounding the percentage to two decimal places.

5. Validate and interpret

Check that the sum of picked up calls across countries equals the total picked up calls, and discuss any anomalies or insights from the results.

Key Points to Mention

  • Use of conditional aggregation (CASE WHEN) to count picked up calls.
  • Proper join between calls and users on sender_id = user_id.
  • Grouping by country to compute the rate per country.
  • Handling of NULL or missing sender_id values.
  • Consideration of sample size and potential need for a minimum call threshold.
  • Rounding and formatting the percentage for readability.

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

Q3

What percentage of distinct callers have made at least one video call AND at least one voice call? The denominator should be all distinct senders in the calls table.

Product Analytics & MetricsAlgorithms & Data Structures
Author's notes

This one took me longer than it should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the schema and definitions first: identify the calls table columns for sender, receiver, and call type (video/voice). Then write a SQL query that aggregates per sender to check for at least one video and one voice call, and compute the percentage over all distinct senders.

Pro tip: Explicitly state your assumptions about the data model (e.g., call type values, sender definition) and mention edge cases like senders with only one call type or nulls, showing you think about data quality and real-world messiness.

1. Clarify schema and definitions

Ask or state the columns in the calls table (e.g., sender_id, receiver_id, call_type) and confirm what 'distinct callers' and 'senders' mean. Ensure you know the possible values for call_type (e.g., 'video', 'voice').

2. Identify distinct senders

Use a subquery or CTE to get all distinct sender_ids from the calls table. This will be the denominator.

3. Find senders with both call types

Group by sender_id and use conditional aggregation (e.g., MAX(CASE WHEN call_type='video' THEN 1 ELSE 0 END) = 1 AND MAX(CASE WHEN call_type='voice' THEN 1 ELSE 0 END) = 1) to filter senders who made at least one video and one voice call.

4. Compute the percentage

Count the number of senders from step 3, divide by the count from step 2, and multiply by 100 to get the percentage. Use CAST to float to avoid integer division.

5. Validate and discuss edge cases

Mention potential edge cases: senders with no calls (not in table), null call types, or multiple call types per row. Suggest ways to handle them (e.g., COALESCE, filtering nulls).

Key Points to Mention

  • Use of DISTINCT to get unique senders for the denominator.
  • Conditional aggregation (CASE WHEN) to check for presence of both call types per sender.
  • Handling of potential NULLs or unexpected call_type values.
  • Avoiding integer division by casting to float or multiplying by 100.0.
  • Efficiency considerations: indexing on sender_id and call_type if the table is large.
  • Clarifying whether 'distinct callers' and 'distinct senders' are the same (they are per the question).

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