Cognizant interview question

some ques in java unix c++