Expectation and Variance of the Sum of Two Random Variables

Read the full interview experience this question came from →

Quick Overview

A probability fundamentals question: for two random variables X and Y, derive the expectation and the variance of their sum and state what each result assumes. It tests linearity of expectation, the covariance term in the variance of a sum, and the difference between uncorrelated and independent variables.

Expectation and Variance of the Sum of Two Random Variables

Company: Glean

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: HR Screen

Let X and Y be two random variables. How do you calculate $E[X + Y]$ and $\operatorname{Var}(X + Y)$? The report asks only for the two calculations. This version also asks you to derive each result and to state what each one assumes about X and Y. ```hint Start from the definition Write the variance of $Z = X + Y$ as the expected squared deviation of Z from its mean, and expand the square. ``` ```hint Where dependence enters As you derive each result, note which step, if any, needs X and Y to be independent. ``` ### Clarifying Questions - Are X and Y independent, or should the formulas hold for any joint distribution? - May we assume both variables have finite means and variances? - Is a derivation for discrete variables enough, or should it also cover continuous ones? ### What a Strong Answer Covers - Linearity of expectation, derived from the joint distribution, with the point that it needs no independence - The variance of a sum including the covariance term, derived by expanding the square - The definition of covariance, when the cross term vanishes, and the difference between uncorrelated and independent variables - The moment conditions each result needs, and a sanity check on extreme cases such as $Y = X$ or $Y = -X$ ### Follow-up Questions - What are $\operatorname{Var}(X - Y)$ and $\operatorname{Var}(aX + bY + c)$ for constants a, b and c? - Can $\operatorname{Var}(X + Y)$ be smaller than $\operatorname{Var}(X)$? Give an example. - In an A/B test, what is the variance of the difference between the treatment and control sample means, and why is there no covariance term? - Give two random variables that are uncorrelated but not independent.

Overview: A probability fundamentals question: for two random variables X and Y, derive the expectation and the variance of their sum and state what each result assumes. It tests linearity of expectation, the covariance term in the variance of a sum, and the difference between uncorrelated and independent variables.

Read the full Glean Data Scientist interview experience this question came from

Glean logo
Glean
Oct 25, 2026
mediumData ScientistHR ScreenStatistics & Math
0
0

Let X and Y be two random variables. How do you calculate E[X+Y]E[X + Y] and Var⁡(X+Y)\operatorname{Var}(X + Y)?

The report asks only for the two calculations. This version also asks you to derive each result and to state what each one assumes about X and Y.

Clarifying Questions Guidance

  • Are X and Y independent, or should the formulas hold for any joint distribution?
  • May we assume both variables have finite means and variances?
  • Is a derivation for discrete variables enough, or should it also cover continuous ones?

What a Strong Answer Covers Guidance

  • Linearity of expectation, derived from the joint distribution, with the point that it needs no independence
  • The variance of a sum including the covariance term, derived by expanding the square
  • The definition of covariance, when the cross term vanishes, and the difference between uncorrelated and independent variables
  • The moment conditions each result needs, and a sanity check on extreme cases such as Y=XY = X or Y=−XY = -X

Follow-up Questions Guidance

  • What are Var⁡(X−Y)\operatorname{Var}(X - Y) and Var⁡(aX+bY+c)\operatorname{Var}(aX + bY + c) for constants a, b and c?
  • Can Var⁡(X+Y)\operatorname{Var}(X + Y) be smaller than Var⁡(X)\operatorname{Var}(X) ? Give an example.
  • In an A/B test, what is the variance of the difference between the treatment and control sample means, and why is there no covariance term?
  • Give two random variables that are uncorrelated but not independent.