WorldQuant interview question

Coding challenge - Moving average