Question 54 of 988
hardMultiple ChoiceObjective-mapped
FC0-U71 Modularity Practice Question
During a code review, a team notices that a function modifies a global variable instead of returning a value. Which software development principle is being violated?
⚠ Common exam trap
CompTIA often tests the distinction between encapsulation and modularity, where candidates mistakenly choose encapsulation because they associate 'hiding data' with 'not modifying globals,' but encapsulation specifically relates to object-oriented access control, not the functional principle of avoiding side effects.
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
✓
Modularity
Modularity is the principle that a function should perform a single, well-defined task and communicate with the rest of the program through its inputs and outputs, not by altering shared state. By modifying a global variable instead of returning a value, the function creates hidden dependencies and side effects, which breaks the modular design that keeps components independent and testable.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Encapsulation
Why it's wrong here
Encapsulation hides internal state, but here the function is changing global state, which is not encapsulation violation per se.
- ✗
Polymorphism
Why it's wrong here
Polymorphism allows methods to have different implementations; not directly related.
- ✓
Modularity
Why this is correct
Modularity emphasizes that functions should be independent and avoid global side effects.
- ✗
Inheritance
Why it's wrong here
Inheritance is about classes deriving from others; not relevant.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jul 4, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.