Join orders and users to find DAU/MAU ratio
Last updated: February 3, 2026
Quick Overview
Write a query joining orders and impressions to produce the combined DAU/MAU ratio.
Uber
Data Manipulation (SQL/Python)
Data Scientist
Uber
February 3, 2026Data Scientist
Take-home Project
Data Manipulation (SQL/Python)
Medium
193
8
696 solved
Write a query joining orders and impressions to produce the combined DAU/MAU ratio.
This question from Uber's Take-home Project tests practical data skills. The interviewer wants to see clean, efficient queries that handle edge cases like NULLs, duplicates, and large datasets.
What the Interviewer Expects
- Use advanced SQL features: window functions, CTEs, subqueries
- Write efficient queries that avoid common performance pitfalls
- Handle complex data transformations with multiple joins and aggregations
- Discuss indexing strategy and query optimization
- Address data quality issues: duplicates, missing values, outliers
Key Topics to Cover
JOIN types and when to use each
Pandas vectorized operations and groupby
Date/time manipulation
Aggregate functions and GROUP BY
Data cleaning and transformation
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you handle this if the data was spread across multiple databases?
- How would you optimize this query for a table with 100 million rows?
- How would you validate the correctness of your query results?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Problem Understanding
In this problem, we need to analyze user engagement by calculating the Daily Active Users (DAU) and Monthly Active Users (MAU) ratio for Uber based on orders and impressions data. The orders table c...
Approach
- Identify Relevant Fields: We need the user ID and the timestamp from both the
ordersandimpressionstables. - Extract Unique Users: Use a CTE to extract unique user IDs for DAU from t...
Submit Your Answer
Markdown supported