Tech Mahindra interview question

Focusing on Collections and Threading