Optiver interview question

One question was a graph problem