Casa (India) interview question

long coding involving threads and scheduling