JSW Group interview question

it was leetcode average but they asked to implement in multithreading environment