← Yahoo Interview Insights

Yahoo·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

Yahoo DS interview with a meaty SQL question that took up the whole session. The problem looked like a standard DAU diagnostic but had enough edge cases layered in that I was still untangling things near the end of my time.

Questions Asked (1)

Q1

Write a single SQL query to diagnose a country-level DAU drop for an email product. Compare DAU on 2025-09-01 to the average DAU over the prior 7 days (2025-08-25 through 2025-08-31). Exclude bot events and users in the treatment arm of an active experiment. Output the top 3 countries by absolute DAU drop with columns for country, 7-day average DAU, today's DAU, absolute drop, and percent drop. Also break out today's DAU into returning vs new users. Break ties by larger drop percent.

Product Analytics & MetricsRoot Cause AnalysisA/B Testing & Experimentation
Author's notes

The experiment exclusion tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and definitions (e.g., how to identify bot events, experiment treatment users, and new vs returning users). Then structure the query using CTEs to compute daily DAU per country for the prior 7 days and the target date, apply filters for bots and experiment treatment, and finally calculate the drop metrics and rank countries. Ensure the final output includes the required columns and breaks down today's DAU into returning and new users.

Pro tip: Always confirm the definition of 'new user' (e.g., first-ever activity vs first activity in the period) and whether the experiment exclusion applies to all days or only the target date; these details can significantly affect the results.

1. Clarify definitions and schema

Ask about table structures, bot identification, experiment assignment, and new vs returning user definitions. Confirm the date range and that the experiment is active during the period.

2. Filter and aggregate daily DAU

Write a CTE to filter out bot events and users in the treatment arm, then aggregate distinct users per country per day for the prior 7 days and the target date.

3. Compute 7-day average and drop metrics

Join the aggregated data to calculate the 7-day average DAU per country, then compute absolute drop (avg - today) and percent drop ((avg - today)/avg * 100).

4. Break down today's DAU into returning vs new

Use a subquery or join to classify today's users as returning (active before 2025-09-01) or new (first activity on 2025-09-01), and count them per country.

5. Rank and select top 3 countries

Order countries by absolute drop descending, then by percent drop descending for ties, and limit to top 3. Output all required columns.

Key Points to Mention

  • Use of CTEs for readability and modularity
  • Filtering out bot events (e.g., WHERE is_bot = FALSE)
  • Excluding users in the treatment arm of the experiment (e.g., WHERE experiment_group != 'treatment')
  • Defining new vs returning users based on first activity date
  • Handling ties by larger percent drop
  • Ensuring the 7-day average is computed over the correct date range (2025-08-25 to 2025-08-31)

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