Expectation and Variance of a Sum of Two Random Variables, Including Covariance
Quick Overview
Asks how to compute the expectation and variance of the sum of two random variables, in general and when they are independent. Tests derivation from definitions, the role of covariance, generalizing to weighted sums and differences, and applying the result to data-science problems such as comparing group means.
Expectation and Variance of a Sum of Two Random Variables, Including Covariance
Company: Glean
Role: Data Scientist
Category: Statistics & Math
Difficulty: medium
Interview Round: Onsite
In a hiring-manager interview for a data scientist role, the statistics question was: how do you compute the expectation and the variance of the sum of two random variables?
Answer for two random variables $X$ and $Y$ in general, then say what changes when they are independent.
```hint Expectation first
Write the expectation of the sum directly from the definition, and notice which assumption you never needed.
```
```hint Expand the square
Write the variance of the sum as the expectation of a squared deviation and expand it. One term will not disappear on its own.
```
### Clarifying Questions
- Are $X$ and $Y$ independent, correlated, or of unknown dependence?
- Does the interviewer want a derivation, or the result and how it is used?
### What a Strong Answer Covers
- The expectation result, and the fact that it needs no independence
- The variance result with its covariance term, derived rather than recited
- When the covariance term vanishes: independent or merely uncorrelated variables
- Generalization to weighted sums and to differences
- A data-science use, such as the variance of a difference between two group means
### Follow-up Questions
- What is the variance of $X - Y$?
- If $X$ and $Y$ each have standard deviation $\sigma$, what range of values can the standard deviation of $X + Y$ take?
- Two independent fair dice are rolled. What are the mean and the variance of their total?
Overview: Asks how to compute the expectation and variance of the sum of two random variables, in general and when they are independent. Tests derivation from definitions, the role of covariance, generalizing to weighted sums and differences, and applying the result to data-science problems such as comparing group means.
Expectation and Variance of a Sum of Two Random Variables, Including Covariance
Glean
Sep 30, 2026
mediumData ScientistOnsiteStatistics & Math
1
0
In a hiring-manager interview for a data scientist role, the statistics question was: how do you compute the expectation and the variance of the sum of two random variables?
Answer for two random variables X and Y in general, then say what changes when they are independent.
Clarifying Questions Guidance
Are
X
and
Y
independent, correlated, or of unknown dependence?
Does the interviewer want a derivation, or the result and how it is used?
What a Strong Answer Covers Guidance
The expectation result, and the fact that it needs no independence
The variance result with its covariance term, derived rather than recited
When the covariance term vanishes: independent or merely uncorrelated variables
Generalization to weighted sums and to differences
A data-science use, such as the variance of a difference between two group means
Follow-up Questions Guidance
What is the variance of
X−Y
?
If
X
and
Y
each have standard deviation
σ
, what range of values can the standard deviation of
X+Y
take?
Two independent fair dice are rolled. What are the mean and the variance of their total?