Square SDE Interview Question 2022 November | Dynamic Programming | on-campus

Question · Posted Jun 2026

Question 1 Problem Statement A message containing letters from A-Z can be encoded into numbers using the mapping: 'A' = 1, 'B' = 2, ..., 'Z' = 26. Given a string s containing only digits, return the number of ways to decode it. If the entire string cannot be decoded in any valid way, return 0. Constraints 1 <= s.length <= 100 s contains only digits and may contain leading zeros Examples Example 1: Input: s = "226" Output: 3 ...

The full answer & interview discussion are available to premium members.

Log in Create a free account