Barclays Interview Question

What is a HashMap, and why do we override the equals and hashCode methods?