FastPrepLetter Combinations of Phone Digits
Problems/Letter Combinations of Phone Digits

Letter Combinations of Phone Digits

Capital One logoCapital One● MediumINTERNNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two Capital One reports name letter combinations of a phone number as one of their coding questions. One is a 2020 TDP report and one is a 2021 intern report. Neither adds any detail.

Here the standard phone keypad is used (7 and 9 have four letters). The answer lists the strings in a fixed order: earlier digits change slowest, and letters go in keypad order. No digits give an empty list. A fixed order replaces the usual any-order answer so that the result can be compared exactly. These are our choices.

Our version is about 90% the same as the reported questions.

Each digit from 2 to 9 stands for some letters, as on a phone keypad: 2 is abc, 3 is def, 4 is ghi, 5 is jkl, 6 is mno, 7 is pqrs, 8 is tuv and 9 is wxyz.

Spell every string that takes one letter from each digit of digits, keeping the digits in their given order. Return all of them sorted alphabetically. When digits is empty, the answer is an empty list.

Function

letterCombinations(digits: String) → List<String>

Examples

Example 1

digits = "47"return = ["gp","gq","gr","gs","hp","hq","hr","hs","ip","iq","ir","is"]

4 gives g, h, i and 7 gives p, q, r, s. Each of the 3 first letters pairs with each of the 4 second letters, so there are 12 strings, starting with gp, gq, gr, gs.

Example 2

digits = "9"return = ["w","x","y","z"]

One digit: its four letters, each as a one-letter string, in keypad order.

Example 3

digits = ""return = []

With no digits pressed there is nothing to spell, so the list is empty.

Constraints

  • 0 <= digits.length <= 4
  • Each character of digits is a digit from 2 to 9.

More Capital One Onsite Interview questions

  • Digit-Coded Card ValidationONSITE INTERVIEW · Seen Nov 2026
  • Sort ColorsONSITE INTERVIEW · Seen Oct 2026
  • Virtual Card Transaction ValidatorONSITE INTERVIEW · Seen Oct 2026
  • Banking System with Top ActivityONSITE INTERVIEW · Seen Sep 2026
  • Transaction Event StoreONSITE INTERVIEW · Seen Jul 2026
  • Shortest Path in an Unweighted GraphONSITE INTERVIEW · Seen Jul 2026
  • Duplicate Transactions Within 60 SecondsONSITE INTERVIEW · Seen May 2026
  • LRU CachePHONE SCREEN · ONSITE INTERVIEW · Seen May 2026
  • Cashback TrackerONSITE INTERVIEW · Seen Nov 2025
  • Reverse a StringOA · ONSITE INTERVIEW · Seen Oct 2025

Similar questions at other companies

  • Generate Strings of Length at Least ThreeMorgan Stanley · ONSITE INTERVIEWMorgan Stanley interview questions
  • Insert Addition and Multiplication OperatorsPinterest · ONSITE INTERVIEWPinterest interview questions
  • Enumerate All SubsequencesInfosys · ONSITE INTERVIEWInfosys interview questions
  • Generate ParenthesesAmazon · ONSITE INTERVIEW
  • Maximum Unique-Character Word SubsetMeta · ONSITE INTERVIEWMeta interview questions
  • Generate All Valid Word AbbreviationsSalesforce · ONSITE INTERVIEWSalesforce interview questions
  • Phone Keypad Letter CombinationsGoogle · ONSITE INTERVIEWGoogle interview questions
  • Generate ParenthesesMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Generate Palindromic PermutationsMotive · ONSITE INTERVIEWMotive interview questions
  • Permutations of Character PositionsPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions

Capital One interview experiences

  • Capital One Coding OA Questions: 3 Experiences
  • Capital One Experienced Engineer Power Day and OA: 6 Experiences
  • Capital One New Grad OA Questions: 14 Experiences (Part 2 of 2)
  • Capital One TDP Agentic Round (AI Coding): 7 Experiences
  • Capital One SWE Power Day, Level Not Reported: 6 Experiences
  • Capital One TIP Intern OA and Power Day: 13 Experiences
All Capital One interview questionsSee Capital One hiring insights
Saved
class Solution {
    public List<String> letterCombinations(String digits) {
        // Write your code here.
    }
}
Checking account…