Sollicitatievraag bij Millennium

I was asked probability and coding question