B.S.W.E. Bachelor of Software Engineering B.S.W.E. Bachelor of Software Engineering MCQ 3 ā Questions and Answers
Question 1: Which design pattern defines a one-to-many dependency so that when one object changes state, all its dependents are notified automatically?
- Strategy pattern
- Observer pattern (Correct answer)
- Decorator pattern
- Factory pattern
Correct answer: Observer pattern
The Observer pattern establishes a publisher-subscriber relationship where dependents (observers) are automatically notified when the subject's state changes.
Question 2: In Big-O notation, which time complexity describes an algorithm whose running time doubles with each additional element in the input?
- O(n log n)
- O(n²)
- O(2āæ) (Correct answer)
- O(log n)
Correct answer: O(2āæ)
O(2āæ) is exponential complexity, meaning each additional input element doubles the number of operations, as seen in naive recursive Fibonacci.
Question 3: Which SQL command is used to remove all rows from a table while keeping the table structure intact?
- DELETE
- DROP
- TRUNCATE (Correct answer)
- REMOVE
Correct answer: TRUNCATE
TRUNCATE removes all rows from a table quickly without logging individual row deletions, but preserves the table schema.
Question 4: In Agile development, what is a 'sprint retrospective'?
- A meeting to plan upcoming sprint tasks
- A demo of completed features to stakeholders
- A team reflection on what worked and what to improve after a sprint (Correct answer)
- A review of the product backlog priority
Correct answer: A team reflection on what worked and what to improve after a sprint
A sprint retrospective is a ceremony held after each sprint where the team discusses what went well, what did not, and how to improve the next sprint.
Question 5: Which CPU scheduling algorithm can lead to starvation if high-priority processes continuously arrive?
- Round Robin
- First Come First Served
- Priority Scheduling (Correct answer)
- Shortest Job First
Correct answer: Priority Scheduling
Priority Scheduling may starve low-priority processes indefinitely if higher-priority processes keep arriving before they get CPU time.
Question 6: In software architecture, which pattern separates an application into three components: model, view, and controller?
- Microservices
- Event-Driven Architecture
- MVC (Correct answer)
- Layered Architecture
Correct answer: MVC
The Model-View-Controller (MVC) pattern divides responsibilities into data (model), UI (view), and input handling (controller) for cleaner separation of concerns.
Question 7: Which cryptographic concept ensures that a sender cannot later deny having sent a message?
- Confidentiality
- Integrity
- Non-repudiation (Correct answer)
- Authentication
Correct answer: Non-repudiation
Non-repudiation, often achieved via digital signatures, prevents a sender from denying they originated a message after the fact.
Which design pattern defines a one-to-many dependency so that when one object changes state, all its dependents are notified automatically?