Pergunta de entrevista da empresa Vendavo

Given a thread problem asked to solve it, Binary tree depth