XY Capital interview question

C++ , Database, logical thinking