InterviewStack.io LogoInterviewStack.io

SQL for Growth Analytics Questions

Domain specific SQL patterns used in growth analytics: cohort analysis, retention and churn calculations, funnel analysis for multi step user journeys, acquisition cohort queries, lifetime value computations, customer segmentation, and event aggregation for time series. Emphasis on USING GROUP BY, window functions, CTEs, date bucketing, cohort windows, and efficient joins against event tables to compute retention curves, conversion rates, and growth metrics at scale.

MediumTechnical
71 practiced
For a funnel from signup to purchase, produce SQL that returns percentiles (25th, 50th, 75th) of time from signup to first purchase for each acquisition cohort. The database supports percentile_disc/approx_percentile functions—show both methods and explain performance implications on large purchase event tables.
MediumTechnical
71 practiced
Compute cohort LTV with monthly discounting. Given purchases(user_id, amount, occurred_at) and users(user_id, created_at), write SQL to compute, per monthly acquisition cohort, the discounted cumulative revenue per user for months 0..11 using a monthly discount rate of 5% (i.e., PV = rev / (1 + 0.05)^month_index). Return cohort_month, cohort_size, avg_discounted_ltv_12m.
HardTechnical
121 practiced
Design SQL patterns to stitch sessions across devices where user identifiers are inconsistent. Describe deterministic matching (email hash, login) vs probabilistic matching (device fingerprint, IP patterns). Provide example SQL snippets that perform deterministic joins first and then a probabilistic scoring join for unmatched events, and discuss privacy, collision, and false-positive trade-offs.
MediumTechnical
78 practiced
Write SQL that computes a 7-day rolling conversion rate from 'trial_start' to 'pay' events per country, where rolling is computed by calendar day (i.e., for each day D compute conversions among trials that started in [D-6, D]). Use events(user_id, event_name, occurred_at, country). Explain how to handle users who change country between trial_start and pay.
HardSystem Design
74 practiced
Design an incremental ETL SQL pattern to maintain a daily pre-aggregated cohort table used by dashboards. Requirements: idempotent runs, handle late-arriving events up to 7 days, and ensure correctness if a historical row is reprocessed. Provide pseudo-SQL for MERGE/UPSERT logic and explain how you schedule/partition updates to minimize compute and avoid duplication.

Unlock Full Question Bank

Get access to hundreds of SQL for Growth Analytics interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.