Capgemini interview question

based on react and dsa