Is a Two Second Session More Likely a Bot or a Person

Last updated: November 29, 2026

Quick Overview

Session lengths for bots on a Meta web surface are roughly Normal(2, 1) seconds and for humans roughly Normal(8, 3) seconds, and 10% of sessions are bots. Compute the posterior probability of a bot for sessions lasting 2 seconds and 4 seconds.

Meta
Statistics & Math
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Technical Screen
Statistics & Math
Medium

0

0

0 solved


Session lengths for bots on a Meta web surface are roughly Normal(2, 1) seconds and for humans roughly Normal(8, 3) seconds, and 10% of sessions are bots. Compute the posterior probability of a bot for sessions lasting 2 seconds and 4 seconds.

Integrity ML engineers at Meta combine many weak behavioral signals, and each signal enters a model as a likelihood ratio. The interviewer checks that you can apply Bayes with continuous densities, compute likelihood ratios, and notice when an observation carries almost no information.

What the Interviewer Expects
  • Uses densities rather than probabilities of exact values
  • Computes likelihood ratios at each observation
  • Combines with prior odds to get the posterior
  • Notices that 4 seconds is nearly uninformative
  • Questions the Normal assumption for durations
Key Topics to Cover
Bayes with densities
Likelihood ratio
Gaussian class conditionals
Prior odds
Bot detection
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • Where is the decision boundary at which posterior is 50%?
  • Why does the unequal variance create a second boundary far to the right?
  • How would you combine session length with request rate if they are correlated?
  • Would you model log duration instead?
Sharpen Your Skills on Codemia

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

Browse Statistics Questions
Sample Answer
Clarify

Bot lengths X∣B∼N(2,12)X\mid B\sim N(2,1^2), human X∣H∼N(8,32)X\mid H\sim N(8,3^2), prior P(B)=0.1P(B)=0.1. Exact values have probability zero, so we use density ratios; the dxdx cancels. I would flag that durations are posi...

Approach

Posterior odds =P(B)P(H)⋅fB(x)fH(x)=\frac{P(B)}{P(H)}\cdot\frac{f_B(x)}{f_H(x)} with f(x)=1σ2πe−(x−μ)2/2σ2f(x)=\frac{1}{\sigma\sqrt{2\pi}}e^{-(x-\mu)^2/2\sigma^2}. Prior odds are 1/91/9....


Submit Your Answer
Markdown supported