Skip to content

Call Stack

The call stack is a data structure that tracks the execution of function calls. It operates as Last In, First Out (LIFO) — the most recently called function is the first to complete.

  • Understand how the call stack tracks function execution
  • Identify stack frames and their components
  • Recognize and avoid stack overflow
  • Trace execution through the call stack
flowchart TD
subgraph "Call Stack"
A["📝 inner()"]
B["📝 outer()"]
C["📝 main()"]
D["⚙️ Global Context"]
end
TopicDescriptionEst. Time
Stack FramesHow function calls are tracked15 min
Stack OverflowMaximum call stack size and recursion limits10 min
Async StackHow async operations interact with the stack10 min
  • Execution context
  • Functions and function calls
  • Recursion basics
Stack Frames → Stack Overflow → Async Stack