The Commons XR interview question

They asked me to write code to invert a binary tree