Cognizant Interview Question

Basic programming and probability questions