Capgemini interview question

Thread mechanism