Find the longest palindromic substring

Read the full interview experience this question came from →

Quick Overview

This question evaluates string manipulation and algorithmic problem-solving skills, focusing on identifying palindromic substrings and reasoning about performance and edge cases. Commonly asked in the Coding & Algorithms domain to assess practical algorithmic application, it gauges understanding of time/space complexity, input constraints, and robustness in implementation.

Find the longest palindromic substring

Company: Intersystems

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

## Problem Given a string `s`, find the **longest contiguous substring** of `s` that is a palindrome (reads the same forward and backward). ### Input - A string `s` consisting of ASCII letters/digits (you may assume standard printable characters). ### Output Return **one** longest palindromic substring. If there are multiple valid answers with the same maximum length, return any of them. ### Constraints - `1 <= |s| <= 2000` ### Examples - Input: `"babad"` → Output: `"bab"` (or `"aba"`) - Input: `"cbbd"` → Output: `"bb"` ### Notes In the interview setting, you may be asked to **explain the approach verbally** (no code required), including time/space complexity and edge cases.

Overview: This question evaluates string manipulation and algorithmic problem-solving skills, focusing on identifying palindromic substrings and reasoning about performance and edge cases. Commonly asked in the Coding & Algorithms domain to assess practical algorithmic application, it gauges understanding of time/space complexity, input constraints, and robustness in implementation.

Read the full Intersystems Software Engineer interview experience this question came from

|Home/Coding & Algorithms/Intersystems
Intersystems logo
Intersystems
Feb 11, 2026
easySoftware EngineerTechnical ScreenCoding & Algorithms
3
0

Problem

Given a string s, find the longest contiguous substring of s that is a palindrome (reads the same forward and backward).

Input

  • A string s consisting of ASCII letters/digits (you may assume standard printable characters).

Output

Return one longest palindromic substring. If there are multiple valid answers with the same maximum length, return any of them.

Constraints

  • 1 <= |s| <= 2000

Examples

  • Input: "babad" → Output: "bab" (or "aba" )
  • Input: "cbbd" → Output: "bb"

Notes

In the interview setting, you may be asked to explain the approach verbally (no code required), including time/space complexity and edge cases.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...