Quantcast Interview Question

Write DFS