Cognizant interview question

Java design pattern