Thoughtworks Interview Question

You have to complete the assignment given.