← Microsoft questions

Maximum length of common suffix and prefix

Filed under Microsoft

Find the maximum length of a substring that is both a proper prefix and a proper suffix of a given string, without overlapping or depending on exact KMP definitions depending on standard variations.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.