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.
HardSystem Design
65 practiced
Design an incremental SQL pipeline that updates a daily retention matrix (cohort_week x day_number) without recomputing all history. Describe the schema of intermediate tables/materialized views, the incremental SQL logic (upserts or merges), and how you would handle late-arriving / backfilled events.
MediumTechnical
82 practiced
Write SQL to compute the lifetime conversion funnel where users can convert multiple times, but we only care about the first conversion per user. Given events(user_id, event_name, occurred_at) where event_name='signup' and 'purchase', compute, per signup_week, the fraction of users who made their first purchase within 0,7,30 days. Use PostgreSQL.
MediumTechnical
64 practiced
Write SQL to compute a conversion funnel breakdown per day that also includes time to convert median for users who converted that day.Schema:For each day, compute: visits, signups, purchases, conversion_rate (signups/visits), median_time_to_purchase_seconds for users who purchased within 14 days of signup on that day. Provide PostgreSQL SQL using percentile_cont for median.
events(user_id, event_name, occurred_at)EasyTechnical
76 practiced
A product manager asks for 30-day LTV per acquisition cohort.Tables:Write SQL to compute, for each signup_week, the average revenue per user (ARPU) within their first 30 days. Return: signup_week, users, total_revenue_30d, arpu_30d.Use PostgreSQL; assume timezone UTC.
users(user_id BIGINT, signup_date DATE, utm_campaign TEXT)
purchases(user_id BIGINT, amount NUMERIC, purchased_at TIMESTAMP)HardTechnical
92 practiced
Write SQL to compute cohort retention using array_agg to list active users per day for a cohort week. Schema:Produce: cohort_week, day_number, active_user_ids (array). Discuss memory and performance implications and when this approach is appropriate.
users(user_id, signup_date)
events(user_id, occurred_at)Unlock Full Question Bank
Get access to hundreds of SQL for Growth Analytics interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.