Nth License Plate
Updated
Problem statement
License plates are five-character strings arranged in six consecutive groups. In group L, where 0 <= L <= 5, a plate has 5 - L leading decimal digits followed by L uppercase English letters.
Within a group, the numeric part varies fastest from all zeroes to all nines. The letter suffix then advances in ordinary base-26 order from all A characters to all Z characters. For example, the sequence starts with 00000 through 99999, then 0000A through 9999A, then 0000B, and eventually ends at ZZZZZ.
Given the one-indexed position n, return the corresponding license plate.
Function
nthLicensePlate(n: int) → StringExamples
Example 1
n = 3return = "00002"The first three plates are 00000, 00001, and 00002.
Example 2
n = 100001return = "0000A"The first 100000 positions contain five digits, so the next plate begins the one-letter group.
Constraints
1 <= n <= 19244736
More Google Onsite Interview questions
- Evaluate a Nested Math ExpressionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Distinct Subset SumsONSITE INTERVIEW · Seen Nov 2026
- Playlist With No Same Artist in a RowONSITE INTERVIEW · Seen Nov 2026
- Route Pattern MatcherPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Delete Nodes and Return Forest RootsONSITE INTERVIEW · Seen Nov 2026
- Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- First and Last Target Position in a Mountain ArrayONSITE INTERVIEW · Seen Nov 2026
- Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- 0/1 Knapsack with Weight and Volume LimitsONSITE INTERVIEW · Seen Nov 2026
- Batched Subsequence Word MatchesONSITE INTERVIEW · Seen Nov 2026
Similar questions at other companies
- Calculate a Token-List ExpressionCollege Vine · ONSITE INTERVIEW
- Iterate Canonical IPv6 AddressesOpenAI · ONSITE INTERVIEWOpenAI interview questions
- Parse a Signed Integer in Any BaseMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
- Bit at an Index After Repeated Binary ExpansionAmazon · PHONE SCREEN · ONSITE INTERVIEW
- Text Embedding and Vector SearchNike, Inc. · PHONE SCREEN · ONSITE INTERVIEWNike, Inc. interview questions
- Fraction to Recurring DecimalGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
- Rank Bipedal Dinosaurs by SpeedMeta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
- Every Result of Grouping an ExpressionC3.ai · ONSITE INTERVIEWC3.ai interview questions
- Largest Minus Smallest Value of a Parenthesized ExpressionNutanix · ONSITE INTERVIEWNutanix interview questions
- String to Integer with ClampingAMD · ONSITE INTERVIEWAMD interview questions