Area of Improvements

Review your assessments and practice — drill into each subject, then each attempt, then each question.

Back to summary
C Programming · Round 1

Question 7 of 10

Topic: Data typesDifficulty: HardBloom: Analyze
Question

Walk me through how function calls and the call stack work in C, under the hood.

Result
Knowledge
70%
Delivery
68%
Technical relevancy
72%
Technical term match
65%
Your recording
Your transcript

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.

Better answer

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.

Coverage
Hit 3 of 5
  • 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
Gaps
  • Did not mention calling convention / ABI register passing
Misconceptions
  • Said all arguments are always pushed on the stack