Snowflake SWE Interview Question 2024 July | Dynamic Programming | on-campus

Question · Posted Jun 2026

Question: Longest Palindromic Substring Problem Statement Given a string s, return the longest palindromic substring in s. Constraints 1 <= s.length <= 1000 s consists of only digits and English letters. Examples Example 1: Input: s = "babad" Output: "bab" Explanation 1: "bab" is a valid palindromic substring of length 3. Note that "aba" is also a valid answer. The solution finds the longest contiguous sequence that reads the same backwards and forwards. Example 2: Input: s = "cbbd" Output: ...

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

Log in Create a free account