Question bank › Heap
Dsa Heap Easy

Sliding Window Maximum

You are given an array of integers and a sliding window size K. Your task is to find the maximum value within each sliding window as it moves from left to right. The input starts with an integer K followed by the elements of the array. The output should be the maximum values found in each sliding window. Example Input: 3 1 3 -1 -3 5 3 6 7 Example Output: 3 3 5 6 7

Key concepts

heapsliding windowmaximum value

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.