Find the longest palindromic substring
Company: TikTok
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Technical Screen
## Problem
Given a string `s`, return the **longest contiguous substring** of `s` that is a **palindrome** (reads the same forward and backward).
## Input
- `s`: a non-empty string of length `n`
## Output
- A substring of `s` that is the longest palindrome. If multiple answers exist, return any one.
## Constraints
- `1 ≤ n ≤ 2000`
- `s` contains ASCII letters/digits (you may assume no spaces).
## Examples
- Input: `"babad"` → Output: `"bab"` (or `"aba"`)
- Input: `"cbbd"` → Output: `"bb"`
Quick Answer: This question evaluates proficiency in string manipulation and algorithmic problem-solving, focusing on palindrome detection and substring handling within the Coding & Algorithms domain.