PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates a candidate's ability to compute subscription churn and revenue retention metrics from monthly snapshots, exercising SQL data-manipulation competencies such as handling missing or null MRR values, deduplicating snapshot loads, joining across months, and aggregating MRR changes.

  • Medium
  • Intuit
  • Data Manipulation (SQL/Python)
  • Data Scientist

Compute churn and revenue churn in SQL

Company: Intuit

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: HR Screen

You receive monthly end-of-month subscription snapshots and must compute August-2025 churn metrics. Schema and sample data: Table: subscription_monthly_snapshot(user_id STRING, snapshot_date DATE, is_active TINYINT, mrr DECIMAL(10,2)) +---------+---------------+-----------+-------+ | user_id | snapshot_date | is_active | mrr | +---------+---------------+-----------+-------+ | u1 | 2025-07-31 | 1 | 20.00 | | u1 | 2025-08-31 | 0 | 0.00 | | u2 | 2025-07-31 | 1 | 50.00 | | u2 | 2025-08-31 | 1 | 50.00 | | u3 | 2025-07-31 | 1 | 30.00 | | u3 | 2025-08-31 | 1 | 20.00 | | u4 | 2025-07-31 | 0 | 0.00 | | u4 | 2025-08-31 | 1 | 15.00 | | u5 | 2025-07-31 | 1 | 15.00 | | u5 | 2025-08-31 | 0 | 0.00 | | u6 | 2025-07-31 | 1 | 25.00 | | u6 | 2025-08-31 | 1 | 35.00 | | u7 | 2025-07-31 | 1 | 40.00 | | u7 | 2025-08-31 | 0 | 0.00 | +---------+---------------+-----------+-------+ Definitions (use exactly these): - Active on a month = is_active = 1 on that month’s snapshot_date. - Logo churn in August-2025 = customers active on 2025-07-31 but not active on 2025-08-31. - Logo churn rate (Aug-2025) = logo_churn_count / active_count_on_2025-07-31. - Gross revenue churn (Aug-2025) = (MRR lost from logo churns + MRR contractions among customers active on 2025-07-31) / total July-2025 MRR. - Net revenue retention (Aug-2025 cohort) = (July-2025 MRR − churn_loss − contraction + expansion) / July-2025 MRR, where expansion/contraction consider only customers active on 2025-07-31; exclude reactivations/new logos (e.g., u4). Tasks: 1) Write ANSI-SQL that outputs for Aug-2025: logo_churn_count, logo_churn_rate, gross_revenue_churn, net_revenue_retention. Your query must: - Correctly handle customers missing from one of the months (treat missing as is_active = 0, mrr = 0 via full outer join logic). - Deduplicate if multiple snapshots per (user_id, snapshot_date) exist by keeping the latest load (assume a hidden column load_ts exists; if not present, state how you’d resolve deterministically). - Be robust to null mrr values (treat null as 0). 2) State the numeric outputs your SQL would return for this exact sample. 3) Explain how your logic changes if you measure churn mid-month on transactional cancels instead of snapshots (mention grace periods and partial-month proration).

Quick Answer: This question evaluates a candidate's ability to compute subscription churn and revenue retention metrics from monthly snapshots, exercising SQL data-manipulation competencies such as handling missing or null MRR values, deduplicating snapshot loads, joining across months, and aggregating MRR changes.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Calculate Cohort Retention - Intuit (medium)
  • Compute Cohort Retention Rate - Intuit (medium)
  • Compute monthly signups, conversion, and YoY growth - Intuit (easy)
  • Pivot daily users and revenue by platform - Intuit (easy)
  • Design an idempotent churn ETL pipeline - Intuit (Medium)