Pregunta de entrevista de Cognizant

Logic question. One puzzle also