Trip.com Group interview question

In what case should we use Hashmap and why?