Pergunta de entrevista da empresa Uber

Graph question concerning nodes and edges