← Waymo Interview Insights

Waymo·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026

Summary

Waymo ML Engineer interview had me coding a neural network from scratch in NumPy, no frameworks allowed. Pretty brutal if your backprop math is rusty, but also kind of a fun problem once you get into it.

Questions Asked (4)

Q1

Implement a two-layer feed-forward neural network from scratch using only NumPy, including forward pass, backward pass with chain-rule gradients, and SGD parameter updates. Train it on a toy dataset and show the loss going down.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This was the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the network architecture (input size, hidden size, output size) and the forward pass equations. Then derive the backward pass using the chain rule, explicitly showing gradients for each parameter. Finally, implement SGD updates and train on a toy dataset, printing the loss over epochs to demonstrate convergence.

Pro tip: Vectorize operations across the batch to avoid loops, and use gradient checking to verify your backprop implementation. This shows production-level coding and rigor.

1. Define architecture and forward pass

Specify layer sizes and activation functions (e.g., ReLU for hidden, softmax for output). Write the forward pass equations: Z1 = XW1 + b1, A1 = ReLU(Z1), Z2 = A1W2 + b2, A2 = softmax(Z2).

2. Derive backward pass with chain rule

Compute gradients: dZ2 = A2 - Y, dW2 = A1.T @ dZ2, db2 = sum(dZ2), dA1 = dZ2 @ W2.T, dZ1 = dA1 * ReLU'(Z1), dW1 = X.T @ dZ1, db1 = sum(dZ1). Explain each step.

3. Implement SGD updates

Update parameters: W1 -= lr * dW1, b1 -= lr * db1, W2 -= lr * dW2, b2 -= lr * db2. Choose a learning rate and iterate over epochs.

4. Train on toy dataset and monitor loss

Generate or load a simple dataset (e.g., XOR or linearly separable). Train for several epochs, printing loss every few epochs to show it decreasing.

5. Validate and discuss trade-offs

Perform gradient checking to ensure correctness. Discuss trade-offs: batch vs stochastic, activation choices, learning rate tuning, and potential overfitting.

Key Points to Mention

  • Vectorization for efficiency: process entire batch in matrix operations.
  • Chain rule application: clearly explain how gradients flow backward.
  • Gradient checking: numerically verify gradients to catch bugs.
  • Learning rate selection: impact on convergence and stability.
  • Activation functions: ReLU for hidden, softmax for output (with cross-entropy loss).
  • Loss monitoring: plot or print loss to demonstrate learning.

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

Q2

Walk through weight initialization strategies: why does initializing all weights to zero fail, and how does Xavier initialization help?

Technical Trade-offs
Author's notes

I knew the zero-init answer cold, symmetry breaking and all that.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the symmetry problem: if all weights are zero, every neuron in a layer computes the same output and receives the same gradient, so the network cannot break symmetry and learn diverse features. Then introduce Xavier initialization as a way to set weights so that the variance of activations and gradients remains constant across layers, preventing vanishing/exploding signals. Finally, connect this to practical benefits like faster convergence and better performance in deep networks.

Pro tip: Mention that Xavier initialization assumes linear activations and works best with tanh or sigmoid, while He initialization is preferred for ReLU—showing awareness of when Xavier might not be optimal. Also note that modern frameworks like PyTorch default to Kaiming/He for ReLU, so you'd choose Xavier deliberately for saturating activations.

1. Explain the zero initialization failure

Describe how setting all weights to zero causes all neurons to be identical, leading to symmetric gradients and no learning. Emphasize that this symmetry cannot be broken by training alone.

2. Introduce the variance problem

Explain that random initialization with too small or too large variance leads to vanishing or exploding activations/gradients, making deep networks hard to train.

3. Describe Xavier initialization

State that Xavier (Glorot) initialization sets weights with variance 2/(fan_in + fan_out), derived to keep the variance of activations and back-propagated gradients constant across layers.

4. Connect to practical benefits

Highlight that Xavier enables faster convergence, reduces the need for careful hyperparameter tuning, and allows training of deeper networks without batch normalization.

5. Acknowledge limitations and alternatives

Mention that Xavier assumes linear activations and is less effective for ReLU, where He initialization (variance 2/fan_in) is preferred. This shows depth of understanding.

