Area of Improvements
Review your assessments and practice — drill into each subject, then each attempt, then each question.
Question 7 of 10
Walk me through how function calls and the call stack work in C, under the hood.
When you call a function, the arguments and return address get pushed on the stack. The function uses local variables there too. When it returns, the stack pointer goes back. That's why recursion can blow the stack.
On call, the caller (or callee, per ABI) sets up an activation record / stack frame containing return address, saved frame pointer, arguments not in registers, and locals. The CPU jumps to the function; on return, the frame is popped and execution resumes after the call site. Deep or unbounded recursion overflows the stack because each frame consumes contiguous stack memory.
- Mentions stack frame / activation record
- Names return address being saved
- Notes arguments may pass in registers per ABI
- Explains stack overflow from deep recursion
- Mentions caller vs callee saved registers
- Did not mention calling convention / ABI register passing
- Said all arguments are always pushed on the stack

