Pregunta de entrevista de Maven

Probability and sequence questions. Easy to medium level.