B.S.W.E. Bachelor of Software Engineering B.S.W.E. Bachelor of Software Engineering MCQ 2 — Questions and Answers
Question 1: Which software process model is best suited for projects with well-understood, stable requirements?
- Spiral model
- Waterfall model (Correct answer)
- Agile/Scrum
- Extreme Programming
Correct answer: Waterfall model
The Waterfall model works best when requirements are fully known and unlikely to change because it follows a rigid sequential phase structure.
Question 2: In object-oriented design, which principle states that a class should have only one reason to change?
- Open/Closed Principle
- Liskov Substitution Principle
- Single Responsibility Principle (Correct answer)
- Interface Segregation Principle
Correct answer: Single Responsibility Principle
The Single Responsibility Principle (SRP) dictates each class should encapsulate only one responsibility, making it have only one reason to change.
Question 3: Which data structure provides O(1) average-case time complexity for both insertion and lookup?
- Binary search tree
- Linked list
- Hash table (Correct answer)
- Heap
Correct answer: Hash table
A hash table uses a hash function to map keys to buckets, achieving O(1) average time for insert and lookup operations.
Question 4: In a relational database, the property that ensures a transaction is fully completed or not applied at all is called:
- Consistency
- Isolation
- Atomicity (Correct answer)
- Durability
Correct answer: Atomicity
Atomicity is the ACID property guaranteeing that each transaction is treated as a single indivisible unit—either all operations succeed or none are applied.
Question 5: Which network layer of the OSI model is responsible for end-to-end communication and error recovery between hosts?
- Network layer
- Data Link layer
- Transport layer (Correct answer)
- Session layer
Correct answer: Transport layer
The Transport layer (Layer 4) handles end-to-end communication, flow control, and error recovery using protocols like TCP.
Question 6: In software testing, a technique that derives test cases from the internal structure and code logic of a program is known as:
- Black-box testing
- Acceptance testing
- White-box testing (Correct answer)
- Regression testing
Correct answer: White-box testing
White-box testing (structural testing) designs test cases based on knowledge of the internal code structure, paths, and logic.
Question 7: Which version control concept allows developers to work on features independently without affecting the main codebase?
- Forking
- Rebasing
- Branching (Correct answer)
- Merging
Correct answer: Branching
Branching creates a separate line of development so new features or bug fixes can be built in isolation from the main (production) branch.
Which software process model is best suited for projects with well-understood, stable requirements?