Uses hash codes to prevent duplicates. Frame the concept in practical terms so you can explain it during interview discussion.
HashSet relies on the hashCode() and equals() methods to ensure that no two identical objects are stored. When you add a product ID to a HashSet, it computes the hash code and checks if an equivalent object already exists. If it does, the new item is not added. This makes HashSet ideal for storing unique product IDs.