Explain C++ virtual dispatch and object lifetime
Company: J.P. Morgan
Role: Data Scientist
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
Quick Answer: This question evaluates a candidate's understanding of C++ virtual function dispatch, destructor and object lifetime semantics, stack versus heap allocation, dangling-pointer and double-delete pitfalls, and pointer versus reference distinctions within the Software Engineering Fundamentals domain and the C++ language.