← Upstart Interview Insights

Upstart·Data Scientist·Onsite - Multi Round·Senior

SeniorPrefer not to say
May 2026

Summary

Onsite stats and probability round for a research-scientist-adjacent data science role at Upstart. Two questions, both pretty theoretical, and the second one had a Bayesian twist I wasn't fully expecting in what felt like a standard frequentist setup.

Questions Asked (2)

Q1

Given the data-generating process y = X + ε where X and ε are independent standard normals, what happens if you flip it and regress X on y using OLS? Derive the regression coefficient.

Technical Trade-offsData Modeling
Author's notes

This one got me for a second because my instinct was to just say 0.5 and move on, but they wanted the full derivation.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify that flipping the regression means treating y as the predictor and X as the response. Then derive the OLS coefficient using the standard formula β = Cov(X,y)/Var(y), and compute the covariance and variance using the given distributions. Finally, interpret the result, noting that the coefficient is 1/2 and discussing implications such as attenuation bias and the difference between regression and causal direction.

Pro tip: Emphasize that the coefficient is not 1, which might seem counterintuitive; explain that this is due to errors-in-variables attenuation, and mention that the R² remains the same (1/2) in both directions, highlighting the asymmetry in regression coefficients.

1. Clarify the flipped regression

State that the new regression is X = α + β y + u, where y is the predictor and X is the response. Note that OLS estimates β as Cov(X,y)/Var(y).

2. Compute Cov(X, y)

Since y = X + ε, with X and ε independent standard normals, Cov(X, y) = Cov(X, X+ε) = Var(X) + Cov(X, ε) = 1 + 0 = 1.

3. Compute Var(y)

Var(y) = Var(X+ε) = Var(X) + Var(ε) + 2Cov(X, ε) = 1 + 1 + 0 = 2.

4. Derive the OLS coefficient

Plug in the values: β = Cov(X,y)/Var(y) = 1/2. Also note that the intercept α = E[X] - β E[y] = 0 - (1/2)*0 = 0.

5. Interpret and discuss implications

Explain that the coefficient is 1/2, not 1, due to attenuation bias from regressing on a noisy predictor. Mention that the R² is the same (1/2) in both directions, and discuss the asymmetry and potential pitfalls in causal interpretation.

Key Points to Mention

  • OLS coefficient formula: β = Cov(X,y)/Var(y)
  • Covariance calculation: Cov(X, X+ε) = Var(X) = 1
  • Variance calculation: Var(X+ε) = Var(X) + Var(ε) = 2
  • Result: β = 1/2, intercept = 0
  • Attenuation bias: coefficient biased toward zero when regressing on a noisy predictor
  • Symmetric R²: R² = 1/2 in both regressions, but coefficients differ
  • Causal interpretation: regression does not imply causation; flipping changes the estimand

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

Q2

A sample of 100 children from a village shows 50 from 1-child families, 30 from 2-child families, and 20 from 3-child families. Estimate the proportion of 1-child families, build a 95% confidence interval for it, and then explain how you'd get an exact credible interval using a Dirichlet prior on the family-size proportions.

A/B Testing & ExperimentationData Modeling
Author's notes

The first two parts weren't bad.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the sampling scheme: if children are sampled uniformly, the family-size distribution is size-biased, so the observed proportions estimate the size-biased distribution, not the true family-size distribution. Then compute the MLE and a standard 95% confidence interval for the proportion of 1-child families under the appropriate model, and finally outline a Bayesian approach using a Dirichlet prior on the true family-size proportions, incorporating the size-biasing likelihood to obtain an exact credible interval.

Pro tip: Explicitly state the sampling assumption and note the size-biased sampling issue; this shows statistical maturity and avoids a common pitfall. Also, mention that the Dirichlet-multinomial model yields a Beta posterior for the proportion of interest, enabling exact credible intervals.

1. Clarify the sampling scheme and target parameter

Determine whether the sample is of children or families. If children are sampled uniformly, the observed family sizes follow a size-biased distribution, so the proportion of 1-child families in the sample is not an unbiased estimate of the population proportion. Define the target parameter as the true proportion of 1-child families in the village.

2. Estimate the proportion and compute a standard confidence interval

Assuming the sample is a simple random sample of children, the MLE of the size-biased proportion of 1-child families is 0.5. Use the normal approximation to construct a 95% confidence interval: p_hat ± 1.96 * sqrt(p_hat(1-p_hat)/n). If correcting for size bias, derive the relationship between size-biased and true proportions and estimate the true proportion accordingly.

3. Set up a Bayesian model with a Dirichlet prior

Place a Dirichlet prior on the true family-size proportions (π1, π2, π3). The likelihood for the observed counts, given the sampling scheme, is multinomial with probabilities proportional to kπ_k (size-biased). Combine prior and likelihood to obtain the posterior distribution.

4. Derive the exact credible interval

Because the size-biased probabilities are a linear transformation of the true proportions, the posterior for the true proportion of 1-child families may not have a closed form. Use Monte Carlo sampling from the Dirichlet posterior (or numerical integration) to obtain the exact posterior distribution and compute the 95% credible interval.

Key Points to Mention

  • Size-biased sampling: when sampling children, larger families are overrepresented, so the observed proportion of 1-child families is biased downward relative to the true proportion.
  • The relationship between size-biased and true proportions: if true proportions are π_k, the probability of observing a child from a k-child family is kπ_k / Σ jπ_j.
  • Standard confidence interval for a proportion: use the normal approximation or Wilson interval for the observed proportion, but note it estimates the size-biased proportion, not the true one.
  • Dirichlet prior: a conjugate prior for multinomial data; posterior is Dirichlet with updated parameters.
  • Exact credible interval: obtained from the posterior distribution of the true proportion, often via Monte Carlo simulation because the transformation complicates analytic derivation.
  • Distinction between confidence interval (frequentist) and credible interval (Bayesian): the latter directly gives the probability that the parameter lies in the interval.

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