Chime·Data Scientist·Technical Phone Screen
- Given a multi-table schema for an A/B experiment (users, exposures, sessions, orders), write a single PostgreSQL query using CTEs that: assigns each user to their earliest exposure variant and drops crossovers, filters to non-bot qualified users, and computes per-variant and per-country (US/CA only) metrics including 14-day converters, conversion rate, revenue from non-refunded orders, and refund rate. Also exclude orders in a specific outage window for iOS users.
- Write a second SQL query that performs a chi-square goodness-of-fit test for sample ratio mismatch across variants among qualified users, assuming a 50/50 expected split. Output observed counts per variant, expected count, the chi-square statistic, and an approximate p-value using only built-in functions like ln(), exp(), and power().
“This took me way longer to structure than I expected.”