Infosys Interview Question

Stack heap array list oops