B.S.W.E. Bachelor of Software Engineering Practice 5 β Questions and Answers
Question 1: Which SOLID principle states that software entities should be open for extension but closed for modification?
- Single Responsibility Principle
- Open/Closed Principle (Correct answer)
- Dependency Inversion Principle
- Interface Segregation Principle
Correct answer: Open/Closed Principle
The Open/Closed Principle promotes extending behavior through new code (subclasses, plugins) rather than modifying existing stable code.
Question 2: A team uses feature flags to deploy incomplete features to production hidden from users. Which benefit does this provide?
- Eliminates the need for version control
- Enables continuous deployment while controlling feature rollout (Correct answer)
- Replaces automated testing
- Reduces database migration complexity
Correct answer: Enables continuous deployment while controlling feature rollout
Feature flags decouple deployment from release, allowing teams to ship code continuously while controlling when and to whom features are exposed.
Question 3: What is the main advantage of writing small, focused unit tests over large integration tests?
- Unit tests cover more code paths per test
- Unit tests are faster to run and pinpoint failures precisely (Correct answer)
- Unit tests eliminate the need for integration tests
- Unit tests are easier to write for legacy systems
Correct answer: Unit tests are faster to run and pinpoint failures precisely
Small unit tests run in milliseconds and fail with a precise indication of which unit broke, making debugging faster compared to slower integration tests.
Question 4: In software estimation, what does 'planning poker' use to reach a team consensus on story point estimates?
- Manager authority to set the estimate
- Individual secret voting with simultaneous reveal to avoid anchoring (Correct answer)
- Averaging the lead developer's estimate with junior estimates
- Using historical defect counts as a proxy for complexity
Correct answer: Individual secret voting with simultaneous reveal to avoid anchoring
Planning poker uses simultaneous card reveal to surface diverging estimates without anchoring bias, then the team discusses until consensus is reached.
Question 5: Which practice requires every merge to the main branch to trigger an automated build, test, and report cycle?
- Manual QA gating
- Continuous Integration pipeline (Correct answer)
- Canary deployment
- Infrastructure as Code
Correct answer: Continuous Integration pipeline
A Continuous Integration pipeline automatically builds and tests every commit pushed to the main branch, catching integration issues immediately.
Question 6: A developer commits code containing a hardcoded API key in a public repository. What is the first remediation step?
- Delete the commit message
- Revoke and rotate the exposed key immediately (Correct answer)
- Set the repository to private
- Revert the last commit locally
Correct answer: Revoke and rotate the exposed key immediately
Once a secret is committed to a public repository it must be treated as compromised; rotating the key immediately limits potential damage.
Question 7: Which documentation artifact describes the 'who, what, and why' of a feature from the end user's perspective?
- UML class diagram
- User story (Correct answer)
- Architecture decision record
- API specification
Correct answer: User story
A user story follows the format 'As a [user], I want [goal], so that [benefit],' capturing requirements from the end user's perspective.
Which SOLID principle states that software entities should be open for extension but closed for modification?