Bloomberg interview question

I had a binary tree and matrix question