Tech Mahindra Interview Question

Data structure, java