Apply sliding window techniques | NVIDIA Interview Question