TCS interview question

Data structure and c++