Search
⌘K

Leetcode 239. Sliding Window Maximum

Given an integer array and a window size k, return the maximum value for each contiguous subarray (sliding window) as it moves one step to the right. With n up to 1e5, this requires an O(n) approach typically implemented with a monotonic deque to maintain candidate maxima.

Asked at:

Microsoft

Microsoft

Netflix

Meta

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late March, 2026

Netflix

Senior

common patterns related to sliding window

Mid February, 2026

Microsoft

Microsoft

Mid-level

Mid November, 2025

Microsoft

Microsoft

Mid-level

Your account is free and you can post anonymously if you choose.