PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/Amazon

Count unique Morse-code word transformations

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to implement string transformations based on a fixed character-to-code mapping and to identify distinct results, testing competencies in encoding, string manipulation, and deduplication.

  • hard
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Count unique Morse-code word transformations

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

Given an array of lowercase strings `words`. Each letter 'a' to 'z' has a corresponding Morse code string (standard 26-letter mapping). A word’s **transformation** is the concatenation of the Morse codes of its letters in order. Return the number of **distinct transformations** among all words. Example: if "cab" transforms to "-.-..--..." ("-.-." + ".-" + "-..."), then two words are considered the same if their full transformed strings are identical.

Quick Answer: This question evaluates a candidate's ability to implement string transformations based on a fixed character-to-code mapping and to identify distinct results, testing competencies in encoding, string manipulation, and deduplication.

Related Interview Questions

  • Find Valid IP Addresses in Files - Amazon (medium)
  • Implement Optimal Bucket Batching - Amazon (hard)
  • Implement Cache and Rotate Matrix - Amazon (medium)
  • Find Longest Activatable Server Streak - Amazon (hard)
  • Build the Largest Available Sequence - Amazon (medium)
Amazon logo
Amazon
Jan 15, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
4
0

Given an array of lowercase strings words. Each letter 'a' to 'z' has a corresponding Morse code string (standard 26-letter mapping). A word’s transformation is the concatenation of the Morse codes of its letters in order.

Return the number of distinct transformations among all words.

Example: if "cab" transforms to "-.-..--..." ("-.-." + ".-" + "-..."), then two words are considered the same if their full transformed strings are identical.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • 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.