← UiPath Interview Insights

UiPath·Machine Learning Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Whiteboard session at UiPath for an ML Engineer role, basically a math notation gauntlet. They wanted formulas written out from memory, correct summation bounds and all. More rigorous than I expected for this kind of screen.

Questions Asked (7)

Q1

Write the dot product formula for two vectors u and v in R^n from memory, with correct notation.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Fine if you remember to index the summation properly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

State the dot product formula clearly using correct notation: for vectors u = (u₁, ..., uₙ) and v = (v₁, ..., vₙ) in Rⁿ, the dot product is u·v = Σᵢ₌₁ⁿ uᵢvᵢ. Then briefly mention that this is equivalent to the matrix product uᵀv, and note its geometric interpretation as ‖u‖‖v‖cosθ.

Pro tip: Since this is for an ML Engineer role at UiPath, connect the formula to practical applications like computing cosine similarity in embeddings or attention scores in transformers, showing you understand its relevance beyond the math.

1. Define the vectors and notation

Clearly state that u and v are vectors in Rⁿ, and denote their components as u₁, ..., uₙ and v₁, ..., vₙ.

2. Write the summation formula

Present the dot product as u·v = Σᵢ₌₁ⁿ uᵢvᵢ, ensuring correct index and limits.

3. Provide the expanded form

Show the expanded version: u·v = u₁v₁ + u₂v₂ + ... + uₙvₙ, to reinforce understanding.

4. Mention equivalent matrix notation

Note that u·v = uᵀv, where u and v are treated as column vectors, linking to linear algebra operations.

5. Add geometric or practical interpretation

Briefly state that u·v = ‖u‖‖v‖cosθ, and relate it to ML applications like cosine similarity or attention mechanisms.

Key Points to Mention

  • Correct summation notation with index i from 1 to n
  • Component-wise multiplication and addition
  • Equivalence to matrix multiplication uᵀv
  • Geometric interpretation involving cosine of the angle between vectors
  • Application in machine learning: cosine similarity, attention scores, or projections
  • Properties: commutative, distributive, and positive-definite (u·u ≥ 0)

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

Q2

Write the cosine similarity formula between two vectors u and v.

Algorithms & Data Structures
Author's notes

I blanked for a second on whether the denominator uses the product of the norms or the norm of the product.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining cosine similarity as the cosine of the angle between two vectors, then present the formula clearly. Explain each component (dot product, norms) and mention that it measures orientation, not magnitude, with values in [-1, 1].

Pro tip: Mention that cosine similarity is equivalent to the dot product of L2-normalized vectors, which is useful for efficient computation in large-scale ML systems. Also note that it's invariant to scaling, making it ideal for text data where document length varies.

1. Define cosine similarity

State that cosine similarity measures the cosine of the angle between two non-zero vectors, indicating how similar their directions are.

2. Write the formula

Present the formula: cos(θ) = (u · v) / (||u|| ||v||), where u · v is the dot product and ||u||, ||v|| are the Euclidean norms.

3. Explain each component

Clarify that the dot product captures alignment, while the norms normalize for vector length, making the measure scale-invariant.

4. Discuss properties and range

Mention that the value ranges from -1 (opposite) to 1 (identical direction), with 0 indicating orthogonality.

5. Connect to ML applications

Relate to use cases like text similarity, recommendation systems, and embedding comparisons, highlighting its role in high-dimensional spaces.

Key Points to Mention

  • Dot product (u · v) and Euclidean norms (||u||, ||v||)
  • Scale invariance: cosine similarity ignores vector magnitude
  • Range [-1, 1] and interpretation of values
  • Equivalence to dot product of L2-normalized vectors
  • Common applications: text mining, information retrieval, embeddings
  • Handling zero vectors: similarity undefined if either vector is zero

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

Q3

Write the Euclidean (L2) distance and Manhattan (L1) distance formulas between two points.

Algorithms & Data Structures
Author's notes

These felt like warmup but they still checked that you had the square root in L2 and absolute values in L1.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating the formulas for Euclidean and Manhattan distances between two points in a d-dimensional space. Then, briefly explain the intuition behind each and mention their relevance in machine learning, such as in clustering, nearest neighbor search, and loss functions.

Pro tip: Emphasize that the choice of distance metric depends on the data and problem; for example, Manhattan distance is more robust to outliers and works well for high-dimensional sparse data, while Euclidean is common for continuous, low-dimensional data.

1. Define the points

