PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Data Manipulation (SQL/Python)/Chime

Compute early signals for user retention

Last updated: Mar 29, 2026

Quick Overview

This question evaluates the ability to compute cohort-based early engagement metrics and Day-30 retention using time-windowed joins, aggregation, bucketing, and handling edge cases such as users with zero or pre-signup transactions.

  • easy
  • Chime
  • Data Manipulation (SQL/Python)
  • Data Scientist

Compute early signals for user retention

Company: Chime

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Technical Screen

You are given two tables that track signups and user transactions. ## Tables ### `users` - `user_id` (STRING, **PK**) — unique user - `signup_ts` (TIMESTAMP) — time the user signed up (assume UTC) ### `transactions` - `transaction_id` (STRING, **PK**) - `user_id` (STRING, **FK → users.user_id**) - `transaction_ts` (TIMESTAMP) — time of transaction (UTC) - `amount` (NUMERIC) — transaction amount ## Task You want an **early signal** that predicts **Day-30 retention**. 1) Define an **early engagement metric** as the number of transactions a user makes in the first **7 days after signup**: - `early_txn_cnt` = count of `transactions` where `transaction_ts >= signup_ts` and `transaction_ts < signup_ts + 7 days`. 2) Define **Day-30 retention** as whether the user has **at least one transaction** in the window **[signup + 30 days, signup + 37 days)**. - `is_retained_d30` ∈ {0,1} 3) Write a SQL query that outputs retention performance by early-engagement bucket: - Bucket `early_txn_cnt` into: `0`, `1`, `2`, `3+` ## Required output Return one row per bucket with: - `early_txn_bucket` - `users_in_bucket` - `retained_users` - `retention_rate` (= `retained_users` / `users_in_bucket`, as a decimal) ## Notes / assumptions - Include users with zero transactions. - If a user has transactions before `signup_ts`, ignore them. - If multiple transactions occur in the retention window, the user still counts as retained once.

Quick Answer: This question evaluates the ability to compute cohort-based early engagement metrics and Day-30 retention using time-windowed joins, aggregation, bucketing, and handling edge cases such as users with zero or pre-signup transactions.

Related Interview Questions

  • Write SQL for noisy A/B launch metrics - Chime (Medium)
  • Write rolling-window SQL over weekly cohorts - Chime (Medium)
  • Analyze Acquisition Channels for User Value and Retention - Chime (Medium)
Chime logo
Chime
Nov 6, 2025, 12:00 AM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
4
0

You are given two tables that track signups and user transactions.

Tables

users

  • user_id (STRING, PK ) — unique user
  • signup_ts (TIMESTAMP) — time the user signed up (assume UTC)

transactions

  • transaction_id (STRING, PK )
  • user_id (STRING, FK → users.user_id )
  • transaction_ts (TIMESTAMP) — time of transaction (UTC)
  • amount (NUMERIC) — transaction amount

Task

You want an early signal that predicts Day-30 retention.

  1. Define an early engagement metric as the number of transactions a user makes in the first 7 days after signup :
  • early_txn_cnt = count of transactions where transaction_ts >= signup_ts and transaction_ts < signup_ts + 7 days .
  1. Define Day-30 retention as whether the user has at least one transaction in the window [signup + 30 days, signup + 37 days) .
  • is_retained_d30 ∈ {0,1}
  1. Write a SQL query that outputs retention performance by early-engagement bucket:
  • Bucket early_txn_cnt into: 0 , 1 , 2 , 3+

Required output

Return one row per bucket with:

  • early_txn_bucket
  • users_in_bucket
  • retained_users
  • retention_rate (= retained_users / users_in_bucket , as a decimal)

Notes / assumptions

  • Include users with zero transactions.
  • If a user has transactions before signup_ts , ignore them.
  • If multiple transactions occur in the retention window, the user still counts as retained once.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Chime•More Data Scientist•Chime Data Scientist•Chime Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)
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.