← Waymo Interview Insights

Waymo·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026

Summary

Waymo software engineering interview that threw a pretty nasty low-level data structures problem at me. The whole thing was about reimplementing frozenset from scratch, no standard library shortcuts allowed.

Questions Asked (1)

Q1

Without using any built-in hash-based data structures, implement a frozenset from scratch in Python. 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 arrays.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This wrecked me a little.

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 open addressing with linear probing to handle collisions. Implement the frozenset operations (membership, length, iteration, equality, hash) on top of this table, ensuring immutability and a stable hash. Discuss trade-offs and edge cases like resizing and collision resolution.

Pro tip: Emphasize that the hash of the frozenset must be order-independent and stable; a common approach is to XOR the hashes of all elements, but be prepared to discuss potential collisions and improvements like using a commutative operation with better mixing.

1. Clarify Requirements and Constraints

Confirm that no built-in hash-based structures (dict, set) can be used, and that only arrays (lists) are allowed. Discuss expected operations and performance requirements.

2. Design the Hash Table

Choose open addressing with linear probing for collision resolution. Define the underlying array, size, and load factor threshold for resizing.

3. Implement Core Operations

Write methods for insertion, membership testing, and resizing. Ensure iteration works by scanning the array and skipping empty slots.

4. Implement Equality and Hashing

For equality, check that both sets have the same size and that every element of one is in the other. For hashing, combine element hashes in an order-independent way (e.g., XOR) and cache the result for stability.

5. Test and Discuss Trade-offs

Test with edge cases (empty set, collisions, resizing). Discuss trade-offs: open addressing vs. chaining, load factor choice, and hash collision handling.

Key Points to Mention

  • Open addressing with linear probing for collision resolution, using arrays only.
  • Load factor and resizing strategy to maintain performance.
  • Order-independent hash computation (e.g., XOR of element hashes) and caching for stability.
  • Equality comparison: size check and membership check for all elements.
  • Iteration by scanning the underlying array and skipping empty slots.
  • Immutability: ensure no modifications after creation, and handle hash caching safely.

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