Infosys Interview Question

Normal array question and me mongodb