← Upstart Interview Insights

Upstart·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Upstart data scientist interview that leaned heavily into ML theory. The regularization question was basically a mini oral exam and I felt like I was back in a stats class trying to remember things I'd used but never had to articulate out loud.

Questions Asked (5)

Q1

What are the differences between L1 and L2 regularization in terms of how they modify the objective function, their geometric intuitions, and what they tend to do to model parameters?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

I knew the mechanics but fumbled the geometry part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the objective function modifications for L1 and L2, then explain the geometric intuitions (diamond vs. circle constraints) and their effects on parameters (sparsity vs. shrinkage). Conclude with practical implications for model selection and when to use each.

Pro tip: Mention that L1 regularization can be solved efficiently using coordinate descent or LARS, while L2 has closed-form solutions, and relate this to Upstart's use of regularized models for credit risk to show practical awareness.

1. Objective Function Modification

Explain that L1 adds the sum of absolute weights (λ * Σ|w_i|) and L2 adds the sum of squared weights (λ * Σw_i^2) to the loss function.

2. Geometric Intuition

Describe the constraint regions: L1 corresponds to a diamond (or polytope) shape, L2 to a circle (or hypersphere). The corners of the diamond lead to sparse solutions.

3. Effect on Parameters

L1 tends to produce sparse models by driving some weights exactly to zero, while L2 shrinks weights towards zero but rarely makes them exactly zero.

4. Practical Implications

Discuss when to use each: L1 for feature selection and interpretability, L2 for handling multicollinearity and improving generalization. Mention Elastic Net as a combination.

Key Points to Mention

  • L1 regularization adds a penalty equal to the absolute value of the magnitude of coefficients.
  • L2 regularization adds a penalty equal to the square of the magnitude of coefficients.
  • Geometric interpretation: L1 constraint region is a diamond, L2 is a circle; the diamond's corners encourage sparsity.
  • L1 can lead to sparse solutions (feature selection), while L2 leads to small but non-zero coefficients.
  • L2 is differentiable everywhere, L1 is not differentiable at zero, which affects optimization.
  • Elastic Net combines L1 and L2 penalties, balancing sparsity and shrinkage.

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

Q2

How do Ridge and Lasso regression relate to L2 and L1 regularization, and what does each one do to feature selection?

Technical Trade-offsData Modeling
Author's notes

This felt like a follow-up but was basically its own question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly mapping Ridge to L2 and Lasso to L1 regularization, explaining the penalty terms. Then discuss how L1 induces sparsity and performs feature selection, while L2 shrinks coefficients but keeps all features. Finally, relate this to practical trade-offs in model interpretability and performance.

Pro tip: Mention that Lasso can struggle with correlated features by arbitrarily selecting one, while Ridge distributes weight among them—this shows deeper understanding of real-world data challenges.

1. Define Ridge and Lasso

State that Ridge regression uses L2 regularization (sum of squared coefficients) and Lasso uses L1 regularization (sum of absolute coefficients).

2. Explain the penalty effects

Describe how L2 shrinks coefficients smoothly toward zero but never exactly zero, while L1 can shrink some coefficients exactly to zero, leading to sparse solutions.

3. Connect to feature selection

Clarify that Lasso performs automatic feature selection by eliminating irrelevant features, whereas Ridge retains all features but reduces their impact.

4. Discuss trade-offs and use cases

Highlight scenarios where each is preferred: Lasso for interpretable models with few important features, Ridge for multicollinearity or when all features contribute.

Key Points to Mention

  • L2 regularization adds a penalty equal to the square of the magnitude of coefficients.
  • L1 regularization adds a penalty equal to the absolute value of the magnitude of coefficients.
  • Lasso can zero out coefficients, effectively performing feature selection.
  • Ridge never sets coefficients exactly to zero, so it doesn't perform feature selection.
  • Elastic Net combines L1 and L2 penalties to balance feature selection and coefficient shrinkage.
  • The choice between Ridge and Lasso depends on the number of features, their correlation, and the need for interpretability.

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

Q3

When would you choose Ridge over Lasso, and where does elastic net fit in? What happens to these methods when your features are correlated with each other?

Technical Trade-offsData Modeling
Author's notes

The correlated features part tripped me up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core difference between L1 and L2 regularization, then explain when each is preferred based on feature sparsity and correlation. Discuss elastic net as a compromise that handles correlated features better, and finally address how correlation affects feature selection stability and model interpretation.

Pro tip: Mention that in practice, you often use cross-validation to tune the regularization strength and that elastic net's mix parameter can be optimized, but also note that domain knowledge should guide the choice—especially in regulated industries like fintech where interpretability matters.

1. Clarify Lasso vs. Ridge

Explain that Lasso (L1) performs feature selection by shrinking some coefficients to zero, which is useful when you have many irrelevant features. Ridge (L2) shrinks coefficients but keeps all features, which is better when all features contribute and you want to avoid overfitting.

2. Introduce Elastic Net

