Determine Length of Longest Unique Substring
AmazonData Scientist · Technical ScreenLast updated
This question evaluates string-processing skills and algorithmic problem-solving, including handling character uniqueness and performance considerations. Commonly asked in Coding & Algorithms interviews to assess a candidate's ability to implement efficient solutions and reason about time/space trade-offs, it targets practical application rather than purely conceptual understanding.
Scenario
Online assessment: coding portion that follows the SQL questions.
Question
Implement a function that, given a string s, returns the length of the longest substring without repeating characters.
Hints
Use a sliding window and a hash map to track the latest index of each character.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.