← Upstart Interview Insights

Upstart·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

Upstart data scientist interview with a machine learning coding exercise focused on regression that generalizes outside the training distribution. Pretty technical and hands-on, less about theory and more about whether you can actually write code and justify your choices.

Questions Asked (1)

Q1

Build a regression model in code that fits training data well but also extrapolates accurately to test points outside the feature ranges seen during training. Walk through your feature engineering, model selection, regularization approach, and how you'd measure extrapolation performance.

Technical Trade-offsData ModelingAlgorithms & Data Structures
Author's notes

This tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that accurate extrapolation is fundamentally challenging and requires strong assumptions about the data-generating process. Then propose a structured approach: engineer features that capture stable, causal relationships, select a model with the right inductive bias (e.g., linear with interactions or a physics-informed model), apply regularization that penalizes complexity, and evaluate extrapolation using out-of-range validation splits.

Pro tip: Emphasize that extrapolation performance is highly dependent on whether the feature-target relationship is stationary; if not, no model can extrapolate reliably. Show maturity by discussing when to avoid extrapolation and instead flag uncertainty.

1. Clarify assumptions and define extrapolation

Ask whether the test points are outside the training range in one or multiple features, and whether the underlying relationship is expected to hold. Define what 'accurate extrapolation' means in terms of error metrics and acceptable degradation.

2. Feature engineering for stability

Create features that are likely to have stable, monotonic relationships with the target (e.g., ratios, log transforms, domain-specific features). Avoid features that are spurious or only valid within the training range.

3. Model selection with extrapolation in mind

Choose models with strong inductive biases that naturally extrapolate, such as linear models with polynomial terms (carefully), Gaussian processes with a mean function, or physics-informed neural networks. Avoid tree-based models that cannot extrapolate.

4. Regularization and constraints

Apply regularization (L1/L2, dropout) to prevent overfitting and encourage simpler functions. Consider monotonicity constraints or Bayesian priors that encode expected behavior outside the training range.

5. Measure extrapolation performance

Use a validation set that is strictly outside the training feature ranges (e.g., hold out the highest and lowest 10% of feature values). Compare against a baseline (e.g., mean prediction) and report error metrics like MAE, RMSE, and coverage of prediction intervals.

Key Points to Mention

  • The no-free-lunch theorem: no model can extrapolate without assumptions about the data-generating process.
  • Choice of model: linear models, Gaussian processes, and neural networks with appropriate activation functions can extrapolate; tree-based models cannot.
  • Regularization techniques: L1/L2, early stopping, and Bayesian priors to control complexity.
  • Feature engineering: using domain knowledge to create features that are stable and causal, avoiding spurious correlations.
  • Evaluation strategy: out-of-range validation, extrapolation error metrics, and comparison to a naive baseline.
  • Uncertainty quantification: prediction intervals that widen outside the training range to reflect increased uncertainty.

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