Question
Which statement about Sliding Window on Arrays is the strongest interview answer?
- A sliding window maintains a contiguous region and updates the answer incrementally as the window moves.
- Sliding Window on Arrays is mostly a naming style choice and has little effect on runtime or design.
- Sliding Window on Arrays exists mainly to reduce the number of Java files in a project.
- Sliding Window on Arrays matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind Sliding Window on Arrays.
Answer and rationale
Correct answer: A. A sliding window maintains a contiguous region and updates the answer incrementally as the window moves.
A sliding window maintains a contiguous region and updates the answer incrementally as the window moves. This is the base concept interviewers commonly test first.
Track: Java