Skip to main content

Software Engineering-I MCQs with Answers

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

Chapter: 33
Q581:
What should you do if you are initializing a variable at declaration?
A. Declare another variable in the same statement
B. Use a different statement
C. Use multiple assignments
D. None of the above
Correct Answer: B
Chapter: 33
Q582:
The 80/20 rule in performance optimization suggests that:
A. 80% of the code causes 20% of the problems
B. You spend 80% of time on 20% of the code
C. You should optimize everything
D. Profiling is unnecessary
Correct Answer: B
Chapter: 33
Q583:
What was found to be the bottleneck in the profiling results?
A. strchr and strncmp
B. strstr and isspam
C. memcmp and strlen
D. None of the above
Correct Answer: A
Chapter: 33
Q584:
When should you rewrite a set of functions?
A. When they are functioning properly
B. When they are overwhelmingly the bottleneck
C. Whenever you feel like it
D. Only if they are outdated
Correct Answer: B
Chapter: 33
Q585:
What was the result of rewriting strstr with memcmp?
A. much slower but simpler
B. much faster but more complex
C. much slower and more complex
D. much faster and simpler
Correct Answer: B
Chapter: 33
Q586:
In the example given, how much time was spent in clearing fields?
A. Almost 20%
B. Almost 50%
C. Almost 75%
D. Almost 100%
Correct Answer: B
Chapter: 33
Q587:
If MAX_FIELD was set to 200 but only 2 or 3 fields needed clearing, what was modified?
A. The loop condition was changed
B. The clear function was altered
C. MAX_FIELD was increased
D. The clearing method was eliminated
Correct Answer: A
Chapter: 33
Q588:
Performance and maintainability are often:
A. Aligned
B. At odds with one another
C. Unrelated
D. Equally important
Correct Answer: B
Chapter: 33
Q589:
Functions with side effects change:
A. The values of local variables
B. Only return values
C. Only global variables
D. The values of the parameters
Correct Answer: D
Chapter: 34
Q590:
What is the main challenge when porting applications to different platforms?
A. Finding a new programming language
B. High cost of major rework
C. Availability of resources
D. Compatibility of data types
Correct Answer: B
Chapter: 34
Q591:
Which standard should be followed for writing portable C++ code?
A. ISO/IEC 9001
B. ANSI/ISO standard C++
C. ISO/IEC 27001
D. ANSI/ISO standard Python
Correct Answer: B
Chapter: 34
Q592:
Why is it important to use function prototypes in C++?
A. They are optional
B. They improve performance
C. They enhance portability
D. They allow for function overloading
Correct Answer: C
Chapter: 34
Q593:
What causes major portability issues in programming?
A. Programming style
B. Standard libraries
C. Size of data types
D. Variable naming conventions
Correct Answer: C
Chapter: 34
Q594:
Which of the following statements is true regarding the signedness of 'char'?
A. It is always signed.
B. It is always unsigned.
C. It is implementation-defined.
D. It cannot be used in arithmetic operations.
Correct Answer: C
Chapter: 34
Q595:
What does the right shift operator '>>' do in C/C++?
A. Always performs logical shift
B. Always performs arithmetic shift
C. Behavior is implementation-defined
D. Does not shift bits
Correct Answer: C
Chapter: 34
Q596:
What should be avoided to ensure data exchange between heterogeneous machines?
A. Using text format
B. Using binary format
C. Using common data types
D. Using portable libraries
Correct Answer: B
Chapter: 34
Q597:
What does the following struct define? struct packed_struct { unsigned int f1:1; unsigned int f2:1; unsigned int f3:1; unsigned int f4:1; unsigned int type:4; unsigned int funny_int:9; } pack;
A. Packed bits into an integer
B. Packed bits into a character
C. Defined a standard data type
D. Defined a union
Correct Answer: A
Chapter: 34
Q598:
Which of the following is a common mistake related to side effects in C/C++?
A. array[i++] = i;
B. array[i] = i;
C. array[i] += i;
D. array[i] = i + 1;
Correct Answer: A
Chapter: 34
Q599:
What is a recommended guideline to avoid side effects?
A. Use multiple assignments in the same statement
B. Use commas in declarations
C. Always initialize variables at declaration
D. Only declare one variable at a time in a statement
Correct Answer: D
Chapter: 34
Q600:
What can cause performance bottlenecks in a program?
A. Optimizing all functions
B. Profiling code to find hotspots
C. Using standardized algorithms
D. Improving variable naming conventions
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Software Engineering-I

🚀 Start Quiz Now