Skip to main content

Software Engineering-I MCQs with Answers

Practice important Software Engineering-I MCQs with answers and explanations.

Chapter: 34
Q601:
When profiling functions, what is typically the first step?
A. Rewriting functions
B. Identifying bottlenecks
C. Eliminating loops
D. Changing algorithms
Correct Answer: B
Chapter: 34
Q602:
When is the best time to optimize performance according to the 80/20 rule?
A. When 80% of the code runs slowly
B. When 20% of the code uses most resources
C. When all code is optimized
D. After writing the complete code
Correct Answer: B
Chapter: 34
Q603:
If the size of 'int' is 2 bytes, what will happen when trying to store the value 20000?
A. It will work without issues
B. It will cause an overflow
C. It will be truncated to 10000
D. It will not compile
Correct Answer: B
Chapter: 34
Q604:
What is the primary purpose of using bit fields in structures?
A. To define data types
B. To pack data efficiently
C. To create unions
D. To define function prototypes
Correct Answer: B
Chapter: 34
Q605:
What is the consequence of using non-standard bit field sizes?
A. Improved performance
B. Enhanced portability
C. Undefined behavior between compilers
D. No impact on memory usage
Correct Answer: C
Chapter: 35
Q606:
What is the main purpose of exception handling in programming?
A. To handle all types of errors
B. To separate error-handling code from normal code
C. To improve code performance
D. To prevent program crashes
Correct Answer: B
Chapter: 35
Q607:
Exception handling provides a consistent mechanism for ______.
A. error reporting
B. user interaction
C. code optimization
D. data validation
Correct Answer: A
Chapter: 35
Q608:
What does raising an error flag signify in exception handling?
A. An error has occurred
B. Normal operation
C. Code is executed
D. Error handling is complete
Correct Answer: A
Chapter: 35
Q609:
In the context of exception handling, what does "throwing an error" mean?
A. Ignoring an error
B. Signaling an error has occurred
C. Completing code execution
D. Returning a value
Correct Answer: B
Chapter: 35
Q610:
Fill in the blank: Surrounding error-sensitive code with exception handling is called ______.
A. trying to execute a block
B. error handling
C. debugging
D. running code
Correct Answer: A
Chapter: 35
Q611:
What happens when an error is thrown in a program?
A. The program stops execution
B. The program continues without issue
C. The system catches the error
D. None of the above
Correct Answer: C
Chapter: 35
Q612:
How many non-exceptional paths are mentioned in the provided content?
A. 5
B. 3
C. 10
D. 15
Correct Answer: B
Chapter: 35
Q613:
What is one of the key benefits of exception handling mentioned in the content?
A. Increased complexity of code
B. Reduced code readability
C. Ability to handle different execution paths
D. Faster execution
Correct Answer: C
Chapter: 35
Q614:
Fill in the blank: A function is ______ safe if it does not have any side effects when it throws an exception.
A. exception neutral
B. exception safe
C. exception prone
D. exception aware
Correct Answer: B
Chapter: 35
Q615:
In exception handling, what is the challenge when dealing with multiple side-effects?
A. Combining effects into one
B. Avoiding exceptions
C. Splitting the function into atomic steps
D. Reducing execution time
Correct Answer: C
Chapter: 35
Q616:
Fill in the blank: The main advantage of using exception handling is its ability to ______.
A. improve performance
B. simplify code
C. manage errors
D. optimize memory
Correct Answer: C
Chapter: 35
Q617:
What mechanism is used in the code segment to handle exceptions?
A. if-else statement
B. try-catch block
C. switch statement
D. error flag
Correct Answer: B
Chapter: 35
Q618:
What is one way to achieve strong exception safety in a function?
A. Ensure it has multiple unrelated side-effects
B. Complete all side-effects or roll back
C. Ignore exceptions
D. Use only local variables
Correct Answer: B
Chapter: 35
Q619:
Fill in the blank: Exception handling separates _______ from normal code.
A. debugging code
B. error handling
C. performance metrics
D. user input
Correct Answer: B
Chapter: 36
Q620:
What is the primary purpose of software verification?
A. To meet user expectations
B. To ensure system specifications are met
C. To discover defects
D. To validate software functionality
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Software Engineering-I

🚀 Start Quiz Now