Cognizant interview question

Few logical questions.