VibraXX
Live Quiz Arena
🎁 1 Free Round Daily
⚡ Enter Arena
HomeCategoriesLogic & PuzzlesQuestion
Question
Logic & Puzzles

What happens to the available call stack memory when a recursive function lacks a proper base case in a system controlling an autonomous drone?

A)Stack is immediately garbage collected
B)Stack overflow error will occur
C)Function executes in tail-recursive optimization
D)Drone controller enters sleep mode

💡 Explanation

A lack of a proper base case in recursion causes infinite calls because the recursive calls never stop, leading to the function continuously pushing new stack frames without popping them. Therefore, a stack overflow error occurs, rather than other scenarios, because the memory allocated for the call stack is exhausted.

🏆 Up to £1,000 monthly prize pool

Ready for the live challenge? Join the next global round now.
*Terms apply. Skill-based competition.

⚡ Enter Arena

Related Questions

Browse Logic & Puzzles