Question
Which statement about Sliding Window is the strongest interview answer?
- Sliding Window is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
- Sliding Window exists mainly to reduce the number of files in a Python project.
- Sliding Window matters only for frontend scripting and not for backend or automation code.
- A sliding window keeps a contiguous region and updates the answer incrementally as the endpoints move.
Hint
Start with the core rule behind Sliding Window.
Answer and rationale
Correct answer: D. A sliding window keeps a contiguous region and updates the answer incrementally as the endpoints move.
A sliding window keeps a contiguous region and updates the answer incrementally as the endpoints move. This is the base concept interviewers commonly test first.
Track: Python