BABEL interview question

A sliding window calculation challenge