Cognizant interview question

Based on file handling and DS