FC0-U71 Software Development Concepts Practice Question
A programmer writes a recursive function to compute the factorial of a number. When the function is called with a large positive integer, the program terminates unexpectedly with an error indicating that the maximum call depth was exceeded. The base case is correct and the recursion does eventually reach it for small inputs. Which statement best explains the failure?
⚠ Common exam trap
The trap here is blaming an incorrect or missing base case, when the scenario states the base case is correct and the real limit is the finite size of the call stack.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Each recursive call consumes stack space, so a deep recursion exhausts the call stack before reaching the base case.
Recursion uses the call stack, and every call adds a frame that is not removed until the call returns. A large input creates a deep chain of calls, and the stack has a finite size. When the chain exceeds that size, the runtime raises a stack overflow or maximum call depth error. The correct base case ensures the recursion would finish, but not before the stack is exhausted.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The integer data type overflows when computing large factorials, which halts the program.
Why it's wrong here
Integer overflow can produce incorrect results for large factorials, but it does not cause a maximum call depth error. The error explicitly concerns call depth, which is a stack resource issue. Overflow would manifest as a wrong numeric value or a different exception, so it does not explain the reported failure.
- ✓
Each recursive call consumes stack space, so a deep recursion exhausts the call stack before reaching the base case.
Why this is correct
Each recursive call pushes a new frame onto the call stack, holding parameters and local state. With a large input, the number of nested calls grows until the stack space is exhausted, producing a stack overflow. The base case is correct but is only reached after many calls, so the failure is caused by depth rather than by a missing termination condition.
- ✗
The base case returns the wrong value, causing the recursion to continue indefinitely.
Why it's wrong here
The scenario states the base case is correct and that recursion does terminate for small inputs. If the base case returned a wrong value, the result would be incorrect but the calls would still stop. The observed error is about exceeding maximum call depth, which points to stack exhaustion rather than an incorrect base-case return value.
- ✗
The function lacks a return statement, so the compiler cannot optimize the recursion.
Why it's wrong here
A missing return statement would typically cause a compile error or undefined results, not a maximum call depth error. The scenario describes a function that works correctly for small inputs, which implies the returns are present. The failure appears only with large inputs, indicating a resource limit rather than a missing return.
Go deeper
Related to this question
About these practice questions
Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.