Software Engineering Basic Software Engineering 2 — Questions and Answers
Question 1: Which software development model is best suited for projects where requirements are well-understood and unlikely to change?
- Agile
- Waterfall (Correct answer)
- Spiral
- Scrum
Correct answer: Waterfall
The Waterfall model works best when requirements are stable and fully defined upfront, following a strict sequential flow.
Question 2: What does the term 'technical debt' refer to in software engineering?
- The cost of hardware needed to run software
- Accumulated cost of shortcuts and poor design decisions made for short-term gain (Correct answer)
- Money owed to software vendors for licenses
- The time needed to train developers on a new codebase
Correct answer: Accumulated cost of shortcuts and poor design decisions made for short-term gain
Technical debt represents the implied future rework caused by choosing an easy solution now instead of a better approach that would take longer.
Question 3: In object-oriented programming, what is encapsulation?
- Inheriting properties from a parent class
- Bundling data and methods that operate on that data within a single unit, restricting direct access (Correct answer)
- Creating multiple classes with the same method name
- Defining a class that cannot be instantiated
Correct answer: Bundling data and methods that operate on that data within a single unit, restricting direct access
Encapsulation hides an object's internal state and exposes only what is necessary through a public interface.
Question 4: What is a 'use case' in software requirements analysis?
- A test scenario written by QA engineers
- A description of how a user interacts with a system to achieve a specific goal (Correct answer)
- A list of all the functions a system must perform
- A diagram showing the database schema
Correct answer: A description of how a user interacts with a system to achieve a specific goal
A use case captures the interaction between an actor and a system to accomplish a particular objective.
Question 5: Which version control operation integrates changes from one branch into another?
- Commit
- Clone
- Merge (Correct answer)
- Push
Correct answer: Merge
Merging combines the history and changes of one branch into another, reconciling differences between them.
Question 6: What does DRY stand for in software engineering principles?
- Define, Refactor, Yield
- Don't Repeat Yourself (Correct answer)
- Distribute, Reuse, Yield
- Dynamic Runtime Yardstick
Correct answer: Don't Repeat Yourself
DRY (Don't Repeat Yourself) states that every piece of knowledge should have a single, unambiguous representation in a system.
Question 7: What is the primary purpose of a software design pattern?
- To enforce a specific programming language syntax
- To provide reusable solutions to commonly occurring design problems (Correct answer)
- To replace the need for unit testing
- To document the history of code changes
Correct answer: To provide reusable solutions to commonly occurring design problems
Design patterns are proven templates that address recurring design problems, improving code reuse and maintainability.
Which software development model is best suited for projects where requirements are well-understood and unlikely to change?