Pergunta de entrevista da empresa Cisco

About structure of a program in a memory. How the memory allocation is controlled for STACK and heap area? What will happen if 1 million variables are declared?