PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Sealth

Decode Ambiguous Morse Messages

Last updated: Apr 16, 2026

Quick Overview

This question evaluates string parsing, pattern matching, and combinatorial decoding skills using a Morse-to-letter mapping, covering both deterministic separator handling and enumeration of ambiguous letter partitions.

  • medium
  • Sealth
  • Coding & Algorithms
  • Software Engineer

Decode Ambiguous Morse Messages

Company: Sealth

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are given a mapping from Morse patterns to lowercase English letters. Implement two related functions: 1. **Deterministic decoding with character and word separators** - Input: a Morse-encoded string, a `char_sep` that separates letters inside a word, and a `word_sep` that separates words. - Output: the decoded sentence. - Example: if `char_sep` separates letters and `word_sep` separates words, decode the full message by splitting on words first and then on characters. 2. **Enumerate all valid decodings when character separators are missing** - Input: a Morse-encoded string that contains only a `word_sep` between encoded words, but no separator between letters inside each word. - Because each encoded word may be partitioned into letters in multiple valid ways, return **all possible decoded sentences** as a list or set. - For each encoded word, generate every valid letter sequence whose Morse concatenation matches that word exactly, then combine the per-word results into full-sentence outputs. Assume the Morse-to-letter dictionary is provided as part of the problem.

Quick Answer: This question evaluates string parsing, pattern matching, and combinatorial decoding skills using a Morse-to-letter mapping, covering both deterministic separator handling and enumeration of ambiguous letter partitions.

Related Interview Questions

  • Implement one-cluster k-means - Sealth (easy)
  • Simulate Threshold Grid Infection - Sealth (medium)
Sealth logo
Sealth
Jan 13, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0

You are given a mapping from Morse patterns to lowercase English letters.

Implement two related functions:

  1. Deterministic decoding with character and word separators
    • Input: a Morse-encoded string, a char_sep that separates letters inside a word, and a word_sep that separates words.
    • Output: the decoded sentence.
    • Example: if char_sep separates letters and word_sep separates words, decode the full message by splitting on words first and then on characters.
  2. Enumerate all valid decodings when character separators are missing
    • Input: a Morse-encoded string that contains only a word_sep between encoded words, but no separator between letters inside each word.
    • Because each encoded word may be partitioned into letters in multiple valid ways, return all possible decoded sentences as a list or set.
    • For each encoded word, generate every valid letter sequence whose Morse concatenation matches that word exactly, then combine the per-word results into full-sentence outputs.

Assume the Morse-to-letter dictionary is provided as part of the problem.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Sealth•More Software Engineer•Sealth Software Engineer•Sealth 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.