Software Engineering-I MCQs with Answers
Practice important Software Engineering-I MCQs with answers and explanations.
Chapter: 43
Q761:
In the C code delete buffer;, what does this line do?
A. Allocates memory
B. Deletes memory
C. Checks memory
D. None of the above
Correct Answer:
B
Chapter: 43
Q762:
A memory leak can occur if memory is allocated and ___ in case of errors.
A. deleted
B. not deallocated
C. reallocated
D. expanded
Correct Answer:
B
Chapter: 43
Q763:
The Foo class example demonstrates a memory leak due to
A. Incorrect function usage
B. Incorrect string deletion
C. Overwriting allocated memory
D. Buffer overflow
Correct Answer:
C
Chapter: 43
Q764:
In the code if((input >= 1 && input <= 10) && (input >= 15 && input <= 20)), why is this a logical error?
A. Conflicting conditions
B. Syntax error
C. Infinite loop
D. None of the above
Correct Answer:
A
Chapter: 43
Q765:
Which is NOT a symptom of a logical error?
A. Misbehavior in program flow
B. Program crashing randomly
C. Output looks odd but isn’t corrupt
D. Opposite expected results
Correct Answer:
B
Chapter: 43
Q766:
In the convertToString function, what mistake leads to incorrect string conversion?
A. Uninitialized variables
B. Incorrect cases
C. Redundant memory allocation
D. Missing return type
Correct Answer:
A
Chapter: 43
Q767:
In a memory overrun error, which action might cause a crash?
A. Setting an incorrect pointer
B. Allocating extra memory
C. Using memory outside allocated bounds
D. Reallocating memory
Correct Answer:
C
Chapter: 43
Q768:
Which loop error symptom involves the program repeatedly displaying the same data?
A. Off-by-one error
B. Infinite loop
C. Memory overflow
D. Improper exit
Correct Answer:
B
Chapter: 43
Q769:
In the example for (inti=0; i<100; ++i), what type of error is likely?
A. Memory overrun
B. Coding error
C. Pointer error
D. Logical error
Correct Answer:
A
Chapter: 43
Q770:
In the pointer error example, what issue arises from delete ptr; delete s;?
A. Memory leak
B. Double deletion
C. Misused pointer
D. Missing pointer initialization
Correct Answer:
B
Chapter: 43
Q771:
When an infinite loop occurs, what is likely true?
A. All loops exit correctly
B. Loop exit condition is unreachable
C. A logical error has occurred
D. A coding error has occurred
Correct Answer:
B
Chapter: 43
Q772:
Which is a symptom of a pointer error?
A. Stack overflow
B. Memory not deallocated
C. Changing values unexpectedly
D. Normal operation
Correct Answer:
C
Chapter: 44
Q773:
What does a holistic approach focus on?
A. Individual pieces
B. Entire system
C. Debugging symptoms
D. Code efficiency
Correct Answer:
B
Chapter: 44
Q774:
Holistic medicine focuses on which aspect of health?
A. Specific disease
B. Body as a whole
C. Only symptoms
D. Physical health only
Correct Answer:
B
Chapter: 44
Q775:
In C++, the following function SetX(int X) { mX = X; } crashes when ________.
A. mX is used before initialization
B. X is passed by reference
C. it is called within a loop
D. the function is run on large input
Correct Answer:
A
Chapter: 44
Q776:
In debugging, why might adding a message statement cause an issue to stop occurring?
A. It fixes the bug
B. It delays code execution
C. It changes code order
D. It adds logging
Correct Answer:
C
Chapter: 44
Q777:
When debugging, a user description of the problem should be treated with ________.
A. Complete trust
B. Suspicion
C. Immediate action
D. Disregard
Correct Answer:
B
Chapter: 44
Q778:
What is a commonality in bug reports involving menu selection and crashing?
A. Only mouse usage
B. Only keyboard usage
C. Using both keyboard and mouse
D. Program ends immediately
Correct Answer:
C
Chapter: 44
Q779:
In which debugging step would you examine stack traces?
A. Code review
B. Program compiling
C. Stack tracing
D. Bug reporting
Correct Answer:
C
Chapter: 44
Q780:
A stack trace provides critical debugging information by displaying ________.
A. Variable sizes
B. Argument values
C. Error logs
D. Function calls with line numbers
Correct Answer:
D