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 SQL for Conversion Lift
00:00
5 left

Cohort SQL for Conversion Lift

MediumSQL · PostgreSQL

Problem

Write a SQL query to compare merchant conversion before and after a new capital offer flow launch, using cohort-level metrics at Parafin. Assume the launch date is 2024-07-01. Treat a merchant as converted within a period if any qualifying offer event has status converted.

Output

  1. One row per signup-month cohort with at least one offer before or after launch
  2. Include cohort_month, pre-launch and post-launch offered merchant counts, converted merchant counts, conversion rates, and conversion-rate change
  3. Sort by cohort_month ascending

Schema

merchants
ColumnTypeDescription
merchant_idPKINTUnique merchant identifier
signup_dateDATEDate the merchant joined Parafin
segmentVARCHAR(50)Merchant business segment
capital_offer_events
ColumnTypeDescription
event_idPKINTUnique capital offer event identifier
merchant_idINTMerchant associated with the offer event
event_dateDATEDate of the offer event
flow_versionVARCHAR(20)Capital offer flow version used
statusVARCHAR(20)Outcome of the offer event
Tablesmerchantscapital_offer_events
Interviewer

Your question is Cohort SQL for Conversion Lift. 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.