Sliding Window
Sliding Window is an algorithmic technique for processing contiguous portions of an array or string efficiently. Instead of recomputing information for every possible window, we maintain a current window and incrementally add and remove elements as the window moves.
Useful for contiguous subarray or substring problems.
A common use case is finding the longest substring without repeating characters.
Another use case is finding the minimum-length subarray satisfying a condition.
Many sliding-window solutions reduce a brute-force O(n²) approach to O(n).
The exact validity condition depends on the problem and data properties.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience