1 Tree question is usually related with Recursion.
2 Recursion: status in current level, status before return to upper level, status after return from lower level. (i.e. LCA problem (LC 236), Return – TreeNode – Whether one of the two nodes is found in current subTree, Before Recurse down – check root, After Return Back – check what is returned from subtrees)
3 Recursion: Before Recurse Down – check whether current root.val maintains a consecutive sequence, Recurse Down – pass current length and root value to next level, Return max length of current and next level (i.e. Binary Tree Longest Consecutive Sequence (LC 298))
4 Access two children(left and right) simultaneously instead of using extra space to store the serialized tree elements value (i.e. Symmetric Tree (LC 101) )
5 Dynamic Programming tips: find a base case, cache as much as possible for further usage (LC longest palindrome substring)
6 iOS Tips: UIWindow holds different UIView and never be replaced. UIViewController manages UIView and subviews. CALayer is responsible for specific visual content, like animation or sophisticated visual effects.