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
January Rider Retention Rate
00:00
5 left

January Rider Retention Rate

EasySQL · PostgreSQL

Problem

Uber wants to measure early rider retention for users who signed up in January 2024. Write a SQL query to calculate the retention rate for that signup cohort.

Define a retained rider as a rider who signed up in January 2024 and completed at least one trip in February 2024.

Requirements

  1. Identify all riders whose signup_date falls between 2024-01-01 and 2024-01-31.
  2. Count how many riders are in that January 2024 signup cohort.
  3. Count how many of those riders completed at least one trip in February 2024.
  4. Return the cohort month, cohort size, retained riders, and retention rate as a percentage rounded to 2 decimals.

Schema

riders
ColumnTypeDescription
rider_idPKINTUnique rider identifier
rider_nameVARCHAR(100)Rider full name
signup_dateDATEDate the rider signed up for Uber
cityVARCHAR(50)Primary signup city
trips
ColumnTypeDescription
trip_idPKINTUnique trip identifier
rider_idINTRider who requested the trip
trip_dateDATEDate of the trip
trip_statusVARCHAR(20)Trip outcome such as completed or canceled
fare_usdNUMERIC(8,2)Final trip fare in USD
Tablesriderstrips
Interviewer

Your question is January Rider Retention Rate. Start with the requirements and the two 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.