Toptal interview question

Manipulate a JSON with nested objects