Cognizant interview question

Data Structure