Implement sliding-window moving average | Meta Interview Question