PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Meta

Validate word abbreviation and reconcile two abbreviations

Last updated: Mar 29, 2026

Quick Overview

This question evaluates string parsing and pattern-matching competencies, including handling numeric tokens in abbreviations, reconciling ambiguous alignments between two abbreviation patterns, and reasoning about validation rules and edge cases within the Coding & Algorithms domain.

  • Medium
  • Meta
  • Coding & Algorithms
  • Software Engineer

Validate word abbreviation and reconcile two abbreviations

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Implement a function isValidAbbreviation(word: string, abbr: string) that returns true if abbr is a valid abbreviation of word, where a positive integer in abbr represents the number of letters skipped and leading zeros are invalid. Follow-ups: (a) Given two abbreviations abbr1 and abbr2, determine whether there exists at least one original word (over lowercase letters) that both could represent; if so, return true and output one possible alignment of kept/skipped positions, otherwise return false. (b) Analyze time and space complexity, and discuss how you would handle very long inputs or streaming validation.

Quick Answer: This question evaluates string parsing and pattern-matching competencies, including handling numeric tokens in abbreviations, reconciling ambiguous alignments between two abbreviation patterns, and reasoning about validation rules and edge cases within the Coding & Algorithms domain.

Related Interview Questions

  • Solve Tree Columns And Maze Variants - Meta (medium)
  • Solve Tree Diameter and Palindromic Counts - Meta (medium)
  • Simulate Monster Team Battles - Meta (hard)
  • Solve a Key-Door Corridor Maze - Meta (medium)
  • Solve Array Merge and Parentheses Cleanup - Meta (medium)
Meta logo
Meta
Jul 15, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

Implement a function isValidAbbreviation(word: string, abbr: string) that returns true if abbr is a valid abbreviation of word, where a positive integer in abbr represents the number of letters skipped and leading zeros are invalid. Follow-ups: (a) Given two abbreviations abbr1 and abbr2, determine whether there exists at least one original word (over lowercase letters) that both could represent; if so, return true and output one possible alignment of kept/skipped positions, otherwise return false. (b) Analyze time and space complexity, and discuss how you would handle very long inputs or streaming validation.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 8,500+ 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.