CPA System Architecture & Design 2 — Questions and Answers
Question 1: Which architectural pattern separates an application into three interconnected components: model, view, and controller?
- MVP
- MVC (Correct answer)
- MVVM
- SOA
Correct answer: MVC
MVC (Model-View-Controller) divides an application into three components to separate concerns: the model handles data, the view handles display, and the controller handles input.
Question 2: In a microservices architecture, how do individual services typically communicate with each other?
- Shared memory
- Direct database access
- APIs over a network (REST or messaging) (Correct answer)
- Global variables
Correct answer: APIs over a network (REST or messaging)
Microservices communicate via well-defined APIs over a network, commonly using REST, gRPC, or asynchronous message queues, keeping services decoupled.
Question 3: What is the primary benefit of using a layered (n-tier) architecture?
- Maximizes raw performance
- Separates concerns so each layer has a distinct responsibility (Correct answer)
- Eliminates the need for a database
- Reduces the number of developers needed
Correct answer: Separates concerns so each layer has a distinct responsibility
Layered architecture organizes code into distinct tiers (e.g., presentation, business logic, data), making the system easier to maintain and modify independently.
Question 4: Which design principle states that a class should have only one reason to change?
- Open/Closed Principle
- Liskov Substitution Principle
- Single Responsibility Principle (Correct answer)
- Interface Segregation Principle
Correct answer: Single Responsibility Principle
The Single Responsibility Principle (SRP) states that a class should have only one responsibility, meaning only one reason to change.
Question 5: What does 'high cohesion' mean in the context of software module design?
- Modules are tightly coupled to each other
- Elements within a module are closely related and focused on a single task (Correct answer)
- The system has many inter-module dependencies
- Classes inherit from many parent classes
Correct answer: Elements within a module are closely related and focused on a single task
High cohesion means the responsibilities of a module are strongly related and focused, making the module easier to understand and maintain.
Question 6: Which architectural style is best described as a pipeline where each component transforms data and passes it to the next?
- Event-driven architecture
- Pipe-and-filter architecture (Correct answer)
- Service-oriented architecture
- Monolithic architecture
Correct answer: Pipe-and-filter architecture
Pipe-and-filter architecture processes data through a sequence of independent filter components connected by pipes, common in data transformation systems.
Question 7: In system design, what is a 'bottleneck'?
- A security vulnerability in the authentication layer
- A component or resource that limits the overall system throughput (Correct answer)
- A type of database normalization
- An interface between two incompatible systems
Correct answer: A component or resource that limits the overall system throughput
A bottleneck is a point in the system where the throughput is limited, causing the entire system to slow down regardless of other components' capacity.
Which architectural pattern separates an application into three interconnected components: model, view, and controller?