Microsoft Interview Question

Graph, and two array problems