Pregunta de entrevista de Amazon

Slide window concept based question