Two Sigma interview question

A graph problem