Median Days Between Sessions for Meta Horizon Worlds Users

Last updated: November 29, 2026

Quick Overview

For users of Meta Horizon Worlds with at least three active days in the last 90 days, compute each user's median gap in days between consecutive active days, then report the distribution of those medians across users.

Meta
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Phone Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


For users of Meta Horizon Worlds with at least three active days in the last 90 days, compute each user's median gap in days between consecutive active days, then report the distribution of those medians across users.

VR is a lower-frequency product than Facebook or Instagram, so Reality Labs analysts care about how often people return rather than daily retention. This phone-screen question checks LAG over distinct days, a per-user median, and a sensible eligibility filter.

What the Interviewer Expects
  • Deduplicate to distinct active days first
  • Use LAG to compute gaps between consecutive days
  • Take a median per user to resist outliers
  • Filter to users with enough gaps to be meaningful
  • Summarize the per-user medians with percentiles
Key Topics to Cover
LAG
median
return frequency
distinct days
percentiles
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 use this to pick the right retention window for Horizon?
  • Why median rather than mean gap?
  • How would you compare return frequency before and after a headset launch?
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

horizon_sessions(user_id, session_start_ts, duration_s). Active day means any session that day. Window: last 90 days. Users need at least three active days (two gaps)....

Approach

Distinct (user, day) pairs, then LAG per user to get the previous day, and date_diff for the gap. Per user, take APPROX_PERCENTILE(gap, 0.5) and count gaps. Finally summarize medians across user...


Submit Your Answer
Markdown supported