Apple SWE Interview Question 2023 October | Dynamic Programming | on-campus

Question · Posted Jun 2026

Question 1: Longest Palindromic Substring Problem Statement Given a string s, return the longest palindromic substring in s. A palindrome is a string that reads the same backward as forward. 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 palindromic substring of length 3. "aba" is also a valid answer. The longest length is 3. Example 2: Input: s = "cbbd" ...

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

Log in Create a free account