Software Engineering Software Engineering 5 — Questions and Answers
Question 1: What does 'YAGNI' stand for and what does it advise?
- You Are Getting Nearly Ideal — strive for perfect design upfront
- You Aren't Gonna Need It — don't implement features until they are actually needed (Correct answer)
- Your Application Gets New Infrastructure — automate provisioning early
- Yield All General Needs Initially — build a general framework first
Correct answer: You Aren't Gonna Need It — don't implement features until they are actually needed
YAGNI warns against adding functionality speculatively; build only what is required now to avoid unnecessary complexity.
Question 2: What is 'static code analysis'?
- Profiling application performance while it is running
- Examining source code for defects without executing it (Correct answer)
- Analyzing database query plans for optimization
- Reviewing logs after a production incident
Correct answer: Examining source code for defects without executing it
Static analysis tools inspect source code at rest to find bugs, security vulnerabilities, and style violations before the code runs.
Question 3: In database design, what does normalization primarily aim to achieve?
- Maximizing query performance by denormalizing tables
- Eliminating data redundancy and ensuring data integrity (Correct answer)
- Distributing data across multiple servers
- Encrypting sensitive columns in a table
Correct answer: Eliminating data redundancy and ensuring data integrity
Normalization organizes a database to reduce data duplication and prevent update anomalies by structuring data into related tables.
Question 4: What is the main purpose of an API gateway in a microservices architecture?
- To store shared configuration for all services
- To act as a single entry point that handles routing, authentication, and rate limiting (Correct answer)
- To synchronize databases across services
- To compile and deploy services automatically
Correct answer: To act as a single entry point that handles routing, authentication, and rate limiting
An API gateway provides a unified entry point for clients, offloading cross-cutting concerns like authentication, logging, and rate limiting from individual services.
Question 5: Which software development methodology emphasizes responding to change over following a plan?
- Waterfall
- PRINCE2
- Agile (Correct answer)
- Six Sigma
Correct answer: Agile
The Agile Manifesto explicitly values 'responding to change over following a plan' as one of its four core values.
Question 6: What is 'regression testing'?
- Testing a feature before it is developed using TDD
- Re-running tests after a change to ensure existing functionality still works (Correct answer)
- Testing how an application performs under heavy load
- Evaluating whether a product meets user requirements
Correct answer: Re-running tests after a change to ensure existing functionality still works
Regression testing verifies that recent code changes have not broken previously working functionality.
Question 7: What is the role of a 'load balancer' in a web application infrastructure?
- To compress static assets before serving them to users
- To distribute incoming traffic across multiple servers to prevent overload (Correct answer)
- To cache database queries for faster response times
- To encrypt traffic between the client and server
Correct answer: To distribute incoming traffic across multiple servers to prevent overload
A load balancer distributes client requests across multiple backend servers to improve availability, reliability, and scalability.
What does 'YAGNI' stand for and what does it advise?