Flag Hot Disks From Per-Second IOPS Samples
Last updated: November 29, 2026
Quick Overview
Each disk in a node reports a list of per-second IOPS samples. Given a window size k and a threshold, return every disk whose average IOPS over some k consecutive samples exceeds the threshold, along with the start index of the first such window.
Nutanix
November 29, 20260
0
0 solved
Each disk in a node reports a list of per-second IOPS samples. Given a window size k and a threshold, return every disk whose average IOPS over some k consecutive samples exceeds the threshold, along with the start index of the first such window.
The storage fabric tracks per-disk load so tiering and rebalancing can move data off saturated SSDs and HDDs, and alerts fire when a disk is persistently hot. As an online assessment item it checks the sliding window pattern and care with integer arithmetic over long sample streams.
What the Interviewer Expects
- Uses a running window sum instead of recomputing each window
- Compares sums against threshold times k to avoid floating point
- Stops scanning a disk at its first hot window
- Skips disks with fewer than k samples
- States O(total samples) complexity
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you require the disk to stay hot for m windows in a row before alerting?
- Samples arrive as a live stream. What state do you keep per disk?
- How would you compare a disk against the median of its peers instead of a fixed threshold?
- What changes if some seconds are missing from the stream?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: samples mapping disk id to a list of non-negative integers, window size k, numeric threshold. A disk is hot if any contiguous window of length k has average strictly above the threshold. ...
High-Level Design
Average above threshold is the same as window sum above threshold * k, which avoids division and float drift. For each disk, compute the first window sum, then slide: add the entering sample and sub...