← Waymo Interview Insights

Waymo·Machine Learning Engineer·Onsite - Coding / Algorithms·Senior

SeniorPrefer not to say
Jun 2026

Summary

Waymo ML engineer interview with a debugging-heavy coding round. They handed me a small tensor utility library with three distinct bugs and asked me to find them, fix them, and write tests. Not the typical leetcode grind, which I appreciated, but the aliasing bug in particular took me longer than I'd like to admit.

Questions Asked (1)

Q1

Given a buggy tensor utility library with issues in matrix initialization, array conversion, and chunk splitting, identify all the bugs, fix them, and add tests covering aliasing, shape correctness, and non-divisible chunk sizes.

Algorithms & Data StructuresTechnical Trade-offsRoot Cause Analysis
Author's notes

The aliasing one is sneaky.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by systematically reviewing each function to identify bugs, then fix them while ensuring correct behavior for edge cases like aliasing and non-divisible chunks. Finally, write comprehensive tests that cover the specified scenarios, demonstrating thoroughness and attention to detail.

Pro tip: When fixing bugs, consider not just the immediate issue but also potential aliasing problems and shape mismatches that could arise in real-world ML pipelines. Writing tests first can help clarify expected behavior and prevent regressions.

1. Understand the Code and Requirements

Read the provided tensor utility library carefully, noting the expected behavior for matrix initialization, array conversion, and chunk splitting. Identify the specific requirements: aliasing, shape correctness, and non-divisible chunk sizes.

2. Identify and Fix Bugs

For each function, trace through the logic to find bugs. Common issues include incorrect shape handling, aliasing (e.g., returning views instead of copies), and off-by-one errors in chunk splitting. Fix them while preserving intended functionality.

3. Write Tests for Edge Cases

Create tests that cover aliasing (modifying the output should not affect the input), shape correctness (output shapes match expectations), and non-divisible chunk sizes (last chunk may be smaller). Include both typical and edge cases.

4. Validate and Refactor

Run the tests to ensure all pass. Refactor code if needed for clarity and efficiency, ensuring fixes are robust and don't introduce new issues.

Key Points to Mention

  • Aliasing: ensure functions return copies when necessary to avoid unintended side effects.
  • Shape correctness: verify that output dimensions match input and expected transformations.
  • Non-divisible chunk sizes: handle cases where the array length is not a multiple of chunk size, ensuring the last chunk contains the remainder.
  • Edge cases: test with empty arrays, single-element arrays, and multi-dimensional arrays.
  • Test coverage: include unit tests for each function, covering both normal and edge cases.
  • Root cause analysis: explain why each bug occurred and how the fix addresses it.

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