Amazon's services process streaming data where you need to find the longest window satisfying a constraint. This is the classic sliding window problem. You track a window of unique characters and expand or shrink it as duplicates appear.
Solve it on LeetCode, then check your approach in the full walkthrough. Pay attention to how the hash map tracks character positions for time and space.