CaaStle interview question

The Questions were from sliding window topic