🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Recursion & Backtracking Quiz: all 7 questions

Recursion & Backtracking Quiz · Question 1 of 7

What happens if a recursive function has no base case?

What happens if a recursive function has no base case?

  1. A.It returns 0
  2. B.It recurses forever until a stack overflow
  3. C.It runs once
  4. D.The compiler adds one automatically
Answer & explanation

Correct answer: It recurses forever until a stack overflow

Without a stopping condition, calls keep stacking up until memory for the call stack runs out.

Can you get the rest right without peeking?

Take the timed Recursion & Backtracking Quiz quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →