FastPrepPhone-Number Letter Combinations
Problems/Phone-Number Letter Combinations

Phone-Number Letter Combinations

Headway logoHeadway● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names a variation of phone-number letter combinations but does not describe the variation. This practice uses the standard digit mapping and ordered Cartesian product; empty-input behavior, bounds, and examples are exercise assumptions. Approximate source match: 75%.

Given a string digits, return every letter combination represented by its digits on a telephone keypad.

For this exercise, assume the standard mapping:

  • 2 maps to abc.
  • 3 maps to def.
  • 4 maps to ghi.
  • 5 maps to jkl.
  • 6 maps to mno.
  • 7 maps to pqrs.
  • 8 maps to tuv.
  • 9 maps to wxyz.

Choose exactly one letter for each digit and keep the letters in the same order as the digits. Return all combinations in alphabetical order. In this exercise, an empty digits string returns an empty array, not an array containing an empty string.

Function

letterCombinations(digits: String) → List<String>

Examples

Example 1

digits = "23"return = ["ad","ae","af","bd","be","bf","cd","ce","cf"]

Choose one letter from abc, then one from def. Listing the choices in ascending order gives nine combinations.

Example 2

digits = ""return = []

The empty-input rule returns no combinations.

Example 3

digits = "79"return = ["pw","px","py","pz","qw","qx","qy","qz","rw","rx","ry","rz","sw","sx","sy","sz"]

Both digits have four letters. Each letter from pqrs is paired with every letter from wxyz, producing sixteen ordered combinations.

Constraints

  • 0 <= digits.length <= 4.
  • Every character in digits is a digit from 2 through 9.

More Headway Phone Screen questions

  • License Checkout and Return ManagerPHONE SCREEN · Seen Aug 2026
  • Hierarchical Fixed-Window Rate LimiterPHONE SCREEN · Seen Jul 2026

Similar questions at other companies

  • All English Decodings of Morse CodeOscar Health · PHONE SCREEN
  • Largest Number Below N from Reusable DigitsByteDance · PHONE SCREENByteDance interview questions
  • Letter Combinations of a Phone NumberLinkedIn · PHONE SCREENLinkedIn interview questions
  • String Permutations in Custom Character OrderWex · OA · PHONE SCREEN
  • Numeric Poker OperationsRippling · PHONE SCREENRippling interview questions
  • Unique String PermutationsAmazon · PHONE SCREEN
  • Permutations of Unique CharactersSalesforce · PHONE SCREENSalesforce interview questions
  • Count Prefix Paths in a Character GraphGoogle · PHONE SCREENGoogle interview questions
  • Sorted Subsets of a StringMicrosoft · PHONE SCREENMicrosoft interview questions
  • Maximum Unique Substring SplitThe Walt Disney Company · PHONE SCREENThe Walt Disney Company interview questions

Headway interview experiences

  • Headway Karat 1st Interview Round (Same for all level)
All Headway interview questionsSee Headway hiring insights
Saved
class Solution {
    public List<String> letterCombinations(String digits) {
        // Write your code here.
    }
}
Checking account…