Verisk Interview Question

sliding window question and a Joins Query.