Ctrl K
Data Analyst · Product Analyst · Mid-level · Coding

There's a users table with the columns user_id and signup_date, and an events table with the columns user_id and event_time. Write a SQL query that, for each weekly signup cohort, returns the cohort size and day-7 retention: the share of users who had at least one event exactly seven days after signing up.

~15 min by voice

How to approach it

The interviewer wants to see whether you can compute a product metric correctly in SQL. It's important not to lose users without events from the denominator, not to multiply rows with a join, not to get zero from integer division, and not to distort fresh cohorts. Just as important is clarifying the definition of the metric first, and only then writing code.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsHow would you calculate user retention for a mobile app? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~15 min