← Two Sigma Interview Insights

Two Sigma·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026Remote

Summary

Two Sigma quant-style interview covering probability, linear algebra, and econometrics. The problems were layered, each part building on the last, and the regression bias derivation at the end was where things got real.

Questions Asked (4)

Q1

Given three zero-mean, unit-variance random variables with equal pairwise correlation p, what is the valid range of p?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

You need the joint covariance matrix to be positive semi-definite, so the determinant constraint gives you p >= -1/2.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that the correlation matrix must be positive semidefinite. Construct the 3x3 matrix with 1s on the diagonal and p off-diagonal, then compute its eigenvalues and require them to be nonnegative to find the valid range of p.

Pro tip: Mention that the lower bound -1/2 is a classic result and that the matrix is a special case of an equicorrelation matrix; also note that if p = -1/2, the variables are linearly dependent, which is allowed.

1. Set up the correlation matrix

Write the 3x3 correlation matrix with 1s on the diagonal and p on all off-diagonal entries.

2. Check positive semidefiniteness

Recall that any valid correlation matrix must be positive semidefinite, meaning all eigenvalues must be nonnegative.

3. Compute eigenvalues

Find the eigenvalues of the matrix: they are 1+2p (multiplicity 1) and 1-p (multiplicity 2).

4. Derive inequalities

Require 1+2p >= 0 and 1-p >= 0, which gives p >= -1/2 and p <= 1.

5. State the range

Conclude that the valid range is -1/2 <= p <= 1.

Key Points to Mention

  • Correlation matrix must be positive semidefinite.
  • Eigenvalues of the equicorrelation matrix: 1+2p and 1-p (twice).
  • Nonnegativity of eigenvalues yields p >= -1/2 and p <= 1.
  • The lower bound -1/2 is a well-known result for three variables.
  • At p = -1/2, the variables are linearly dependent (e.g., X1 + X2 + X3 = 0).
  • The upper bound p <= 1 is trivial but included for completeness.

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

Q2

Construct an explicit example of three such variables that achieves any valid p in that range.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Factor model construction: write each variable as sqrt(p)*F + sqrt(1-p)*e_i where F and the e_i's are independent standard normals.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem context: identify the three variables and the range of p (likely a probability). Then, construct a simple probabilistic model (e.g., independent Bernoulli trials) where the probability of an event can be tuned to any p in the range by adjusting a parameter. Finally, provide an explicit example with specific values that achieves the desired p, and verify the calculation.

Pro tip: Choose the simplest possible model (like independent coin flips) to minimize complexity and reduce the chance of errors. Explicitly state any assumptions you make about the variables and the range of p.

1. Clarify the problem

Restate the question in your own words to ensure you understand what the three variables are and what range of p is valid. Ask clarifying questions if needed.

2. Choose a simple probabilistic model

Select a model with three variables that can produce a range of probabilities, such as three independent Bernoulli trials with success probability q. The probability of at least one success is 1 - (1-q)^3, which can achieve any p in (0,1) by solving for q.

3. Derive the relationship

Express p in terms of the model parameters. For the Bernoulli example, p = 1 - (1-q)^3, so q = 1 - (1-p)^(1/3). This shows that for any p in (0,1), there exists a q in (0,1).

4. Provide an explicit example

Pick a specific p (e.g., p = 0.5) and compute the corresponding q. Then define the three variables explicitly (e.g., X1, X2, X3 ~ Bernoulli(q)) and show that the probability of at least one success is p.

5. Verify and discuss edge cases

Check the calculation and mention edge cases like p=0 or p=1 (which may require degenerate distributions). Also, note that the construction works for any p in the valid range.

Key Points to Mention

  • Independence of variables (if assumed)
  • The formula for the probability of at least one success in n trials
  • Solving for the parameter q given p
  • Explicit values for the variables (e.g., q = 1 - (1-p)^(1/3))
  • Edge cases: p=0 and p=1
  • Generalization to any p in the range

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

Q3

