Qualcomm interview question

resource allocation for C++ class