AKUNA CAPITAL interview question

Graph traversal question, discussion about data structures