Generalize the equal-correlation setup to n variables. What is the admissible range of p now?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Lower bound becomes -1/(n-1), which makes sense because as n grows you can't have everything negatively correlated with everything else.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify that the equal-correlation setup means all pairwise correlations are equal to ρ. Then, derive the admissible range by considering the positive semidefiniteness of the n×n correlation matrix with 1 on the diagonal and ρ off-diagonal. The range is -1/(n-1) ≤ ρ ≤ 1.

Pro tip: Mention that the lower bound approaches 0 as n grows, which is a key insight for high-dimensional data. Also, relate this to the concept of equicorrelation and its applications in finance and statistics.

1. Define the correlation matrix

Write the n×n matrix with 1 on the diagonal and ρ on all off-diagonal entries. This is the equicorrelation matrix.

2. Check positive semidefiniteness

A valid correlation matrix must be positive semidefinite. Compute its eigenvalues or use the fact that for such a matrix, eigenvalues are 1 + (n-1)ρ (multiplicity 1) and 1 - ρ (multiplicity n-1).

3. Derive inequalities

Require all eigenvalues to be nonnegative: 1 + (n-1)ρ ≥ 0 and 1 - ρ ≥ 0. Solve these to get ρ ≥ -1/(n-1) and ρ ≤ 1.

4. State the admissible range

Combine the inequalities to get the final range: -1/(n-1) ≤ ρ ≤ 1. Note that for n=2, this reduces to -1 ≤ ρ ≤ 1, as expected.

Key Points to Mention

  • The equicorrelation matrix has a special structure: all off-diagonal entries are equal.
  • Positive semidefiniteness is necessary and sufficient for a matrix to be a valid correlation matrix.
  • The eigenvalues of the equicorrelation matrix are 1 + (n-1)ρ and 1 - ρ.
  • The lower bound -1/(n-1) ensures that the matrix is positive semidefinite.
  • As n increases, the lower bound approaches 0, meaning that large sets of variables cannot all be strongly negatively correlated.
  • The upper bound is always 1, which corresponds to perfect positive correlation.

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

Q4

In a linear regression where the true model includes regressors X and Z but you only regress y on X, derive the OLS estimator you get and characterize the omitted variable bias in matrix form.

Data ModelingTechnical Trade-offsRoot Cause Analysis
Author's notes

This is the part I was least prepared for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Set up the true model in matrix form and derive the OLS estimator from the misspecified regression of y on X alone. Then substitute the true model into the estimator to express the bias as a function of the omitted variable Z and the correlation between X and Z.

Pro tip: Emphasize that the bias depends on both the effect of Z on y and the linear projection of Z on X; if X and Z are orthogonal, the bias vanishes. This shows you understand the conditions under which omitted variable bias is a concern.

1. Define the true model

Write the true linear regression model in matrix form: y = Xβ + Zγ + ε, where X and Z are matrices of regressors and ε is the error term with E[ε|X,Z] = 0.

2. Derive the OLS estimator for the misspecified model

Regress y on X only, obtaining the OLS estimator β_hat = (X'X)^{-1}X'y.

3. Substitute the true model into the estimator

Plug y = Xβ + Zγ + ε into β_hat to get β_hat = β + (X'X)^{-1}X'Zγ + (X'X)^{-1}X'ε.

4. Characterize the omitted variable bias

Take the expectation (conditional on X and Z) to find E[β_hat|X,Z] = β + (X'X)^{-1}X'Zγ. The bias term is (X'X)^{-1}X'Zγ, which depends on the regression of Z on X and the true coefficient γ.

5. Interpret the bias

Explain that the bias is zero if X'Z = 0 (orthogonality) or if γ = 0 (Z has no effect). Otherwise, the bias is the product of the coefficient of Z in the true model and the coefficient from regressing Z on X.

Key Points to Mention

  • Matrix form of the true model: y = Xβ + Zγ + ε
  • OLS estimator for the misspecified model: β_hat = (X'X)^{-1}X'y
  • Bias formula: (X'X)^{-1}X'Zγ
  • Conditions for no bias: X'Z = 0 or γ = 0
  • Interpretation of (X'X)^{-1}X'Z as the OLS coefficients from regressing Z on X
  • Consistency and asymptotic bias if X and Z are correlated

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