PracHub
QuestionsPremiumLearningGuidesCheatsheetNEW
|Home/Statistics & Math/Roblox

Compute sample size and Bayes posterior

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of statistical inference and probabilistic reasoning by combining a frequentist power/sample-size computation for a two-sided two-sample z-test with a basic Bayesian conditional probability calculation.

  • hard
  • Roblox
  • Statistics & Math
  • Data Scientist

Compute sample size and Bayes posterior

Company: Roblox

Role: Data Scientist

Category: Statistics & Math

Difficulty: hard

Interview Round: Take-home Project

You are implementing two small statistical utilities. Part A — Power / sample size (two-sample z-test) - Input: - `x`: a 1D numeric array of historical observations of a metric (assume i.i.d.). - `alpha`: significance level (e.g., 0.05). - `power`: desired power (e.g., 0.8). - `effect_size`: the minimum detectable absolute difference in means, Δ (same units as `x`). - Task: Compute the required **per-group** sample size `n` for an **equal-sized** A/B test using a **two-sided two-sample z-test**. - Assumptions: - The metric variance is the same in both groups. - Population standard deviation is unknown; estimate it from `x` using the sample standard deviation `s`. - Independent samples, normal approximation. - Output: return the smallest integer `n` that achieves the requested power (round up). Part B — Bayes’ rule - Input: probabilities `p_A = P(A)`, `p_B_given_A = P(B|A)`, `p_B_given_notA = P(B|¬A)`. - Task: compute and return `P(A|B)`. - Assumptions: `0 < p_A < 1` and all conditional probabilities are valid.

Quick Answer: This question evaluates understanding of statistical inference and probabilistic reasoning by combining a frequentist power/sample-size computation for a two-sided two-sample z-test with a basic Bayesian conditional probability calculation.

Related Interview Questions

  • Apply Bayes' rule to compute posterior - Roblox (hard)
  • Derive variance and CTR confidence intervals - Roblox (medium)
  • Implement robust one/two-sided p-value function - Roblox (hard)
  • Compute GSP vs VCG payments with reserves - Roblox (medium)
  • Compute A/B test sample size and Bayes posterior - Roblox (easy)
Roblox logo
Roblox
Nov 23, 2025, 12:00 AM
Data Scientist
Take-home Project
Statistics & Math
1
0

You are implementing two small statistical utilities.

Part A — Power / sample size (two-sample z-test)

  • Input:
    • x : a 1D numeric array of historical observations of a metric (assume i.i.d.).
    • alpha : significance level (e.g., 0.05).
    • power : desired power (e.g., 0.8).
    • effect_size : the minimum detectable absolute difference in means, Δ (same units as x ).
  • Task: Compute the required per-group sample size n for an equal-sized A/B test using a two-sided two-sample z-test .
  • Assumptions:
    • The metric variance is the same in both groups.
    • Population standard deviation is unknown; estimate it from x using the sample standard deviation s .
    • Independent samples, normal approximation.
  • Output: return the smallest integer n that achieves the requested power (round up).

Part B — Bayes’ rule

  • Input: probabilities p_A = P(A) , p_B_given_A = P(B|A) , p_B_given_notA = P(B|¬A) .
  • Task: compute and return P(A|B) .
  • Assumptions: 0 < p_A < 1 and all conditional probabilities are valid.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Statistics & Math•More Roblox•More Data Scientist•Roblox Data Scientist•Roblox Statistics & Math•Data Scientist Statistics & Math
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.