Pregunta de entrevista de Uber

Distance between siblings in trees, basic SQL queries.