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
Cohort Conversion Before vs After
00:00
5 left

Cohort Conversion Before vs After

HardSQL · PostgreSQL

Problem

Santander wants to evaluate the impact of a campaign promoting the Santander Edge current account. Write a PostgreSQL query that compares each customer signup cohort's conversion rate during the 30 days before campaign exposure with the 30 days after exposure.

Requirements

  1. Consider only participants in Santander Edge Spring 2024.
  2. Define conversion as at least one approved application for the Santander Edge account in the relevant 30-day period.
  3. Return one row per signup cohort with cohort size, before and after conversion counts, conversion rates, and the percentage-point lift after the campaign.
  4. Use a left join for applications so customers without applications remain in the denominator. Order by cohort month.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique Santander customer identifier
customer_nameVARCHAR(100)Customer name
signup_dateDATEDate the customer signed up
campaign_participants
ColumnTypeDescription
customer_idPKINTCustomer exposed to a campaign
campaign_nameVARCHAR(150)Campaign name
campaign_start_dateDATEDate used as the campaign exposure boundary
campaign_channelVARCHAR(30)Channel through which the campaign was delivered
applications
ColumnTypeDescription
application_idPKINTUnique product application identifier
customer_idINTCustomer who submitted the application
application_dateDATEDate the application was submitted
approvedBOOLEANApplication approval status
product_nameVARCHAR(100)Product requested in the application
Tablescustomerscampaign_participantsapplications
Interviewer

Your question is Cohort Conversion Before vs After. 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.