Microsoft Interview Question

How memory is allocated in the stack and heap