Describe elastic net as a combination of L1 and L2 penalties, controlled by a mixing parameter. It's particularly useful when there are multiple correlated features because it can select groups of correlated features rather than arbitrarily picking one.

3. Discuss Correlation Effects

Explain that with correlated features, Lasso tends to randomly select one feature from a group and ignore the others, leading to unstable selection. Ridge distributes the coefficient among correlated features, which can be more stable but doesn't reduce dimensionality.

4. Provide Practical Guidance

Summarize when to choose each: Lasso for sparse solutions and feature selection, Ridge for multicollinearity and when all features are relevant, Elastic Net when you have correlated features and want some sparsity. Mention that cross-validation is key for tuning.

Key Points to Mention

  • L1 regularization (Lasso) induces sparsity and performs feature selection.
  • L2 regularization (Ridge) handles multicollinearity by shrinking coefficients but keeps all features.
  • Elastic net combines L1 and L2, balancing feature selection and grouping effect.
  • Correlated features cause Lasso to select arbitrarily among them, leading to instability.
  • Ridge tends to distribute weights evenly among correlated features, improving stability.
  • Cross-validation is essential for choosing the regularization parameter and mixing parameter.

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

Q4

Why does feature scaling matter when applying regularization methods?

Technical Trade-offs
Author's notes

Short answer: regularization penalizes coefficient size, so if features are on different scales the penalty hits them unequally.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that regularization adds a penalty on coefficient magnitudes, and feature scaling ensures that penalty is applied fairly across features. Then discuss the consequences of not scaling, such as biased regularization and poor model performance, and mention practical implications for model selection and interpretation.

Pro tip: Mention that scaling should be done after train-test split to avoid data leakage, and that some regularizers like L1 can be used for feature selection but only if features are on the same scale.

1. Define regularization

Briefly explain that regularization adds a penalty term to the loss function to prevent overfitting, typically L1 (Lasso) or L2 (Ridge).

2. Explain the role of feature scales

Describe how features with larger scales can dominate the penalty term, leading to unfair shrinkage of coefficients.

3. Discuss consequences of no scaling

Highlight that without scaling, regularization may shrink important coefficients too much or too little, resulting in suboptimal models.

4. Connect to model performance and interpretation

Explain that scaling ensures all features contribute equally to the penalty, improving model performance and making coefficients comparable.

5. Provide practical recommendations

Suggest standardizing or normalizing features before regularization, and note that scaling should be fit on training data only.

Key Points to Mention

  • Regularization penalizes large coefficients to reduce overfitting.
  • Features with larger scales can disproportionately influence the penalty term.
  • Unscaled features lead to biased coefficient estimates and poor generalization.
  • Scaling ensures all features are on a comparable scale, so the penalty is applied uniformly.
  • Standardization (z-score) or min-max scaling are common methods.
  • Scaling should be performed after train-test split to prevent data leakage.

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

Q5

Can you define likelihood and explain how it connects to loss functions like negative log-likelihood?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Wasn't expecting this one to come up and I think it showed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining likelihood as the probability of observed data given model parameters, then explain how maximizing likelihood is equivalent to minimizing negative log-likelihood. Connect this to common loss functions like cross-entropy and mean squared error, and discuss practical implications in model training.

Pro tip: Emphasize that negative log-likelihood is a proper scoring rule and that minimizing it is equivalent to minimizing KL divergence between the model and true distribution, which shows deep understanding. Also, mention that the choice of likelihood depends on the data distribution and affects model calibration.

1. Define Likelihood

Explain that likelihood is the probability of the observed data as a function of the model parameters. It measures how well the parameters explain the data.

2. Introduce Maximum Likelihood Estimation

Describe MLE as the method to find parameters that maximize the likelihood. Mention that it's a fundamental approach in statistical modeling.

3. Connect to Negative Log-Likelihood

Show that maximizing likelihood is equivalent to minimizing negative log-likelihood (NLL) because log is monotonic. NLL is often used as a loss function for optimization.

4. Relate to Common Loss Functions

Give examples: for binary classification, NLL leads to binary cross-entropy; for multiclass, categorical cross-entropy; for regression with Gaussian noise, NLL leads to mean squared error.

5. Discuss Practical Implications

Mention that NLL provides a probabilistic framework, handles uncertainty, and connects to information theory (e.g., cross-entropy, KL divergence). Also note that it's used in deep learning for training.

Key Points to Mention

  • Likelihood is not a probability distribution over parameters; it's a function of parameters given data.
  • Maximizing likelihood is equivalent to minimizing negative log-likelihood due to monotonicity of log.
  • Negative log-likelihood is a convex loss function for exponential family distributions, which is desirable for optimization.
  • Cross-entropy loss is the negative log-likelihood for categorical distributions.
  • Mean squared error is the negative log-likelihood for Gaussian distributions with fixed variance.
  • Minimizing NLL is equivalent to minimizing KL divergence between the model distribution and the empirical distribution.

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