NIO interview question

Algorithm design, Graphs