Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL for Channel Sign-Ups and Growth

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL for Channel Sign-Ups and Growth. Start with the requirements and the two tables on the right.

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.

Problem

Turing's Product Growth team needs a weekly view of candidate acquisition performance. Write a PostgreSQL query that reports sign-ups and application conversion by acquisition channel.

A candidate is considered converted when they submit at least one Turing application within seven days after signing up. Include acquisition channels with sign-ups even when no candidate converted.

Requirements

  1. Group sign-ups by the Monday of the signup week and acquisition_channel.
  2. Calculate weekly sign-ups, converted candidates, and conversion rate as a percentage.
  3. Calculate week-over-week sign-up growth for the same acquisition channel. Return NULL when no prior-week comparison exists.
  4. Include the supplied reporting period from January 1 through January 31, 2025, and sort by week followed by acquisition channel.

Schema

users
ColumnTypeDescription
user_idPKINTUnique Turing candidate identifier
signup_atTIMESTAMPTimestamp when the candidate created an account
acquisition_channelVARCHAR(50)Marketing acquisition source
applications
ColumnTypeDescription
application_idPKINTUnique application identifier
user_idINTCandidate who submitted the application
submitted_atTIMESTAMPApplication submission timestamp
Tablesusersapplications
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results