← Waymo Interview Insights

Waymo·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Waymo Data Scientist screen, pretty straightforward Python fundamentals. One coding question, nothing that required deep ML knowledge, which surprised me a bit.

Questions Asked (1)

Q1

Write a Python function that computes the arithmetic mean of a list of numbers, returning 0 for an empty list and without modifying the input.

Algorithms & Data Structures
Author's notes

Seemed almost too easy so I second-guessed myself for a second.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases, then write a clean, efficient function using built-in functions like sum() and len(). Emphasize that the input list is not modified and handle the empty list case explicitly.

Pro tip: Mention that you would use sum(numbers) / len(numbers) for efficiency and readability, but also discuss potential pitfalls like integer division in Python 2 or very large lists causing overflow (though Python handles big ints). This shows awareness of production concerns.

1. Clarify requirements

Confirm that the function should return 0 for an empty list, not modify the input, and handle any numeric type (int, float).

2. Design the function

Decide on the function signature and approach: use built-in sum() and len() for simplicity and performance, with an early return for empty lists.

3. Implement the solution

Write the code: check if the list is empty, return 0; otherwise compute sum(numbers) / len(numbers). Ensure no in-place modification.

4. Test edge cases

Test with empty list, single element, negative numbers, floats, and large lists. Verify the original list remains unchanged.

5. Discuss complexity and alternatives

Mention time complexity O(n) and space O(1). Optionally discuss using statistics.mean() or manual loop for educational purposes.

Key Points to Mention

  • Use built-in sum() and len() for efficiency and readability.
  • Handle empty list by returning 0 to avoid division by zero.
  • Ensure the input list is not modified (no in-place operations).
  • Consider numeric types: ints, floats, and potential precision issues.
  • Time complexity is O(n) and space complexity is O(1).
  • Mention alternative approaches like statistics.mean() or manual accumulation.

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