Question bank › Strings
Dsa Strings Medium

Longest Repeated Substring

Given an input string, find the length of the longest substring that appears at least twice in the string. A substring is defined as a sequence of characters that can appear in the string. If no repeated substring exists, return 0. Example Input: 'banana' Example Output: 3

Key concepts

stringssubstringsdynamic_programming

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 Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.