← Google Interview Insights

Google·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Google SWE interview with a math-heavy coding question about license plate enumeration. The whole thing hinged on figuring out a closed-form solution, no brute force allowed.

Questions Asked (1)

Q1

License plates follow the format of three uppercase letters (A-Z) followed by three digits (0-9), giving plates like AAA000 through ZZZ999. If you sort all valid plates lexicographically, how do you find the Nth plate (1-indexed) in O(1) time without iterating through them?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I stared at this for an embarrassingly long time before realizing it's basically a mixed-radix number decoding problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that the plates form a mixed-radix number system where the first three positions are base-26 (A=0) and the last three are base-10. Convert N-1 to this mixed-radix representation to directly compute each character without iterating. Explain the conversion process and provide the O(1) formula.

Pro tip: Emphasize that the problem is essentially base conversion; by treating the plate as a number in base 26^3 * 10^3, you can compute the Nth plate in constant time. Mention that this approach generalizes to any fixed-length alphanumeric code.

1. Understand the ordering

Confirm that lexicographic order matches numeric order when letters are mapped to 0-25 and digits to 0-9, with the leftmost character as the most significant.

2. Model as mixed-radix number

Treat the plate as a 6-digit number where the first three digits are base-26 and the last three are base-10. The total number of plates is 26^3 * 10^3 = 17,576,000.

3. Convert N to zero-based index

Subtract 1 from N to get a zero-based index k, since the first plate corresponds to k=0.

4. Compute each character via division and modulo

Extract the last three digits by taking k mod 10, then divide by 10; repeat for three digits. Then extract the three letters by taking the quotient mod 26, then divide by 26; repeat. Map digits 0-9 to '0'-'9' and letters 0-25 to 'A'-'Z'.

5. Assemble and verify

Combine the characters in order (three letters followed by three digits) to form the Nth plate. Optionally, verify with a small example (e.g., N=1 gives AAA000).

Key Points to Mention

  • Mixed-radix number system: base-26 for letters, base-10 for digits.
  • Zero-based indexing: subtract 1 from N to simplify calculations.
  • Constant time O(1) because the number of operations is fixed (6 divisions/modulos).
  • Mapping: 0-25 to 'A'-'Z', 0-9 to '0'-'9'.
  • Generalization: any fixed-length code can be handled similarly.
  • Edge cases: N=1 and N=17,576,000 produce AAA000 and ZZZ999 respectively.

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