Check Whether a Word Matches a Numeric Abbreviation Like i18n

Last updated: November 29, 2026

Quick Overview

Given a word and an abbreviation in which runs of digits mean "skip that many letters" (for example "i18n" for "internationalization"), decide whether the abbreviation is valid for the word; numbers may not have leading zeros.

Google
Coding & Algorithms
Software Engineer
Google
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a word and an abbreviation in which runs of digits mean "skip that many letters" (for example "i18n" for "internationalization"), decide whether the abbreviation is valid for the word; numbers may not have leading zeros.

Google engineers use numeronyms like i18n, l10n, and a11y daily, which makes this a natural screen question. The interviewer is checking two-pointer discipline, multi-digit number parsing, and the leading-zero and overrun edge cases.

What the Interviewer Expects
  • Uses two pointers, one into the word and one into the abbreviation
  • Parses multi-digit skip counts rather than single digits
  • Rejects leading zeros, including a lone zero
  • Checks that both pointers end exactly at their string ends
  • Walks through an example with a two-digit count
Key Topics to Cover
Two Pointers
String Parsing
Number Parsing
Edge Cases
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Generate every valid abbreviation of a word.
  • Find the shortest abbreviation of a word that matches no word in a dictionary.
  • What changes if the abbreviation may also use wildcard letters?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • Input: word (lowercase letters) and abbr (letters and digits).
  • A digit run k means skip exactly k characters of word; letters must match exactly.
  • Leading zeros are invalid (a03e), an...
High-Level Design

Keep i into the word and j into the abbreviation. When abbr[j] is a letter, compare and advance both. When it is a digit, read the full number, then jump i forward by that amount. Overshooting...


Submit Your Answer
Markdown supported