Max of All Subarrays of Size k Using Max Heap in C++ This problem, also referred to as the “sliding window maximum” problem, can be efficiently solved using heaps. We’ve already discussed an O(n) solution. Arrays, Competitive Programming, Heaps, Interview Questions