Question
Which statement about List, Set, and Map is the strongest interview answer?
- List preserves order, Set enforces uniqueness, and Map stores values by key.
- List, Set, and Map is mostly a naming style choice and has little effect on runtime or design.
- List, Set, and Map exists mainly to reduce the number of Java files in a project.
- List, Set, and Map matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind List, Set, and Map.
Answer and rationale
Correct answer: A. List preserves order, Set enforces uniqueness, and Map stores values by key.
List preserves order, Set enforces uniqueness, and Map stores values by key. This is the base concept interviewers commonly test first.
Track: Java