Software Engineering Software Engineering 4 — Questions and Answers
Question 1: Which architectural pattern separates an application into Model, View, and Controller components?
- Microservices
- Event-Driven Architecture
- MVC (Correct answer)
- Layered Architecture
Correct answer: MVC
MVC (Model-View-Controller) divides an application into data (Model), UI (View), and logic (Controller) to separate concerns.
Question 2: In Scrum, what is the 'Definition of Done'?
- The list of features planned for the next release
- A shared checklist that a story must meet to be considered complete (Correct answer)
- The acceptance criteria written by the product owner for a single story
- The date by which the sprint must end
Correct answer: A shared checklist that a story must meet to be considered complete
The Definition of Done is a team agreement on the quality standards a work item must satisfy before it can be marked complete.
Question 3: What is 'defensive programming'?
- Writing code that prevents other developers from modifying it
- Designing software to behave predictably despite invalid inputs or unexpected conditions (Correct answer)
- Using encryption to protect source code from theft
- Avoiding the use of third-party libraries to reduce vulnerabilities
Correct answer: Designing software to behave predictably despite invalid inputs or unexpected conditions
Defensive programming involves validating inputs, handling errors gracefully, and anticipating edge cases to make software more robust.
Question 4: What is the purpose of a 'feature flag' (feature toggle)?
- To mark deprecated code for removal
- To enable or disable functionality at runtime without deploying new code (Correct answer)
- To enforce access control on API endpoints
- To label git branches by feature name
Correct answer: To enable or disable functionality at runtime without deploying new code
Feature flags allow teams to ship code to production and selectively enable features for specific users or environments without redeployment.
Question 5: In software architecture, what does 'loose coupling' mean?
- Components share as much state as possible to improve performance
- Components depend minimally on each other, making them easier to change independently (Correct answer)
- All components are deployed as a single unit
- Database tables have no foreign key constraints
Correct answer: Components depend minimally on each other, making them easier to change independently
Loose coupling means components have minimal knowledge of each other, so changes to one component rarely require changes to others.
Question 6: Which HTTP status code indicates that a resource was successfully created?
- 200 OK
- 204 No Content
- 201 Created (Correct answer)
- 202 Accepted
Correct answer: 201 Created
HTTP 201 Created is returned when a request has succeeded and a new resource has been created as a result.
Question 7: What is 'pair programming'?
- Two teams independently developing the same feature to compare results
- Two developers working together at one workstation, with one coding and one reviewing (Correct answer)
- A developer pairing unit tests with every function they write
- Running two versions of an application simultaneously for comparison
Correct answer: Two developers working together at one workstation, with one coding and one reviewing
Pair programming is an Agile practice where two developers collaborate at one machine, taking turns as driver and navigator.
Which architectural pattern separates an application into Model, View, and Controller components?