Cognizant interview question

Prime number generation