Pergunta de entrevista da empresa Block

Really interesting graph traversal question and a recursion/data structures question where I had to code up all inputs and data structures from scratch.