LinkedIn interview question

Recursively mutate a data structure