Bloomberg interview question

Memory management in C++ and Java.