Domanda di colloquio di Millennium

I was asked probability and coding question