How HashSet works in Java?
How HashSet eliminates duplicates in Java?
This is very popular interview question for both beginners and experienced. HashSet internally uses HashMap for storing the data and retrieving it back.
So if you know how HashMap works then it is very easy to understand how HashSet works.