Cognizant interview question

oops concept