← UiPath Interview Insights

UiPath·Machine Learning Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

UiPath ML Engineer interview, technical phone screen focused on regression fundamentals. The loss function question was more involved than I expected, they really pushed on the tradeoffs rather than just wanting a definition.

Questions Asked (1)

Q1

What loss function would you use for a regression model, and how do the common options compare in terms of robustness, gradient behavior, and noise assumptions?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

I started with MSE and MAE which was fine, but then they kept asking me to go deeper on when you'd actually pick one over the other in practice.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by stating that the choice of loss function depends on the data distribution and the desired robustness to outliers. Then compare MSE, MAE, and Huber loss in terms of their mathematical properties and practical implications. Finally, discuss how these properties affect optimization and model performance.

Pro tip: Mention that in practice, the loss function should be aligned with the evaluation metric and business objective; for example, if the metric is MAE, using MSE for training might lead to suboptimal performance. Also, note that Huber loss is a good default when you suspect outliers but still want smooth gradients.

1. Identify the problem context

Clarify that the choice depends on the presence of outliers, noise distribution, and whether you need probabilistic outputs. For UiPath, consider if the regression task involves robotic process automation data which may have outliers.

2. Introduce common loss functions

List MSE (L2), MAE (L1), and Huber loss as the main options. Briefly define each: MSE is squared error, MAE is absolute error, Huber is a combination that is quadratic for small errors and linear for large errors.

3. Compare robustness to outliers

Explain that MSE is sensitive to outliers because errors are squared, MAE is robust as it treats all errors linearly, and Huber is robust but less extreme than MAE for large errors.

4. Discuss gradient behavior

MSE has smooth gradients that are proportional to error, which can lead to large updates for outliers. MAE has constant gradient magnitude (except at zero) which can cause issues near the optimum. Huber has smooth gradients and transitions to linear for large errors, combining benefits.

5. Relate to noise assumptions

MSE assumes Gaussian noise, MAE assumes Laplacian noise, and Huber assumes a mixture or is a compromise. Mention that the choice should reflect the believed noise distribution.

Key Points to Mention

  • MSE (L2) is optimal for Gaussian noise but sensitive to outliers.
  • MAE (L1) is robust to outliers and corresponds to Laplacian noise, but has non-smooth gradient at zero.
  • Huber loss combines MSE and MAE, using a threshold delta to switch between quadratic and linear, providing robustness and smooth gradients.
  • Gradient behavior: MSE gradients grow with error, MAE gradients are constant, Huber gradients are bounded.
  • Choice should align with evaluation metric and business objective; e.g., if outliers are important, MSE might be preferred.
  • In practice, Huber loss is a good default when outliers are present but you still want smooth optimization.

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