C++ Job interview question: Inheritance and object orientation source code example to create class object on heap vs stack

C++, Job, interview question, Inheritance,object orientation, source code, example,create class object on heap vs stack