Google Interview Question

lc but with modifications, some sliding window thing and some sys design