Let the two points be p = (p1, p2, ..., pd) and q = (q1, q2, ..., qd) in a d-dimensional space.

2. State Euclidean distance formula

Euclidean distance: sqrt(sum_{i=1}^d (pi - qi)^2). This is the L2 norm of the difference vector.

3. State Manhattan distance formula

Manhattan distance: sum_{i=1}^d |pi - qi|. This is the L1 norm of the difference vector.

4. Explain intuition and use cases

Euclidean measures straight-line distance; Manhattan measures grid-like path distance. Mention applications: Euclidean in K-means, PCA; Manhattan in robust regression, L1 regularization, and high-dimensional text data.

5. Mention generalizations and trade-offs

Both are special cases of Minkowski distance: (sum |pi - qi|^p)^(1/p) for p=2 and p=1 respectively. Discuss computational considerations and sensitivity to outliers.

Key Points to Mention

  • Formulas for both distances in d dimensions
  • L1 and L2 norms and their relationship to Minkowski distance
  • Geometric interpretation: straight line vs. grid path
  • Use cases in machine learning: clustering, nearest neighbors, loss functions
  • Robustness to outliers: Manhattan more robust than Euclidean
  • Computational complexity: both O(d) but Euclidean involves square root

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

Q4

Write the Mean Squared Error formula for n samples, with predictions ŷ and targets y.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The 1/n vs 1/(2n) thing came up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating the Mean Squared Error (MSE) formula: MSE = (1/n) * Σ_{i=1}^{n} (y_i - ŷ_i)^2. Then briefly explain each component and why squaring is used, and optionally mention its role as a loss function in regression.

Pro tip: Emphasize that MSE is sensitive to outliers due to squaring, and that it's differentiable, making it suitable for gradient-based optimization. This shows deeper understanding beyond the formula.

1. State the formula

Write the MSE formula clearly: MSE = (1/n) * Σ_{i=1}^{n} (y_i - ŷ_i)^2. Ensure correct notation for predictions and targets.

2. Explain each term

Define n as the number of samples, y_i as the true target, and ŷ_i as the predicted value. Mention that the sum is over all samples.

3. Justify squaring

Explain that squaring penalizes larger errors more and ensures positive values, avoiding cancellation between positive and negative errors.

4. Discuss properties

Highlight that MSE is differentiable and convex, making it suitable for optimization. Note its sensitivity to outliers.

5. Relate to context

Mention that MSE is commonly used as a loss function in regression tasks and can be extended to other metrics like RMSE.

Key Points to Mention

  • The formula: MSE = (1/n) * Σ (y_i - ŷ_i)^2
  • Squaring amplifies large errors and ensures non-negative values
  • MSE is differentiable and convex, ideal for gradient descent
  • Sensitivity to outliers due to squaring
  • MSE as a loss function in regression
  • Relationship to RMSE (square root of MSE)

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

Q5

Derive the partial derivatives of MSE with respect to w and b, given the model ŷ = w·x + b.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where things got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the MSE loss function for a single training example, then apply the chain rule to compute the gradients with respect to w and b. Show each step of the derivation, and finally express the results in a form that generalizes to multiple examples.

Pro tip: Emphasize that the gradient with respect to w is proportional to the input x, which means features with larger magnitudes get larger updates—this motivates feature scaling. Also, mention that the factor of 2 in the derivative is often absorbed into the learning rate, a common practice in deep learning frameworks.

1. Define the loss function

Write the MSE for a single example: L = (1/2)(y - ŷ)^2, where ŷ = w·x + b. Explain that the 1/2 is for convenience in differentiation.

2. Compute the error term

Define the error as e = (ŷ - y) or (y - ŷ) and note that the derivative of the loss with respect to ŷ is (ŷ - y).

3. Apply chain rule for w

Compute ∂L/∂w = ∂L/∂ŷ * ∂ŷ/∂w = (ŷ - y) * x. For multiple examples, sum or average over the batch.

4. Apply chain rule for b

Compute ∂L/∂b = ∂L/∂ŷ * ∂ŷ/∂b = (ŷ - y) * 1 = (ŷ - y). For multiple examples, sum or average over the batch.

5. Generalize to batch

Extend to N examples: ∂L/∂w = (1/N) Σ (ŷ_i - y_i) x_i and ∂L/∂b = (1/N) Σ (ŷ_i - y_i). Mention that these are used in gradient descent updates.

