Reported September 2026
Juspaysliding window

Minimum of Fixed-Window Maxima

Reported by candidates from Juspay's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Juspay OA. Under 2s to a working solution.
Founder's read

Juspay reported this one in September 2026, and the title sounds scarier than it is. Strip the wording and it's a sliding window maximum problem with one extra step: take the smallest of all the window maxima. If you've seen the monotonic deque pattern, you're done in ten minutes. If you haven't, the brute force will look tempting and fail on big inputs. You have an OA coming up, so here's what the problem really wants and where people trip. StealthCoder sits invisible on your screen as a safety net if your mind goes blank mid-assessment.

The problem

You are given an integer array nums and an integer k. Consider every contiguous subarray of exactly k elements.
Compute the maximum value in each such window, then return the minimum among all of those window maxima.

Function
minimumWindowMaximum(nums: int[], k: int) → int

Examples
Example 1
nums = [1,3,2,5,1,4]
k = 3
return = 3
The four window maxima are 3, 5, 5, and 5. Their minimum is 3.
Example 2
nums = [-4,-2,-7,-3]
k = 2
return = -3
The window maxima are -2, -2, and -3. The minimum is -3.
Example 3
nums = [5,1,5]
k = 1
return = 1
With k = 1, every element is its own window maximum. The smallest of 5, 1, and 5 is 1.

Constraints
1 <= nums.length.
1 <= k <= nums.length.
Every value in nums is a signed 32-bit integer.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The core is a sliding window maximum. Keep a deque of indices whose values are in decreasing order. For each new element, pop from the back while the back value is less than or equal to the new one, push the index, and pop from the front if it's outside the window. Once you've seen k elements, the front holds the window max. Track a running minimum of those maxima and return it. That's O(n) time and O(k) space. The common pitfall is the brute force that rescans every window, which is O(n*k) and dies on large arrays. Another is initializing the answer to 0 instead of the max int, which breaks on negative values like Example 2. Also check k = 1 and k = n. If the deque logic slips under pressure, StealthCoder is the hedge on the live OA, reading the problem and handing you the working version.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Minimum of Fixed-Window Maxima cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Juspay's OA.

Juspay reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum of Fixed-Window Maxima FAQ

What's the trick in the Juspay minimum of window maxima problem?+

It's a standard sliding window maximum with a monotonic deque. Compute each window's max in amortized O(1), then keep the minimum of those. Don't overthink the second step. It's just a running min variable updated once per full window.

How hard is this problem really?+

Medium if you know the deque technique, annoying if you don't. The logic is short, but the index handling is easy to get wrong. Brute force passes small cases, so test mentally against larger inputs before trusting it.

Can I solve it without a deque?+

Yes. A max-heap with lazy deletion works in O(n log n). You can also use sparse tables or a block-based prefix and suffix max trick for O(n). The deque is the simplest to write and the fastest, so default to it.

What edge cases should I test?+

Test k = 1, where the answer is the array minimum. Test k = nums.length, where the answer is the global max. Test all-negative arrays like Example 2, and duplicates, since popping on less-than-or-equal versus strictly-less changes the deque contents.

How do I prepare for this in 48 hours?+

Write the sliding window maximum deque solution from scratch twice without looking. Then add the running minimum. Practice the index expiry check, since that's where bugs hide. After that, run the three examples by hand and you're set.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Juspay.

OA at Juspay?
Invisible during screen share
Get it