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

Answer · Posted Jun 2026

Solution: Longest Palindromic Substring — Expand Around Center Approach A palindrome is symmetric around its center. We can solve this problem in O(N2) time and O(1) space by treating each character (and each pair of adjacent characters) as a potential center and expanding outwards as long as the characters match. There are 2 * N - 1 possible centers: N odd-length centers (a single character center) and N - 1 even-length centers (the gap between two characters). For each center, ...

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

Log in Create a free account