Tech Mahindra interview question

Implementation of report