Eightfold Interview Question

two graph based traversal questions