Qualcomm Interview Question

Depth first search. Stack and heap, etc.