Cognizant interview question

Departmental as well a java program on variance