← Glean Interview Insights

Glean·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Interviewed for a data scientist role at Glean and got a probability/stats question that felt more like a grad school exam than a job interview. Nothing too wild but it made me realize how rusty I was on the covariance stuff.

Questions Asked (1)

Q1

Given two random variables X and Y with finite means and variances, how do you derive the expectation and variance of X + Y? Walk through the general formulas, explain where covariance fits in, and cover the independent case.

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

I knew E[X+Y] = E[X] + E[Y] cold, linearity of expectation, no issues there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by stating the general formulas for expectation and variance of a sum of two random variables, emphasizing that expectation is always additive while variance includes a covariance term. Then explain the role of covariance and how it simplifies to zero when X and Y are independent. Finally, connect this to practical implications in data science, such as A/B testing where independence is often assumed.

Pro tip: Mention that in A/B testing, independence between treatment and control groups is a key assumption, and violating it (e.g., due to network effects) can bias variance estimates and inflate false positives. This shows you understand the practical stakes beyond the math.

1. State the expectation formula

Clearly state that E[X + Y] = E[X] + E[Y], which holds for any random variables with finite means, regardless of dependence.

2. Derive the variance formula

Write Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y), and explain that covariance captures how X and Y vary together.

3. Explain covariance and independence

Define Cov(X, Y) = E[XY] - E[X]E[Y]. If X and Y are independent, then E[XY] = E[X]E[Y], so Cov(X, Y) = 0, and Var(X + Y) = Var(X) + Var(Y).

4. Connect to data science context

Relate this to A/B testing: when comparing two independent groups, the variance of the difference is the sum of variances. If independence is violated, covariance must be accounted for.

Key Points to Mention

  • Linearity of expectation: E[X + Y] = E[X] + E[Y] always holds.
  • Variance formula: Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y).
  • Covariance definition: Cov(X, Y) = E[XY] - E[X]E[Y].
  • Independence implies zero covariance, but zero covariance does not imply independence (except for jointly normal variables).
  • In A/B testing, independence between groups is assumed; violations (e.g., network effects) can bias results.
  • For independent variables, Var(X + Y) = Var(X) + Var(Y), which simplifies calculations.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.