Cognizant Interview Question

Basic questions from programming and probability.