Question bank › Sliding Window
Dsa Sliding Window Hard

Longest Unique Product Substring

Given a string `products` representing a sequence of product names, determine the length of the longest substring that contains all unique product names. A product name is defined as a sequence of alphabetical characters. Return the length of this longest unique substring. Input Format: The input is a single string consisting of letters, with potential spaces between product names. Output Format: Output a single integer representing the length of the longest unique product substring. Example: Input: apple banana orange apple cherry mango Output: 22

Key concepts

sliding_windowstringhashmap

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.