Skip to main content
All Questions

Find the maximum of the minimum available space over all windows of size x.

Unlock detailed company stats for this questionUpgrade

Given an array space[] and a window size x, find the minimum available space in every contiguous window of size x, then return the maximum among those minimum values.

Example: x = 2, space = [8, 2, 4, 6]. Window minimums = [2, 2, 4], so the answer is 4.

Constraints were large, requiring an efficient sliding-window approach combined with a min-heap.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.