Amazon Interview Question

iterating a nested json, with recursive approach