Pergunta de entrevista da empresa Apple

In C++, when the object generation is dynamic and one doesn't know which class it is going to derive from, how does compiler handle this situation?