FastPrepRunning Stream Aggregates
Problems/Running Stream Aggregates

Running Stream Aggregates

Bloomberg LP logoBloomberg LP● MediumFULLTIMEONSITE INTERVIEW
QuestionFunctionExamplesConstraints

Problem statement

Source note: The reported task identifies this algorithmic exercise. The executable interface, bounds, deterministic tie rules, and examples are the documented practice contract.

Process integer events in arrival order. After each event, emit one row [count, sum, minimum, maximum] describing the prefix observed so far.

Return all emitted rows in arrival order.

Function

runningAggregates(values: int[]) → int[][]

Examples

Example 1

values = [5]return = [[1,5,5,5]]

Case 1 exercises the documented deterministic contract.

Example 2

values = [1,2,3]return = [[1,1,1,1],[2,3,1,2],[3,6,1,3]]

Case 2 exercises the documented deterministic contract.

Example 3

values = [-2,4,-1]return = [[1,-2,-2,-2],[2,2,-2,4],[3,1,-2,4]]

Case 3 exercises the documented deterministic contract.

Constraints

  • 1 <= values.length <= 200000.
  • -10^6 <= values[i] <= 10^6.
  • Every running sum fits a signed 32-bit integer.

More Bloomberg LP problems

  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE SCREEN · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public int[][] runningAggregates(int[] values) {
        // Write your code here.
    }

}
Checking account…