Debugging & Error Analysis MCQs

Topic-wise practice questions for Problem Solving & Analytical Skills. Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q1easy
What does the term "Dry Running" code mean?
Q2medium
(Calculation/Logic) In terms of software engineering costs, a bug found during the **Testing Phase** is generally how much more expensive to fix than a bug found during the **Requirement Analysis Phase**?
Q3easy
What is "Unit Testing" and how does it relate to debugging?
Q4hard
(Code Output / Logic) What will be the output of this attempt to swap two numbers?

function swap(a, b):
    a = b
    b = a
x = 5, y = 10
swap(x, y)
print(x, y)
Q5medium
A user reports that the app crashes only when they upload a file larger than 10MB. The developer tries with a 1MB file and says, "It works on my machine." What is the first step the developer should take for effective debugging?
Q6medium
(Code Error / Debugging) A developer writes the following loop to find the average of an array arr of size N:

sum = 0
for i from 1 to N:
    sum = sum + arr[i]
avg = sum / N
Assuming 0-based indexing, what common error is present here?
Q7easy
"Defensive Programming" is a technique aimed at:
Q8medium
(Code Error / Debugging) Identify the bug in this search algorithm:

for i from 0 to arr.length - 1:
    if arr[i] == target:
        return i
return -1
Q9medium
(Code Error / Logic) What is the logical flaw in this "Defensive Programming" snippet?

if (index < 0 AND index > arr.length):
    print("Invalid Index")
Q10medium
A developer uses a "Watchpoint" while debugging. What is the specific purpose of this tool?