EY Interview Question

Related to Data structure and oops