Pregunta de entrevista de Cognizant

Basic questions from programming and probability.