Microsoft Interview Question

Pretty standard graph question testing recursion