Key Points to Mention

  • Symmetry breaking: zero weights cause all neurons to learn the same features.
  • Vanishing/exploding gradients: improper initialization leads to unstable training.
  • Xavier initialization formula: variance = 2/(fan_in + fan_out).
  • Goal: maintain constant variance of activations and gradients across layers.
  • Applicability: best for tanh/sigmoid, not ReLU (use He instead).
  • Practical impact: faster convergence, deeper networks trainable without batch norm.

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

Q3

Why does ReLU help with the vanishing gradient problem compared to sigmoid or tanh?

Technical Trade-offs
Author's notes

Answered this fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the vanishing gradient problem and how it arises in deep networks with sigmoid/tanh activations. Then explain how ReLU's derivative (0 or 1) avoids the multiplicative decay of gradients, and contrast with sigmoid/tanh whose derivatives are always <1. Conclude by noting that while ReLU mitigates vanishing gradients, it introduces other trade-offs like dying ReLU, showing balanced understanding.

Pro tip: Mention that ReLU's constant gradient for positive inputs also enables faster training and that variants like Leaky ReLU address the dying ReLU problem, demonstrating awareness of practical deployment considerations.

1. Define the vanishing gradient problem

Explain that in deep networks, gradients are multiplied through layers during backpropagation. If each layer's gradient is small, the product shrinks exponentially, making early layers learn very slowly.

2. Analyze sigmoid/tanh derivatives

Sigmoid derivative max is 0.25, tanh derivative max is 1 but typically <1. In deep networks, repeated multiplication of these small values causes gradients to vanish.

3. Explain ReLU's derivative

ReLU's derivative is 1 for positive inputs and 0 for negative inputs. For active neurons, the gradient is preserved without decay, allowing gradients to flow through many layers.

4. Contrast and discuss trade-offs

Highlight that ReLU does not saturate for positive inputs, unlike sigmoid/tanh. However, note that ReLU can suffer from dying neurons (zero gradient for negative inputs) and mention variants like Leaky ReLU.

5. Relate to practical impact

Conclude that ReLU enables training of deeper networks by mitigating vanishing gradients, leading to faster convergence and better performance in practice.

Key Points to Mention

  • Vanishing gradient problem: gradients become exponentially small in deep networks.
  • Sigmoid derivative: max 0.25, always positive and <1, causing gradient decay.
  • Tanh derivative: max 1 but typically <1, also causes decay.
  • ReLU derivative: 1 for positive inputs, 0 for negative, preserving gradient for active neurons.
  • ReLU does not saturate for positive inputs, unlike sigmoid/tanh.
  • Trade-off: dying ReLU problem and variants like Leaky ReLU, ELU.

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

Q4

How would you verify your manually coded gradients are correct using finite differences?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Gradient checking via finite differences.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain the finite difference method for gradient checking, emphasizing the central difference formula and its O(ε^2) accuracy. Describe a practical implementation that compares analytical and numerical gradients, using relative error and tolerances to flag discrepancies. Highlight the importance of testing on simple functions first and then scaling to complex models.

Pro tip: Use a relative error metric with a threshold like 1e-7 for float64, and always disable dropout or other stochastic components during gradient checking to avoid false positives.

1. Understand Finite Differences

Explain that finite differences approximate gradients by perturbing each input dimension and computing the change in output. Use the central difference formula for better accuracy: (f(x+ε) - f(x-ε)) / (2ε).

2. Implement Gradient Checking

For each parameter, compute the analytical gradient (from your code) and the numerical gradient using finite differences. Compare them using a relative error metric: ||g_analytical - g_numerical|| / (||g_analytical|| + ||g_numerical|| + ε).

3. Choose Perturbation and Tolerance

Select a small ε (e.g., 1e-5) to balance truncation and round-off errors. Set a tolerance (e.g., 1e-7) for relative error; if the error exceeds it, investigate potential bugs.

4. Test on Simple Cases

Validate the gradient checking implementation on simple functions with known gradients (e.g., linear, quadratic) to ensure correctness before applying to complex models.

5. Apply to Complex Models

Use gradient checking on your actual model, but be mindful of computational cost. Check a subset of parameters or use random projections if the parameter space is large.

Key Points to Mention

  • Central difference formula for O(ε^2) accuracy vs. forward difference O(ε)
  • Relative error metric and appropriate tolerance (e.g., 1e-7)
  • Choice of ε: trade-off between truncation and round-off errors
  • Computational cost: O(n) evaluations for n parameters, so use sparingly
  • Disabling stochastic components (dropout, batch norm) during checking
  • Handling non-differentiable points or numerical instability

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