← Waymo Interview Insights

Waymo·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Waymo software engineer screen, coding focused. The Fibonacci generator question sounds deceptively easy but they pushed pretty hard on the memory and interface tradeoffs, which is where things got interesting.

Questions Asked (1)

Q1

Implement a generator that lazily and indefinitely yields Fibonacci numbers. Walk through memory usage and explain how this differs from returning a precomputed list. Optionally add support for a count or upper bound parameter.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I got the basic generator working fine, two variables, yield, loop forever.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and then implement a generator function that yields Fibonacci numbers indefinitely, using constant memory. Explain how generators maintain state and produce values lazily, contrasting with precomputed lists that store all values. Optionally, discuss adding parameters for count or upper bound and how that affects memory and termination.

Pro tip: Emphasize that generators are ideal for infinite sequences because they compute values on demand, but be prepared to discuss the trade-off of not being able to access arbitrary elements without iterating. Also, mention that adding a bound parameter can make the generator finite and more practical for some use cases.

1. Clarify Requirements

Ask if the generator should be infinite or support a count/upper bound, and confirm the expected interface (e.g., function that returns a generator).

2. Implement Generator

Write a generator function using yield to produce Fibonacci numbers indefinitely, maintaining only the last two numbers in variables.

3. Analyze Memory Usage

Explain that the generator uses O(1) memory because it only stores the current and previous Fibonacci numbers, while a precomputed list uses O(n) memory.

4. Discuss Lazy Evaluation

Describe how generators produce values on demand, enabling infinite sequences and avoiding unnecessary computation, unlike lists which compute all values upfront.

5. Extend with Parameters

Optionally, show how to add a count or upper bound parameter to limit the generator, and discuss how that changes memory and termination behavior.

Key Points to Mention

  • Generators use yield to produce values lazily, one at a time.
  • Memory usage: O(1) for generator vs O(n) for list.
  • Infinite sequences are possible with generators but not with lists (without infinite memory).
  • Lazy evaluation avoids unnecessary computation and allows early termination.
  • Adding a count or upper bound parameter makes the generator finite and can be useful for testing or bounded use cases.
  • Trade-offs: Generators cannot be indexed or iterated multiple times without recreation, while lists allow random access and multiple iterations.

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