Question d’entretien chez J.P. Morgan

Two questions in each probability, puzzles and coding.