← UiPath Interview Insights

UiPath·Machine Learning Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Whiteboard-heavy technical screen for an ML Engineer role at UiPath. The whole session was basically a math notation audit, write the formula, get it exactly right, move on. Unforgiving if you're sloppy with summation indices or mix up scalar and vector notation.

Questions Asked (6)

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

Seemed trivial going in.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

State the dot product formula clearly using correct notation: u·v = Σ_{i=1}^n u_i v_i. Then briefly explain the geometric interpretation (u·v = ||u|| ||v|| cos θ) and mention its relevance to ML (e.g., cosine similarity, neural network computations).

Pro tip: Show you understand both the algebraic and geometric definitions, and connect it to practical ML applications like attention mechanisms or similarity metrics. This demonstrates depth beyond rote memorization.

1. State the algebraic formula

Write the dot product as the sum of component-wise products: u·v = Σ_{i=1}^n u_i v_i. Use clear notation, specifying that u and v are vectors in R^n.

2. Provide the geometric interpretation

Mention that u·v = ||u|| ||v|| cos θ, where θ is the angle between the vectors. This connects the algebraic definition to geometry.

3. Highlight key properties

Note that the dot product is commutative, distributive, and bilinear. Also mention that u·u = ||u||^2.

4. Connect to machine learning

Explain how the dot product is used in ML, such as in cosine similarity, linear regression, neural network layers, and attention mechanisms.

Key Points to Mention

  • Correct notation: u·v or ⟨u, v⟩, with u, v ∈ R^n
  • Component-wise sum: Σ_{i=1}^n u_i v_i
  • Geometric meaning: u·v = ||u|| ||v|| cos θ
  • Orthogonality: u·v = 0 implies u and v are perpendicular
  • Applications in ML: cosine similarity, neural network computations, attention
  • Properties: commutative, distributive, bilinear

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, including the correct denominator.

Algorithms & Data Structures
Author's notes

I second-guessed myself on whether the denominator was the product of the norms or the sum.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

State the cosine similarity formula clearly, emphasizing that it is the dot product of u and v divided by the product of their Euclidean norms. Explain that this measures the cosine of the angle between the vectors, making it invariant to magnitude. Optionally, connect it to common ML applications like text similarity or recommendation systems.

Pro tip: Mention that cosine similarity is equivalent to the dot product of L2-normalized vectors, which is why it's often preferred over Euclidean distance for high-dimensional sparse data. Also, note that it ranges from -1 to 1, with 0 indicating orthogonality.

1. Define the formula

Write the formula: cos(θ) = (u · v) / (||u|| ||v||). Clearly identify the numerator as the dot product and the denominator as the product of the Euclidean norms.

2. Explain each component

Define u · v as the sum of element-wise products, and ||u|| as the square root of the sum of squares of u's components. Do the same for ||v||.

3. Interpret the result

Explain that the result is the cosine of the angle between u and v, ranging from -1 (opposite) to 1 (identical direction), with 0 indicating orthogonality.

4. Connect to ML applications

Mention typical uses such as document similarity, recommendation systems, and embedding comparisons, highlighting its robustness to magnitude differences.

Key Points to Mention

  • The formula: (u · v) / (||u|| ||v||)
  • Dot product definition: Σ u_i v_i
  • Euclidean norm: ||u|| = sqrt(Σ u_i^2)
  • Range: -1 to 1, with 1 meaning identical direction
  • Invariance to vector magnitude, useful for sparse/high-dimensional data
  • Relation to L2 normalization: cosine similarity = dot product of normalized vectors

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

Back to back.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

State both formulas clearly, define each variable, and briefly explain the geometric intuition behind each. Then relate them to machine learning contexts, such as loss functions and distance metrics, to show practical understanding.

Pro tip: Mention that Euclidean distance is sensitive to feature scales and often requires normalization, while Manhattan distance is more robust to outliers—this shows awareness of real-world ML implications.

1. Define the points and variables

Let the two points be p = (p1, p2, ..., pn) and q = (q1, q2, ..., qn) in n-dimensional space. Clearly state that n is the number of dimensions.

2. Write the Euclidean distance formula

Euclidean distance is the square root of the sum of squared differences: d(p, q) = sqrt(Σ (pi - qi)^2). Explain that it represents the straight-line distance.

3. Write the Manhattan distance formula

Manhattan distance is the sum of absolute differences: d(p, q) = Σ |pi - qi|. Explain that it represents the distance along grid lines.

4. Compare and contrast

Highlight that Euclidean is sensitive to large differences due to squaring, while Manhattan treats all differences linearly. Mention that Manhattan is also called L1 or taxicab distance.

5. Relate to machine learning

Give examples: Euclidean distance is used in KNN, K-means, and as MSE loss; Manhattan distance is used in L1 regularization (Lasso) and robust regression.

Key Points to Mention

  • Euclidean distance formula: sqrt(Σ (pi - qi)^2)
  • Manhattan distance formula: Σ |pi - qi|
  • Geometric interpretation: straight-line vs. grid-based distance
  • Sensitivity to outliers and feature scaling
  • Use in ML: KNN, K-means, MSE (Euclidean); Lasso, MAE (Manhattan)
  • Generalization to Minkowski distance (p-norm)

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 predictions versus targets, then derive the partial derivatives with respect to both the weight and bias parameters.

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 Mean Squared Error (MSE) for n predictions versus targets, then systematically apply calculus to derive the partial derivatives with respect to weight and bias. Show each step of the derivation, explaining the chain rule and how the derivatives are used in gradient descent.

