Two Sigma interview question

Graph Transitive Closure