Question
Which statement about Depth-First Search is the strongest interview answer?
- Depth-First Search is mostly a naming style choice and has little effect on runtime or design.
- Depth-first search follows one branch as far as possible before backtracking.
- Depth-First Search exists mainly to reduce the number of Java files in a project.
- Depth-First Search matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind Depth-First Search.
Answer and rationale
Correct answer: B. Depth-first search follows one branch as far as possible before backtracking.
Depth-first search follows one branch as far as possible before backtracking. This is the base concept interviewers commonly test first.
Track: Java