Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.