PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Aurora

Compute streaming sliding-window minimums

Last updated: Mar 29, 2026

Quick Overview

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.

  • medium
  • Aurora
  • Coding & Algorithms
  • Software Engineer

Compute streaming sliding-window minimums

Company: Aurora

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Problem You are given an integer array `nums` of length `n` and an integer window size `k`. You scan `nums` from left to right (streaming). At each index `i`, you must output the minimum value in the **most recent window** of up to `k` elements ending at `i`. Formally, define: - `L = max(0, i - k + 1)` - The active window is `nums[L..i]` - `ans[i] = min(nums[L..i])` Return the array `ans` of length `n`. ### Example If `nums` has 10 values and `k = 3`, you must still return **10** outputs (one per element), not `n-k+1`. ### Constraints - `1 <= n <= 2 * 10^5` - `1 <= k <= 10^5` - `nums[i]` fits in 32-bit signed integer ### Goal Design an algorithm that works in a streaming fashion (produce `ans[i]` as soon as you read `nums[i]`) and runs in `O(n)` time.

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.

Related Interview Questions

  • Implement a reference-counted smart pointer - Aurora (hard)
  • Find viewing direction that sees most points - Aurora (medium)
Aurora logo
Aurora
Feb 11, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
9
0

Problem

You are given an integer array nums of length n and an integer window size k.

You scan nums from left to right (streaming). At each index i, you must output the minimum value in the most recent window of up to k elements ending at i.

Formally, define:

  • L = max(0, i - k + 1)
  • The active window is nums[L..i]
  • ans[i] = min(nums[L..i])

Return the array ans of length n.

Example

If nums has 10 values and k = 3, you must still return 10 outputs (one per element), not n-k+1.

Constraints

  • 1 <= n <= 2 * 10^5
  • 1 <= k <= 10^5
  • nums[i] fits in 32-bit signed integer

Goal

Design an algorithm that works in a streaming fashion (produce ans[i] as soon as you read nums[i]) and runs in O(n) time.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Aurora•More Software Engineer•Aurora Software Engineer•Aurora Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.