Dolat Capital interview question

Based mostly on Cpp oops concepts and dsa.