Pergunta de entrevista da empresa Bloomberg

Say how you would construct a VM. Basically, how would you go about writing a program that runs another program that can call malloc() and free(). Start with a block of memory, and handle the program's memory for it.