Eightfold interview question

two graph based traversal questions