Cognizant interview question

Java API