Thoughtworks interview question

questions are given in description