Cognizant interview question

Design pattern