Question bank › Strings
Dsa Strings Medium

Mirror Image Substring

Write a function that, given a string, finds the longest substring that is a mirror image of itself (i.e., it reads the same backward and forward). The mirror image does not need to be a contiguous block, but the letters must be present in reverse order. Return the length of this substring. Example Input: aabbcc Example Output: 2

Key concepts

stringssubstringspalindromes

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.