PracHub
QuestionsPremiumLearningGuidesCheatsheetNEW
|Home/Analytics & Experimentation/Roblox

Compute DID estimate and pretrend flag

Last updated: Mar 29, 2026

Quick Overview

This Analytics & Experimentation question evaluates basic causal-inference and data-manipulation skills by requiring computation of a difference-in-differences (DID) estimate and a binary pretrend flag from panel-like arrays, at an implementation-level focused on summary statistics and edge-case handling.

  • hard
  • Roblox
  • Analytics & Experimentation
  • Data Scientist

Compute DID estimate and pretrend flag

Company: Roblox

Role: Data Scientist

Category: Analytics & Experimentation

Difficulty: hard

Interview Round: Take-home Project

You are given three equal-length arrays describing observations from a panel-like dataset: - `period[i]` ∈ {0,1}: 0 = pre period, 1 = post period - `treat[i]` ∈ {0,1}: 1 = treated group, 0 = control group - `y[i]` (float): outcome Tasks: A) Compute the **difference-in-differences (DID)** estimate of the treatment effect: \[ \text{DID} = (\bar y_{post,treated} - \bar y_{pre,treated}) - (\bar y_{post,control} - \bar y_{pre,control}) \] B) Compute a simple **pretrend flag**: - Let \(d_{pre} = \bar y_{pre,treated} - \bar y_{pre,control}\). - Given a scalar `threshold` ≥ 0, return `pretrend=True` if \(|d_{pre}| > threshold\), else `False`. Assumptions/requirements: - Use simple means over the subsets implied by (`period`, `treat`). - Describe how you would handle missing cells (e.g., no treated observations in pre period).

Quick Answer: This Analytics & Experimentation question evaluates basic causal-inference and data-manipulation skills by requiring computation of a difference-in-differences (DID) estimate and a binary pretrend flag from panel-like arrays, at an implementation-level focused on summary statistics and edge-case handling.

Related Interview Questions

  • How to estimate feature impact on usage time - Roblox (easy)
  • How to estimate a feature’s causal impact on time spent - Roblox (medium)
  • Compute minimum sample size for A/B test - Roblox (hard)
  • Compute DiD and validate parallel trends - Roblox (hard)
  • Determine if players prefer local creators without experiments - Roblox (Medium)
Roblox logo
Roblox
Nov 24, 2025, 12:00 AM
Data Scientist
Take-home Project
Analytics & Experimentation
3
0

You are given three equal-length arrays describing observations from a panel-like dataset:

  • period[i] ∈ {0,1}: 0 = pre period, 1 = post period
  • treat[i] ∈ {0,1}: 1 = treated group, 0 = control group
  • y[i] (float): outcome

Tasks:

A) Compute the difference-in-differences (DID) estimate of the treatment effect:

DID=(yˉpost,treated−yˉpre,treated)−(yˉpost,control−yˉpre,control)\text{DID} = (\bar y_{post,treated} - \bar y_{pre,treated}) - (\bar y_{post,control} - \bar y_{pre,control})DID=(yˉ​post,treated​−yˉ​pre,treated​)−(yˉ​post,control​−yˉ​pre,control​)

B) Compute a simple pretrend flag:

  • Let dpre=yˉpre,treated−yˉpre,controld_{pre} = \bar y_{pre,treated} - \bar y_{pre,control}dpre​=yˉ​pre,treated​−yˉ​pre,control​ .
  • Given a scalar threshold ≥ 0, return pretrend=True if ∣dpre∣>threshold|d_{pre}| > threshold∣dpre​∣>threshold , else False .

Assumptions/requirements:

  • Use simple means over the subsets implied by ( period , treat ).
  • Describe how you would handle missing cells (e.g., no treated observations in pre period).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Analytics & Experimentation•More Roblox•More Data Scientist•Roblox Data Scientist•Roblox Analytics & Experimentation•Data Scientist Analytics & Experimentation
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.