Bloomberg Interview Question

leetcode question of binary tree and system design.