THOUGHTWORKS Graduate Developer OA (2023) | Message Decryption Count | Dynamic Programming Solution (Java)
Question · Posted Jun 2026
Q1. Encrypted Message Interpretation Problem Statement A secure communication system stores messages as a string containing digits. The decoding rules are: 1 -> A 2 -> B ... 26 -> Z A message can sometimes be interpreted in multiple ways because one or two consecutive digits may form a valid character. Given an encoded string, determine the total number of valid interpretations possible. Return 0 if the message cannot be decoded completely. Example 1 Input message = "226" Output ...
The full answer & interview discussion are available to premium members.
Log in Create a free account