Software Engineering-I MCQs with Answers
Practice important Software Engineering-I MCQs with answers and explanations.
Chapter: 27
Q481:
Which statement is TRUE about the Singleton Pattern?
A. It allows multiple instances of a class
B. It ensures a class has only one instance
C. It is not accessible from a global point of access
D. It cannot be subclassed
Correct Answer:
B
Chapter: 27
Q482:
The Singleton class is instantiated using which method in the provided example?
A. Instance()
B. GetSingletonData()
C. UniqueInstance()
D. Create()
Correct Answer:
A
Chapter: 27
Q483:
The Façade Pattern provides what type of interface?
A. Complex interface to a subsystem
B. Unified interface to a set of interfaces
C. Multiple independent interfaces
D. No interface at all
Correct Answer:
B
Chapter: 27
Q484:
When should the Façade Pattern be applied?
A. When a class has multiple instances
B. When you want to provide a simple interface to a complex subsystem
C. When there are no dependencies between classes
D. When all classes are known
Correct Answer:
B
Chapter: 27
Q485:
In the Observer Pattern, what happens when the state of the Subject changes?
A. The Observer is detached
B. The Observer is notified and updated
C. The Observer state remains the same
D. The Subject becomes inactive
Correct Answer:
B
Chapter: 27
Q486:
What is the key benefit of separating presentational aspects from underlying application data?
A. It reduces redundancy
B. Improves maintainability
C. Increases complexity
D. Decreases performance
Correct Answer:
B
Chapter: 27
Q487:
Which of the following is NOT a participant in the Observer Pattern?
A. ConcreteObserver
B. ConcreteSubject
C. Facade
D. Observer
Correct Answer:
C
Chapter: 27
Q488:
The Singleton Pattern is best used when:
A. More than one instance is needed
B. Exactly one instance is required
C. Instances can be created freely
D. No instances are needed
Correct Answer:
B
Chapter: 27
Q489:
What is the primary responsibility of the Façade object?
A. To create subsystem classes
B. To simplify client interaction with subsystems
C. To manage dependencies between subsystems
D. To increase subsystem complexity
Correct Answer:
B
Chapter: 27
Q490:
How does the Observer Pattern affect GUI updates?
A. It requires manual refresh
B. It prevents updates
C. It allows for automatic updates when the model changes
D. It has no effect on updates
Correct Answer:
C
Chapter: 27
Q491:
What is a common motivation for using the Observer Pattern?
A. To minimize dependencies
B. To allow for flexibility in implementation
C. To maintain consistency between related objects
D. To increase execution time
Correct Answer:
C
Chapter: 27
Q492:
Which class maintains a reference to a ConcreteSubject in the Observer Pattern?
A. Observer
B. ConcreteObserver
C. ConcreteSubject
D. Singleton
Correct Answer:
B
Chapter: 27
Q493:
The Façade Pattern is typically used to decouple which elements?
A. Clients and servers
B. Clients and subsystems
C. Subsystems and interfaces
D. Classes and methods
Correct Answer:
B
Chapter: 28
Q494:
What is considered the most desirable quality of a software artifact?
A. Maintainability
B. Performance
C. Security
D. Usability
Correct Answer:
A
Chapter: 28
Q495:
According to Fowler, good programmers write code that is ______.
A. Readable
B. Complex
C. Short
D. Obsolete
Correct Answer:
A
Chapter: 28
Q496:
Which of the following is NOT one of the three basic principles that guide maintainability?
A. Clarity
B. Complexity
C. Generality
D. Simplicity
Correct Answer:
B
Chapter: 28
Q497:
Self-documenting code requires _______.
A. Comments and documentation
B. Readable variable names
C. Complex expressions
D. Redundant explanations
Correct Answer:
B
Chapter: 28
Q498:
What size should a function ideally not exceed for better maintainability?
A. 10 lines
B. 20 lines
C. 50 lines
D. 100 lines
Correct Answer:
B
Chapter: 28
Q499:
The choice of ______ names plays a significant role in enhancing the readability of a program.
A. Variable
B. Function
C. Class
D. Module
Correct Answer:
A
Chapter: 28
Q500:
In self-documenting code, the meaning should be clear without referring to ______.
A. Comments
B. Other functions
C. External documentation
D. Modules
Correct Answer:
C