Cisco interview question

How are the function calls implemented ? Where does the memory being allocated for the function calls ?