Pinterest Interview Question

Two coding questions: minimum element & graph traversal