Thoughtworks interview question

You have to complete the assignment given.