Microsoft interview question

Question one was a sliding window