6sense Interview Question

Asked about a Tree Question in coding round