Altimetrik interview question

windows function in spark scala