Each window problem came down to two decisions: what enters and leaves at the edges, and when the window is allowed to move its left edge. Here’s how each exercise framed it:
| Exercise | The question that unlocked it |
|---|---|
| Busiest Seven-Day Stretch | What changes when the week slides forward by one day? |
| Longest Run of Distinct Songs | Where did this song last play, and is that still inside the window? |
| Fewest Orders to Reach a Target | Can I drop the oldest order and still reach the target? |
A quick self-check: think of the test that stayed red the longest for you. Which assumption in your code did it break? Interviewers often ask exactly that kind of question, and it’s a lot easier to answer once you’ve talked it through.
Want a second pair of eyes on your Sliding Windows work?
From here on, the label comes off. Mixed Practice hands you problems and leaves the choice of pattern to you, just like an interviewer would.