Cognizant Interview Question

Based on file handling and DS