Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
7-Day Retention by Integration Signup
00:00
5 left

7-Day Retention by Integration Signup

HardSQL · PostgreSQL

Problem

Asana’s growth team wants to measure whether users acquired through a specific third-party integration come back one week after signup. Write a SQL query to calculate the 7-day retention rate for users who signed up through the Slack integration.

Requirements

  1. Identify users whose signup source is the Slack integration.
  2. Define a retained user as someone who has at least one activity event on the exact date that is 7 days after their signup date.
  3. Return the total number of Slack-signup users, the number retained on day 7, and the retention rate as a percentage rounded to 2 decimals.
  4. Exclude users with a NULL signup timestamp or NULL integration source.

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
signup_tsTIMESTAMPTimestamp when the user signed up for Asana
workspace_idINTWorkspace joined at signup
integration_signups
ColumnTypeDescription
signup_idPKINTUnique integration signup record
user_idINTUser associated with the integration signup
integration_nameVARCHAR(50)Integration credited for acquisition
connected_tsTIMESTAMPTimestamp when the integration was connected
user_events
ColumnTypeDescription
event_idPKINTUnique event identifier
user_idINTUser who performed the event
event_nameVARCHAR(50)Name of the user activity event
event_tsTIMESTAMPTimestamp when the event occurred
Tablesusersintegration_signupsuser_events
Interviewer

Your question is 7-Day Retention by Integration Signup. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.