groupbyratios

The full problem statement is available to Pro members.

preloaded fixtures

import pandas as pd
import numpy as np

usage = pd.DataFrame({
    "user_id": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    "app": ["FitTrack", "FitTrack", "PixelQuest", "PixelQuest", "NoteVault", "FitTrack", "PixelQuest", "MindCalm", "BudgetBee", "BudgetBee"],
    "day": ["2024-03-01", "2024-03-02", "2024-03-01", "2024-03-03", "2024-03-02", "2024-03-04", "2024-03-02", "2024-03-05", "2024-03-01", "2024-03-06"],
    "minutes": [22, 14, 65, 40, 11, 30, 9, 25, 7, 18],
    "crashes": [0, 1, 2, 0, 0, 0, 3, 1, 0, 0],
})
usage["day"] = pd.to_datetime(usage["day"])

receipts = pd.DataFrame({
    "user_id": [1, 1, 2, 3, 4, 5, 5, 6],
    "app": ["FitTrack", "PixelQuest", "PixelQuest", "NoteVault", "FitTrack", "BudgetBee", "PixelQuest", "MindCalm"],
    "amount": [9.99, 4.99, 19.99, 2.99, 9.99, 6.00, 14.99, 12.50],
    "country": ["USA", "USA", "UK", "USA", "Germany", "USA", "USA", "UK"],
})

Guest mode · solve history stays on this device; code isn’t saved. Sign in to save future work

Pro problem

“Crash rate per app”

This is one of the real interview questions in Pro. Try Pro free for 7 days to unlock it and everything below:

  • 293 interview-grade problems across SQL, Python & pandas
  • 104+ real-world SQL problems: SaaS retention, fintech ledgers, supply chain, recursive CTEs
  • 18 company interview packs (Amazon, Meta, Google, Uber and more)
  • AI "explain my mistake" tutor and mock interviews
  • Use QueryLab inside Claude, Cursor & other AI assistants

// built for real interview rounds

Practice the patterns 18 top companies test

329 problems · 36 free forever · 293 unlocked with Pro

Card required. Then $12/month. Cancel before your trial ends and you pay nothing.

or keep practicing free problems →

Secure checkout by Paddle · instant access · cancel anytime from your account