Streaming variance without the sum of squares
The textbook variance formula is a numerical trap: it forms , which can overflow a fixed-width integer and, in floating point, subtracts two large nearly-equal numbers, cancelling away your precision.
Compute the running mean and (sample) variance of a stream in a single pass, without ever forming . Handle the case where values are large but their spread is small.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.