Pergunta de entrevista da empresa Arista Networks

Asked two problems (1 graph and 1 bst). Had to solve both in one hour.