Forward-Fill Sparse App Version Fields to Compute Crash Rate per Version

Last updated: November 29, 2026

Quick Overview

Facebook app telemetry logs sessions (device_id, session_ts, app_version, crashed) where app_version is only populated on the first session after an install or update and null otherwise. Carry the last known version forward per device and compute crashes per 1,000 sessions per version.

Meta
Data Manipulation (SQL/Python)
Software Engineer
Meta
November 29, 2026
Software Engineer
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Facebook app telemetry logs sessions (device_id, session_ts, app_version, crashed) where app_version is only populated on the first session after an install or update and null otherwise. Carry the last known version forward per device and compute crashes per 1,000 sessions per version.

Release quality at Meta is tracked by crash rate per app version, and logging often only stamps version on state changes to save bytes. The question checks groupby ffill within device, sorting before filling, handling sessions before any known version, and normalizing crashes by exposure.

What the Interviewer Expects
  • Sort by device and time before filling
  • Forward-fill within each device so values do not leak across devices
  • Label sessions before the first known version as unknown
  • Normalize crashes per 1,000 sessions, not raw counts
  • Include session counts to show which rates are reliable
Key Topics to Cover
groupby ffill
sorting
rate normalization
telemetry
release quality
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you compare crash rates between a version in 1 percent rollout and the stable one fairly?
  • What if a device downgrades versions?
  • How would you compute a confidence interval for each crash rate?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

sessions(device_id, session_ts, app_version, crashed), crashed is 0 or 1. Version persists until the next non-null value on that device. Sessions before a device's first version stamp are 'unknown'....

Approach

Sort by device and timestamp, then groupby('device_id').app_version.ffill(). Without the group, a device's last version would bleed into the next device's early sessions. Fill remaining nulls with '...


Submit Your Answer
Markdown supported