Microsoft Interview Question

Question one was a sliding window