← Waymo Interview Insights

Waymo·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Waymo coding interview with a single algorithmic question about big number arithmetic. Not much context on how it went but the problem itself is a classic string manipulation trap that's easy to underestimate.

Questions Asked (1)

Q1

Given two strings where each represents a number too large to fit in a 32-bit integer, how would you add them together and return the result as a string?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Looks simple until you realize you can't just convert to int and call it a day.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that the problem is essentially string-based addition, similar to manual addition, and that you'll simulate the process digit by digit from right to left while handling carries. Then outline an algorithm that iterates through both strings, computes the sum and carry at each position, and builds the result string, ensuring to handle edge cases like different lengths and leading zeros.

Pro tip: Mention that you can optimize space by using a StringBuilder and appending digits, then reversing at the end, and that you should discuss potential follow-ups like handling negative numbers or decimal points to show depth.

1. Clarify requirements and constraints

Ask if the numbers are non-negative, if they can have leading zeros, and if the result should also be a string without leading zeros. Confirm that the numbers are too large for standard integer types.

2. Outline the manual addition algorithm

Explain that you'll process digits from least significant to most significant, maintaining a carry. At each step, sum the digits (or 0 if one string is exhausted) plus the carry, then append the result digit to a StringBuilder.

3. Handle different lengths and final carry

Use two pointers starting at the end of each string and decrement them until both are exhausted. After the loop, if there's a remaining carry, append it to the result.

4. Construct the result string

Since digits are appended in reverse order, reverse the StringBuilder to get the final sum. Optionally, strip any leading zeros (though the algorithm naturally avoids them except for the case of '0').

5. Analyze complexity and edge cases

State that time complexity is O(max(n, m)) and space complexity is O(max(n, m)) for the result. Discuss edge cases: one string empty, both empty, carry propagation, and very long strings.

Key Points to Mention

  • Simulate digit-by-digit addition with carry propagation
  • Use two pointers from the end of each string
  • Handle different lengths by treating missing digits as 0
  • Append digits to a StringBuilder and reverse at the end
  • Time and space complexity analysis
  • Edge cases: empty strings, leading zeros, final carry

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