Use remove() to delete a key-value pair. Frame the concept in practical terms so you can explain it during interview discussion.
The remove() method is used to delete a key-value pair from a HashMap. If the key exists, it removes the entry and returns the value. This is useful when a product is no longer available in an e-commerce catalog.