DataDriven
LearnPracticeInterviewDiscussDailyJobs

The Encoded Signal

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
L4

Problem

A device firmware emits letter-frequency telemetry as a compact code with no literal letters in it, and you expand it into counts for the 26 lowercase letters a through z. A single digit from 1 to 9 names one of the first nine letters (`1` is a, `9` is i); two digits immediately followed by `#` name a letter by its position, so `10#` is j, `24#` is x, and `26#` is z. Either kind of letter token may carry a parenthesized count for how many times it occurs, like `1(3)` for three a's, while a bare token counts once, and repeated letters accumulate across the string. Return a 26-element list of totals, position 0 for a through position 25 for z.

Summary

Letters folded into digits, counts hidden in the punctuation.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons