Find Anagrams in a Character Stream
Asked at Amazon · Coding Questions · Difficulty: Medium · Last asked May 22, 2026
Characters arrive one at a time from a stream, and you must report every position at which the most recent characters form an anagram of a fixed target word. Equivalently, find every window of the stream, as long as the target, that is a permutation of the target.
Loading the problem…