Key Points to Mention

  • MSE loss function definition and the role of the 1/2 factor
  • Chain rule application for composite functions
  • Gradient with respect to w involves the input x, while gradient with respect to b does not
  • For batch training, gradients are averaged (or summed) over all examples
  • These gradients are used to update parameters: w := w - α ∂L/∂w, b := b - α ∂L/∂b
  • Connection to feature scaling: larger x leads to larger gradients, affecting convergence

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

Q6

Write the min-max normalization formula and the z-score standardization formula.

Algorithms & Data Structures
Author's notes

Easy enough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating both formulas, using standard notation. Then briefly explain the purpose of each: min-max for scaling to a fixed range, z-score for standardizing to mean 0 and variance 1. Finally, mention when to use each and any caveats.

Pro tip: Mention that min-max is sensitive to outliers, while z-score assumes a roughly Gaussian distribution and is less affected by outliers. Also note that z-score can produce values outside [0,1], which is fine for many algorithms but not for those requiring bounded inputs.

1. State the min-max normalization formula

Write the formula: x' = (x - min(x)) / (max(x) - min(x)). Explain that it scales values to the range [0, 1].

2. State the z-score standardization formula

Write the formula: x' = (x - μ) / σ, where μ is the mean and σ is the standard deviation. Explain that it centers data around 0 with unit variance.

3. Explain the purpose and differences

Min-max preserves the shape of the original distribution but bounds values; z-score standardizes but does not bound values. Mention that min-max is affected by outliers, while z-score is more robust.

4. Discuss when to use each

Use min-max when you need values in a specific range (e.g., for neural networks with sigmoid activation). Use z-score when algorithms assume normally distributed data (e.g., PCA, linear models with regularization).

5. Mention implementation considerations

Note that both should be computed on training data and applied to test data. Also mention that z-score can be used with any distribution but is most effective when data is roughly Gaussian.

Key Points to Mention

  • Min-max formula: (x - min) / (max - min)
  • Z-score formula: (x - μ) / σ
  • Min-max scales to [0,1]; z-score standardizes to mean 0, std 1
  • Min-max is sensitive to outliers; z-score is less sensitive
  • Use min-max for bounded inputs; z-score for Gaussian assumptions
  • Compute parameters on training set and apply to test set

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

Q7

Bonus: write the sigmoid function and its derivative, the softmax function and its derivative, and the binary cross-entropy formula.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

They called it a bonus but it felt like they expected it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by writing the sigmoid function and its derivative, then the softmax function and its derivative (using the Jacobian matrix), and finally the binary cross-entropy formula. Explain each step briefly, emphasizing the mathematical properties and their relevance to ML. If time permits, mention numerical stability and computational considerations.

Pro tip: When deriving the softmax derivative, express it in terms of the softmax outputs themselves (using the Kronecker delta) to show you understand the elegant self-referential property. Also, mention that binary cross-entropy is often used with sigmoid output for binary classification, and note the log-sum-exp trick for numerical stability.

1. Sigmoid Function and Derivative

Write σ(x) = 1/(1+e^{-x}) and its derivative σ'(x) = σ(x)(1-σ(x)). Explain that this derivative is efficient to compute because it reuses the forward pass output.

2. Softmax Function and Derivative

Write softmax(z)_i = e^{z_i} / Σ_j e^{z_j}. For the derivative, provide the Jacobian: ∂softmax_i/∂z_j = softmax_i (δ_{ij} - softmax_j). Mention that this is a matrix for multi-class outputs.

3. Binary Cross-Entropy Formula

Write BCE(y, ŷ) = -[y log(ŷ) + (1-y) log(1-ŷ)]. Explain that it measures the dissimilarity between true labels and predicted probabilities, and is commonly used with sigmoid activation.

4. Discuss Practical Considerations

Mention numerical stability (e.g., log-sum-exp trick for softmax, clipping probabilities in BCE) and computational efficiency (vectorization, avoiding overflow).

Key Points to Mention

  • Sigmoid derivative: σ'(x) = σ(x)(1-σ(x))
  • Softmax derivative: Jacobian matrix with entries softmax_i (δ_{ij} - softmax_j)
  • Binary cross-entropy: -[y log(ŷ) + (1-y) log(1-ŷ)]
  • Numerical stability: log-sum-exp trick for softmax, epsilon clipping for BCE
  • Relationship: BCE with sigmoid output simplifies gradient computation (e.g., ∂L/∂z = ŷ - y)
  • Softmax is used for multi-class classification, sigmoid for binary or multi-label

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