Two Sigma Interview Question

A graph problem