MSCI interview question

Add concurrency mamagement to the existing code