FastPrepFixed-Window Rolling Mean
Problems/Fixed-Window Rolling Mean

Fixed-Window Rolling Mean

Jump Trading logoJump Trading● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Jump Trading onsite interview. The report names a fixed-window rolling mean. It does not give the batch interface, what to do before the window fills, or how the numbers are written in the output. Our version is about 90% the same as the reported question.

Given an integer array nums and a positive windowSize, return the arithmetic mean of every complete contiguous window of that size, from left to right.

Update the running window in constant time as it advances.

Function

fixedWindowRollingMean(nums: int[], windowSize: int) → double[]

Examples

Example 1

nums = [1, 2, 3, 4, 5, 6, 7, 8, 9]windowSize = 7return = [4.0, 5.0, 6.0]

The three complete windows have sums 28, 35, and 42; dividing each by 7 gives the returned means.

Constraints

  • nums.length >= 1
  • 1 <= windowSize <= nums.length
  • The result contains exactly nums.length - windowSize + 1 averages, one for each contiguous window.

More Jump Trading interview questions

  • Parquet-Like Columnar Format OperationsPHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • Bad Request AlertsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Sliding Window Average (Meta Canada, E4/E5 :)Meta · PHONE SCREEN · ONSITE INTERVIEWMeta interview questions
  • Maximum Earnings Across WarehousesAmazon · ONSITE INTERVIEW
  • Shortest Subarray with Sum at Least KOracle · ONSITE INTERVIEWOracle interview questions
  • Longest Subarray Within an Absolute-Difference LimitGoogle · ONSITE INTERVIEWGoogle interview questions
  • Longest Continuous Subarray Within an Absolute-Difference LimitUber · ONSITE INTERVIEWUber interview questions
  • Sliding-Window Rate LimiterSnowflake · ONSITE INTERVIEWSnowflake interview questions
  • Sliding Window MaximumPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
  • Sliding Window MaximumBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Moving Average of a Data StreamSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
All Jump Trading interview questionsSee Jump Trading hiring insights
Saved
class Solution {
    public double[] fixedWindowRollingMean(int[] nums, int windowSize) {
      // write your code here
    }
}
Checking account…