Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2854. Rolling Average Steps
Compute the moving average of step counts over a fixed-size sliding window for an array or stream of measurements, producing the average for each contiguous window efficiently. The core challenge is to update the average incrementally (O(1) per new value) to handle large or streaming inputs and edge cases like partial windows.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late August, 2024
Meta
Senior
Given an array of integers and a window size, write a function that returns the average value for each rolling window.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.