Capgemini Engineering interview question

What is the reason for overriding equals() and hashCode() methods?