Compute streaming sliding-window minimums
Company: Aurora
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: This question evaluates a candidate's understanding of streaming algorithms and efficient data-structure techniques for maintaining sliding-window minima, measuring competency in algorithmic thinking, time and space complexity, and online processing.
Constraints
- k >= 1
Examples
Input: ([4, 2, 12, 3, -1, 6], 3)
Expected Output: [4, 2, 2, 2, -1, -1]
Explanation: One output per element.
Input: ([1, 2, 3], 1)
Expected Output: [1, 2, 3]
Explanation: Window size one.
Input: ([3, 2, 1], 5)
Expected Output: [3, 2, 1]
Explanation: Window larger than prefix.
Input: ([], 3)
Expected Output: []
Explanation: Empty stream.
Hints
- Use a monotonic deque of candidate indices.