← Waymo Interview Insights

Waymo·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorRejected
Apr 2026Remote

Summary

Debugging round at Waymo for an ML Engineer role, paired with an American interviewer. The session covered numpy, tensor ops, and distributed computing bugs. Pretty sure I bombed it.

Questions Asked (4)

Q1

Given a matrix initialized with Matrix.zeros, identify the bug caused by aliasing behavior.

Root Cause AnalysisTechnical Trade-offsAlgorithms & Data Structures
Author's notes

Stared at this longer than I should have.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, explain what aliasing means in the context of matrix initialization and why it causes a bug. Then, walk through a concrete example showing how modifying one row affects others, and propose a fix to avoid shared references.

Pro tip: Mention that this is a common pitfall in libraries like NumPy and that using list comprehensions or explicit copy methods prevents it. Also, relate it to real-world ML scenarios where shared references can silently corrupt data.

1. Define aliasing

Explain that aliasing occurs when multiple variables reference the same underlying object, so changes through one reference affect all others.

2. Describe the bug

State that Matrix.zeros likely creates a matrix where all rows (or elements) are references to the same list or object, so modifying one row modifies all rows.

3. Provide a concrete example

Show code: matrix = Matrix.zeros(3,3); matrix[0][0] = 1; then print matrix and observe that all rows have 1 at index 0.

4. Explain the root cause

Point out that the initialization uses something like [ [0]*cols ] * rows, which replicates the same inner list reference.

5. Propose a fix

Suggest using a list comprehension: [[0]*cols for _ in range(rows)] or using a proper matrix library that handles this correctly.

Key Points to Mention

  • Aliasing vs. copying: shallow copy vs. deep copy
  • Common pitfalls in Python with mutable default arguments and list multiplication
  • How this bug can lead to incorrect model training or data leakage in ML pipelines
  • The importance of unit tests to catch such aliasing issues
  • Alternatives: using NumPy's zeros function which creates independent rows
  • Debugging techniques: using id() to check object identity

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

Q2

Debug a to_ndarray conversion and determine whether a missing axis=1 argument is causing incorrect output.

Root Cause AnalysisTechnical Trade-offs
Author's notes

Missed this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the expected output shape and the semantics of the conversion, then reproduce the bug with a minimal example to isolate the effect of axis=1. Systematically test the hypothesis by comparing outputs with and without axis=1, and explain how the missing argument changes the reduction or stacking behavior.

Pro tip: Demonstrate a hypothesis-driven debugging process: state your assumption, design a quick test, and interpret the result—this shows you can root-cause issues efficiently rather than guessing.

1. Clarify expected behavior

Ask or state what the correct output should be: shape, dtype, and semantic meaning (e.g., per-sample vs. per-feature). This anchors the debugging.

2. Reproduce with minimal example

Create a small input that triggers the bug and print intermediate shapes/values to see where the conversion diverges.

3. Test the axis hypothesis

Run the conversion with and without axis=1, compare outputs, and check if the difference matches the expected behavior (e.g., reduction along wrong dimension).

4. Confirm root cause and fix

If axis=1 is missing, explain how adding it corrects the output; if not, identify other causes (e.g., input shape, library version) and propose next steps.

5. Validate and prevent regression

Suggest adding a unit test that asserts the output shape and values for a known input, ensuring the fix is correct and future-proof.

Key Points to Mention

  • The role of axis in numpy/tensor operations (e.g., sum, concatenate, stack) and how omitting it changes behavior.
  • Shape broadcasting and alignment: how axis=1 affects the dimension being operated on.
  • The importance of reproducing the bug with a minimal, deterministic example.
  • Using assertions or print statements to inspect intermediate shapes and values.
  • Considering alternative causes: input shape mismatch, library version differences, or incorrect function usage.
  • Writing a regression test to lock in the fix and prevent future occurrences.

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

Q3

Trace through a from_ndarray usage and find where the conversion logic breaks down.

Root Cause AnalysisSystem Design
Author's notes

By this point I was already rattled from the previous two.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the context: which library's from_ndarray (e.g., TensorFlow, PyTorch, JAX) and what input/output types are expected. Then systematically trace the conversion path, checking shape, dtype, and layout assumptions at each step to isolate where the logic fails.

Pro tip: Demonstrate production maturity by discussing how you'd add logging and unit tests around the conversion to catch regressions, and mention that in ML systems, silent shape or dtype mismatches often cause downstream training failures.

1. Clarify the API and expected behavior

Confirm which from_ndarray function is used, its documented input/output contract, and the specific ndarray properties (shape, dtype, order) it should handle.

2. Reproduce with a minimal example

Create a small, controlled ndarray that triggers the issue, and run the conversion to observe the exact failure or incorrect output.

3. Trace the conversion pipeline

Step through the code path: check how the ndarray is read, whether it's copied or viewed, and where shape/dtype transformations occur.

4. Identify the breakdown point

Compare intermediate values against expectations to pinpoint the exact line or condition where the logic diverges (e.g., unsupported dtype, non-contiguous memory, shape mismatch).

5. Propose a fix and validation

Suggest a targeted fix (e.g., adding a cast, handling non-contiguous arrays) and outline how to test it, including edge cases.

Key Points to Mention

  • Shape and dtype compatibility between NumPy arrays and the target framework's tensor type
  • Memory layout (C vs. Fortran order) and contiguity requirements
  • Handling of non-contiguous or strided arrays during conversion
  • Error handling and fallback mechanisms for unsupported dtypes
  • Performance implications of copying vs. zero-copy conversion
  • Importance of unit tests and logging for conversion functions in ML pipelines

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

Q4

Find the bug related to truncating remainders in a distributed tensor computation.

Root Cause AnalysisTechnical Trade-offsAlgorithms & Data Structures
Author's notes

No idea.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the distributed tensor computation setup, including the operations and data types involved. Then systematically trace where integer division or modulo operations could introduce truncation errors, and propose a fix that preserves numerical precision.

Pro tip: Demonstrate awareness of numerical stability in distributed settings by mentioning how truncation errors can compound across shards, and suggest using higher-precision types or explicit rounding modes.

1. Clarify the computation

Ask for details about the tensor operations, data types, and distribution strategy to understand the context of the bug.

2. Identify truncation points

Locate operations like integer division, modulo, or casting that could truncate remainders, especially in sharding or reduction steps.

3. Trace data flow

Follow the data across devices to see where truncation occurs and how it propagates to final results.

4. Propose a fix

Suggest using floating-point types, explicit rounding, or adjusting the algorithm to avoid truncation, and discuss trade-offs.

5. Validate and test

Recommend unit tests with edge cases and distributed consistency checks to ensure the fix works.

Key Points to Mention

  • Integer division and modulo operations as common sources of truncation
  • Differences between floor, truncation, and rounding in numerical libraries
  • Impact of data types (e.g., int32 vs float32) on precision
  • How sharding and reduction can amplify truncation errors
  • Strategies to maintain numerical stability in distributed systems
  • Testing with edge cases like non-divisible tensor sizes

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