Amazon Interview Question

dp tree graph traversal and so