Morgan Stanley Interview Question

Why hashcode is used in HasMap?