← Waymo Interview Insights

Waymo·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

Waymo SWE interview with a geometry/string manipulation problem that looks deceptively simple but has a few gotchas once you start coding it up. One round, coding focused.

Questions Asked (1)

Q1

You're given an array of digits representing a 7-segment LED display. After rotating the entire display 180 degrees, does it show the same number? Return true or false.

Algorithms & Data Structures
Author's notes

I got the basic idea fast enough: only certain digits survive rotation (0, 1, 2, 5, 6, 8, 9) and the sequence reverses.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that a 180-degree rotation maps each digit to a specific counterpart (0→0, 1→1, 2→2, 5→5, 6→9, 8→8, 9→6) and reverses the order of digits. Use two pointers to compare the original array with the rotated version, validating each digit's rotation and its counterpart. Return true only if all pairs match.

Pro tip: Clarify upfront which digits are considered valid under rotation (typically 0,1,2,5,6,8,9) and handle edge cases like leading zeros or empty arrays. This shows attention to detail and prevents incorrect assumptions.

1. Define rotation mapping

Create a mapping of each digit to its rotated counterpart: 0→0, 1→1, 2→2, 5→5, 6→9, 8→8, 9→6. Digits 3,4,7 are invalid under rotation.

2. Use two pointers

Initialize left at 0 and right at n-1. While left <= right, check if the digit at left can rotate to the digit at right and vice versa.

3. Validate each pair

For each pair, ensure both digits are in the mapping and that mapping[arr[left]] == arr[right] and mapping[arr[right]] == arr[left]. If not, return false.

4. Handle middle element

If the array length is odd, the middle digit must map to itself (i.e., be one of 0,1,8). If not, return false.

5. Return result

If all pairs and the middle element (if any) pass, return true. Otherwise, return false.

Key Points to Mention

  • Rotation mapping: 0→0, 1→1, 2→2, 5→5, 6→9, 8→8, 9→6; invalid digits: 3,4,7.
  • Order reversal: the array is reversed after rotation, so compare first with last, second with second-last, etc.
  • Two-pointer technique for O(n) time and O(1) space.
  • Edge cases: empty array, single digit, leading zeros (e.g., [0,1] rotates to [1,0] which is not the same number).
  • Middle element condition for odd-length arrays: must be self-rotatable (0,1,8).
  • Time and space complexity: O(n) time, O(1) extra space.

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