A/B Testing SQL Quant Interview Guide
A/B testing SQL quant interview guide for assignment tables, joins, metrics, aggregation, leakage, examples, and checks.
Candidates querying experiment assignments, metrics, and outcomes.
Experiment SQL starts with assignment
An A/B query should identify the unit of randomization, assignment timestamp, treatment group, and eligible population before computing outcomes.
Metric windows must be consistent
Outcome metrics should be measured after assignment and over the same window across groups. Pre-treatment or future information can bias the result.
Concrete example
To compare conversion, join users to assignment, filter events after assignment, define conversion per user, then aggregate by treatment group.
SQL is not the whole inference
The query computes metrics, but statistical interpretation still needs variance, sample size, randomization, and practical significance.
Common mistakes
Candidates often count events instead of units. If users can have many events, aggregate to the user level before comparing groups.
Practice the pattern
Use the LeetQuidity curriculum and calibration to turn this topic into a focused practice plan.