Join users and impressions to find DAU/MAU ratio
Last updated: January 4, 2026
Quick Overview
Write a query joining users and orders to produce the combined DAU/MAU ratio.
Coinbase
Data Manipulation (SQL/Python)
Data Scientist
Coinbase
January 4, 2026Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium
26
7
3,887 solved
Write a query joining users and orders to produce the combined DAU/MAU ratio.
Coinbase asks this during the Onsite because data engineering skills are critical for the role. You should be comfortable with complex joins, window functions, CTEs, and performance optimization.
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
Window functions (ROW_NUMBER, RANK, LAG, LEAD)
Aggregate functions and GROUP BY
Pandas vectorized operations and groupby
JOIN types and when to use each
Date/time manipulation
Subqueries and correlated subqueries
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
- What indexes would you create to support this query?
- Can you rewrite this without using subqueries?
- How would you handle this if the data was spread across multiple databases?
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
To calculate the Daily Active Users (DAU) and Monthly Active Users (MAU) ratio for Coinbase, we need to work with two tables: users and orders. The users table contains user IDs and their ...
Approach
- Identify Relevant Fields: From the users table, we will use
user_idand from the orders table, we will useuser_idandorder_date. - Join Tables: Use an INNER JOIN to connect...
Submit Your Answer
Markdown supported