Pro tip: Emphasize that the 2/n factor in the gradient simplifies to 2/n * error * input, which is crucial for efficient implementation. Also, mention that these gradients are the foundation of backpropagation in neural networks.

1. Define the MSE formula

Write the MSE as J(w,b) = (1/n) * sum_{i=1}^{n} (y_i - (w*x_i + b))^2, clearly identifying predictions, targets, weight, and bias.

2. Compute partial derivative w.r.t. weight

Apply the chain rule: ∂J/∂w = (2/n) * sum_{i=1}^{n} (y_i - (w*x_i + b)) * (-x_i). Simplify to -2/n * sum (error_i * x_i).

3. Compute partial derivative w.r.t. bias

Similarly, ∂J/∂b = (2/n) * sum_{i=1}^{n} (y_i - (w*x_i + b)) * (-1). Simplify to -2/n * sum (error_i).

4. Interpret the gradients

Explain that these gradients indicate the direction to adjust w and b to minimize MSE, and are used in gradient descent updates: w := w - α * ∂J/∂w, b := b - α * ∂J/∂b.

Key Points to Mention

  • MSE formula: J(w,b) = (1/n) * Σ (y_i - (w*x_i + b))^2
  • Chain rule application for differentiation
  • Partial derivative w.r.t. weight: ∂J/∂w = -2/n * Σ (error_i * x_i)
  • Partial derivative w.r.t. bias: ∂J/∂b = -2/n * Σ (error_i)
  • Gradient descent update rules
  • Connection to linear regression and neural network training

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

Q5

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

Algorithms & Data Structures
Author's notes

Straightforward.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clearly state both formulas, define each term, and briefly explain when to use each method. Emphasize that min-max normalization scales to a fixed range (usually [0,1]) while z-score standardization centers data around mean 0 with standard deviation 1.

Pro tip: Mention that min-max normalization is sensitive to outliers, whereas z-score standardization is more robust; also note that the choice depends on the algorithm (e.g., neural networks often prefer standardization, while distance-based methods may benefit from normalization).

1. Define Min-Max Normalization

State the formula: x' = (x - min(x)) / (max(x) - min(x)). Explain that it rescales features to a fixed range, typically [0,1].

2. Define Z-Score Standardization

State the formula: x' = (x - μ) / σ, where μ is the mean and σ is the standard deviation. Explain that it transforms data to have mean 0 and standard deviation 1.

3. Compare Use Cases

Discuss when to use each: min-max for bounded ranges and when no outliers; z-score for algorithms assuming Gaussian distribution or when outliers are present.

4. Mention Practical Considerations

Highlight that both methods require fitting on training data and applying the same parameters to test data to avoid data leakage.

Key Points to Mention

  • Min-max normalization formula: x' = (x - min) / (max - min)
  • Z-score standardization formula: x' = (x - μ) / σ
  • Min-max scales to a fixed range, often [0,1]
  • Z-score results in mean 0 and standard deviation 1
  • Min-max is sensitive to outliers; z-score is less affected
  • Choice depends on algorithm and data distribution

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

Q6

As a bonus: write the sigmoid function and its derivative, the softmax function and its derivative, and binary cross-entropy.

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, and finally binary cross-entropy. Explain each formula and its significance in neural networks, and mention any numerical stability considerations.

Pro tip: When writing the softmax derivative, clarify that it's a Jacobian matrix and often used in combination with cross-entropy loss, which simplifies the gradient. Also, mention that binary cross-entropy is equivalent to softmax with two classes.

1. Sigmoid Function and Derivative

Write the sigmoid function σ(x) = 1/(1+e^{-x}) and its derivative σ'(x) = σ(x)(1-σ(x)). Explain that it squashes inputs to (0,1) and is used for binary classification.

2. Softmax Function and Derivative

Write the softmax function softmax(z)_i = e^{z_i}/Σ_j e^{z_j} and its derivative ∂softmax(z)_i/∂z_j = softmax(z)_i (δ_{ij} - softmax(z)_j). Explain that it generalizes sigmoid to multi-class and outputs a probability distribution.

3. Binary Cross-Entropy

Write the binary cross-entropy loss L(y, ŷ) = -[y log(ŷ) + (1-y) log(1-ŷ)]. Explain that it measures the dissimilarity between predicted probabilities and true labels, and is commonly used with sigmoid output.

4. Numerical Stability and Practical Notes

Mention that implementations often use the log-sum-exp trick for softmax and clip probabilities in cross-entropy to avoid log(0). Also, note that the derivative of softmax is often not computed explicitly when combined with cross-entropy.

Key Points to Mention

  • Sigmoid derivative in terms of its output: σ'(x) = σ(x)(1-σ(x))
  • Softmax derivative as a Jacobian matrix: ∂softmax(z)_i/∂z_j = softmax(z)_i (δ_{ij} - softmax(z)_j)
  • Binary cross-entropy formula: L = -[y log(ŷ) + (1-y) log(1-ŷ)]
  • Numerical stability: log-sum-exp trick for softmax, clipping probabilities for cross-entropy
  • Relationship between softmax and sigmoid: sigmoid is a special case of softmax for two classes
  • Combined gradient of softmax with cross-entropy simplifies to (ŷ - y)

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