JPMorganChase Interview Question

Nested for loops and sliding window, plus how did you handle difficult situation.