Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Analyze Experiment Lift by Variant

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

Your question is Analyze Experiment Lift by Variant. 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

You are given assignment data for a product experiment on the TurboTax onboarding flow and a table of downstream user actions. Write a SQL query that compares treatment and control performance for users assigned during January 2024. Return one row per variant with the number of assigned users, the number of converters, conversion rate, average revenue per assigned user, and the lift in conversion rate versus control. Treat a user as converted if they have at least one start_return event within 7 days of assignment. Include assigned users even if they never generated an event.

Schema

experiment_assignments
ColumnTypeDescription
assignment_idPKINTUnique assignment record
user_idINTUser assigned to the experiment
variantVARCHAR(20)Experiment variant such as control or treatment
assigned_atDATEDate the user was assigned
surfaceVARCHAR(50)Intuit product surface where the experiment ran
user_events
ColumnTypeDescription
event_idPKINTUnique event record
user_idINTUser who generated the event
event_nameVARCHAR(50)Name of the product event
event_dateDATEDate the event occurred
revenueDECIMAL(10,2)Revenue associated with the event
Tablesexperiment_assignmentsuser_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results