Salesforce interview question

Simple algorithms and finding diagnol elements in a binary tree