← Waymo Interview InsightsSoftware Engineer

Waymo·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026

Summary

Waymo SWE interview that threw a pretty gnarly low-level data structures problem at me. The kind of question where you think you know what they want and then realize halfway through you've been assuming too much.

Questions Asked (1)

Q1

Without using any built-in hash maps, sets, or dictionaries, implement a frozenset-like immutable collection from scratch. It needs to support membership testing, length, iteration, equality comparison, and produce a stable hash. You have to build the underlying hash table yourself using only raw arrays.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

I started with chaining because open addressing felt like more surface area to mess up under pressure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design a hash table using raw arrays with open addressing for collision resolution. Implement the frozenset operations (membership, length, iteration, equality, hash) on top of this table, ensuring immutability and stable hashing. Discuss trade-offs and potential optimizations.

Pro tip: Emphasize that immutability allows precomputing the hash and using a fixed-size table, which simplifies collision handling and ensures stable hashing. Also, mention that open addressing with linear probing is cache-friendly and avoids pointers, aligning with Waymo's performance focus.

1. Clarify requirements and constraints

Confirm that no built-in hash maps/sets/dicts are allowed, and that only raw arrays can be used. Discuss expected operations, performance goals, and whether elements are hashable.

2. Design the hash table

Choose open addressing (e.g., linear probing) with a fixed-size array to store elements. Define a hash function for elements, and handle collisions by probing. Consider load factor and resizing if needed, but since immutable, size can be fixed based on initial elements.

3. Implement core operations

Implement membership testing by hashing the element and probing until found or empty slot. Implement length by maintaining a count. Implement iteration by scanning the array and yielding non-empty slots.

4. Implement equality and hashing

For equality, check same length and that every element in one set is in the other. For hashing, compute a commutative hash (e.g., sum or XOR of element hashes) and cache it for stability.

5. Discuss trade-offs and optimizations

Talk about time complexity (average O(1) for membership, O(n) for equality), space usage, and potential improvements like using a better probing sequence or dynamic resizing if mutability were allowed.

Key Points to Mention

  • Open addressing vs. separate chaining: why open addressing is suitable with raw arrays and immutability.
  • Hash function design: ensuring good distribution and handling collisions.
  • Immutability benefits: precomputed hash, fixed table size, thread safety.
  • Equality comparison: order-independent, using membership checks.
  • Stable hash: commutative operation (e.g., XOR or sum) to ensure order independence.
  • Performance considerations: load factor, probing sequence, and cache efficiency.

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