Zalando Interview Question

why do we need to override equals and hashCode