Cognizant Interview Question

questions from strings and arrays , and sql question