Software Engineering Prep 5 — Questions and Answers
Question 1: What does CI/CD stand for in modern software delivery?
- Code Inspection / Code Deployment
- Continuous Integration / Continuous Delivery (or Deployment) (Correct answer)
- Centralized Infrastructure / Cloud Delivery
- Component Interface / Component Design
Correct answer: Continuous Integration / Continuous Delivery (or Deployment)
CI/CD automates building, testing, and deploying code changes to reduce manual effort and release risk.
Question 2: Which of the following best describes a microservices architecture?
- A single deployable unit containing all application logic
- Small, independently deployable services each responsible for a specific business capability (Correct answer)
- A frontend-only architecture using micro-frontends
- A database sharding strategy for large datasets
Correct answer: Small, independently deployable services each responsible for a specific business capability
Microservices decompose an application into small, loosely coupled services that can be developed, deployed, and scaled independently.
Question 3: In git, what does 'git rebase' do compared to 'git merge'?
- Rebase deletes the feature branch; merge keeps it
- Rebase replays commits onto a new base, creating a linear history; merge creates a merge commit (Correct answer)
- Rebase is only used for hotfixes; merge is for feature branches
- Rebase and merge are functionally identical
Correct answer: Rebase replays commits onto a new base, creating a linear history; merge creates a merge commit
Rebase rewrites commit history to appear as if the branch was created from the latest base, resulting in a cleaner linear history.
Question 4: What is the primary benefit of using a message queue (e.g., RabbitMQ, Kafka) between services?
- Synchronous request-response communication
- Decoupling producers and consumers so they can operate independently (Correct answer)
- Encrypting data between services
- Replacing the need for a database
Correct answer: Decoupling producers and consumers so they can operate independently
Message queues allow services to communicate asynchronously, so the sender and receiver don't need to be available simultaneously.
Question 5: Which of the following is an example of a non-functional requirement?
- The system shall allow users to reset their password
- The system shall process 10,000 transactions per second (Correct answer)
- The system shall display a list of available products
- The system shall send a confirmation email after purchase
Correct answer: The system shall process 10,000 transactions per second
Non-functional requirements define system qualities like performance, scalability, and reliability rather than specific behaviors.
Question 6: What is 'defensive programming'?
- Writing code that is optimized for speed above all else
- Writing code that anticipates and handles unexpected inputs or states gracefully (Correct answer)
- Avoiding all use of third-party libraries
- Encrypting all functions to prevent reverse engineering
Correct answer: Writing code that anticipates and handles unexpected inputs or states gracefully
Defensive programming assumes that inputs may be invalid or unexpected and adds guards, validations, and error handling accordingly.
Question 7: Which graph traversal algorithm uses a queue and visits nodes level by level?
- Depth-First Search (DFS)
- Dijkstra's Algorithm
- Breadth-First Search (BFS) (Correct answer)
- A* Search
Correct answer: Breadth-First Search (BFS)
BFS uses a queue to explore all neighbors at the current depth before moving to the next level.
What does CI/CD stand for in modern software delivery?