PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/LinkedIn

Group words that map to same phone digits

Last updated: Apr 9, 2026

Quick Overview

This question evaluates string processing, mapping and grouping competencies and the ability to design efficient encodings for detecting collisions, assessing practical application of algorithmic techniques. It is commonly asked in the Coding & Algorithms domain because it probes algorithmic efficiency, data-structure selection, and handling of input-size and performance constraints.

  • medium
  • LinkedIn
  • Coding & Algorithms
  • Software Engineer

Group words that map to same phone digits

Company: LinkedIn

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Problem On a classic phone keypad (T9), letters map to digits: - `2: ABC`, `3: DEF`, `4: GHI`, `5: JKL`, - `6: MNO`, `7: PQRS`, `8: TUV`, `9: WXYZ` Given a list of lowercase words, convert each word into its digit string (e.g., `"tree" -> "8733"`). Return all **groups of words** that map to the **same digit string** (i.e., collisions). Only include groups of size `>= 2`. ## Input / Output - **Input:** `words: string[]` (lowercase a–z) - **Output:** A list of groups, where each group is a list of words sharing the same digit encoding. ## Constraints (typical) - `1 <= len(words) <= 2 * 10^5` - `1 <= len(word) <= 30` ## Examples - Input: `["tree", "used", "apple", "vase"]` - `tree -> 8733`, `used -> 8733`, `apple -> 27753`, `vase -> 8273` - Output: `[["tree", "used"]]`

Quick Answer: This question evaluates string processing, mapping and grouping competencies and the ability to design efficient encodings for detecting collisions, assessing practical application of algorithmic techniques. It is commonly asked in the Coding & Algorithms domain because it probes algorithmic efficiency, data-structure selection, and handling of input-size and performance constraints.

Related Interview Questions

  • Count Trips From Vehicle Logs - LinkedIn (easy)
  • Design O(1) Randomized Multiset - LinkedIn (easy)
  • Process Mutable Matrix Sum Queries - LinkedIn (medium)
  • Design a Randomized Multiset - LinkedIn (medium)
  • Can You Place N Objects? - LinkedIn (medium)
LinkedIn logo
LinkedIn
Oct 20, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0

Problem

On a classic phone keypad (T9), letters map to digits:

  • 2: ABC , 3: DEF , 4: GHI , 5: JKL ,
  • 6: MNO , 7: PQRS , 8: TUV , 9: WXYZ

Given a list of lowercase words, convert each word into its digit string (e.g., "tree" -> "8733").

Return all groups of words that map to the same digit string (i.e., collisions). Only include groups of size >= 2.

Input / Output

  • Input: words: string[] (lowercase a–z)
  • Output: A list of groups, where each group is a list of words sharing the same digit encoding.

Constraints (typical)

  • 1 <= len(words) <= 2 * 10^5
  • 1 <= len(word) <= 30

Examples

  • Input: ["tree", "used", "apple", "vase"]
    • tree -> 8733 , used -> 8733 , apple -> 27753 , vase -> 8273
    • Output: [["tree", "used"]]

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More LinkedIn•More Software Engineer•LinkedIn Software Engineer•LinkedIn Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.