← Uber Interview Insights

Uber·Data Scientist·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

Uber Data Scientist interview with a fairly involved SQL scenario built around an A/B test. One multi-part question covering joins, filtering, window functions, and conditional aggregation. The kind of problem that feels manageable until you realize how many moving pieces they're actually asking for.

Questions Asked (1)

Q1

Given three tables tracking campaign assignment, user sessions, and orders, write SQL to compute average revenue per user for test vs. control groups, restricted to January 2024 sessions in the SF region. Then, for each treatment arm, return the top three users by order count. Finally, calculate the percentage of users in each arm who placed more than five orders.

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

This one had layers.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the table schemas and relationships, then break the problem into three parts: compute average revenue per user (ARPU) for test vs. control, find top 3 users by order count per arm, and calculate the percentage of users with >5 orders. Use CTEs to modularize the query, ensuring filters (January 2024, SF region) are applied consistently across all parts.

Pro tip: In A/B testing, always verify that the assignment is mutually exclusive and that users are correctly attributed to their groups; also consider whether revenue should be summed per user before averaging to avoid double-counting.

1. Understand the schema and relationships

Identify the three tables (e.g., campaign_assignment, sessions, orders) and their join keys (likely user_id). Clarify how to link sessions to orders and how to filter by region and date.

2. Filter and join relevant data

Create a base dataset by joining campaign_assignment with sessions (filtered to Jan 2024 and SF region) and then with orders. Ensure only users in the experiment are included.

3. Compute ARPU for test vs. control

Aggregate revenue per user, then average by group. Use a CTE to calculate total revenue per user, then average across users in each group.

4. Find top 3 users by order count per arm

Count orders per user per group, then rank users within each group using a window function (e.g., ROW_NUMBER or RANK) and select top 3.

5. Calculate percentage of users with >5 orders per arm

For each group, count users with more than 5 orders and divide by total users in that group, then multiply by 100.

Key Points to Mention

  • Use of CTEs to break down complex logic and improve readability.
  • Application of window functions (e.g., ROW_NUMBER) to rank users within each treatment arm.
  • Handling of date and region filters consistently across all subqueries.
  • Consideration of users with zero orders (left join vs. inner join) and its impact on ARPU and percentages.
  • Ensuring correct grouping by treatment arm (test vs. control) in all aggregations.
  • Potential need to deduplicate sessions or orders if multiple records per user exist.

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