Amazon interview question

Focus on Graphs and Arrays.