Cognizant interview question

How to override hashcode and equals method