Sliding window interview questions
The longest or shortest run that meets a condition.
3 questions solved with this pattern, most asked first. Reported by candidates in public interview write-ups and reworded by Scrivio. How the reports are counted
Your progress: 0 of 3 done, 0 saved
Find the length of the longest substring with no repeated characters.
Reported 38 times
Read the solutionArrays and stringsExample sources
3 of the write-ups counted: geeksforgeeks.org 2023, geeksforgeeks.org 2023, geeksforgeeks.org 2014
Find the smallest substring of a string that contains every character of another string.
Reported 31 times
Read the solutionArrays and stringsExample sources
3 of the write-ups counted: geeksforgeeks.org 2020, geeksforgeeks.org 2017, geeksforgeeks.org 2017
For every window of k consecutive elements in an array, report the maximum.
Reported 19 times
Read the solutionStacks, queues and heapsExample sources
3 of the write-ups counted: geeksforgeeks.org 2021, geeksforgeeks.org 2019, geeksforgeeks.org 2018