Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
When you're building software beyond simple scripts, the way you organize your code determines whether your system thrives or collapses under its own weight. Architecture patterns aren't just theoretical constructs—they're battle-tested solutions to problems like how do I add features without breaking everything?, how do I scale when users multiply?, and how do I let multiple teams work without stepping on each other? You're being tested on your ability to recognize which pattern solves which problem and why.
These patterns demonstrate core principles you'll encounter throughout your career: separation of concerns, loose coupling, high cohesion, and scalability strategies. The exam won't just ask you to define MVC or list the layers in N-tier architecture. You'll need to analyze scenarios and recommend appropriate patterns, explain tradeoffs, and understand when one pattern outperforms another. Don't just memorize names—know what problem each pattern solves and what principles it embodies.
These patterns solve the fundamental problem of organizing code into logical units. The core mechanism is dividing responsibilities so that changes in one area don't cascade throughout the system.
Compare: Layered Architecture vs. MVC—both enforce separation of concerns, but Layered organizes by technical function (data, logic, presentation) while MVC organizes by role in user interaction (what you see, what you do, what changes). If an FRQ asks about web application structure, MVC is usually your answer; for enterprise systems with multiple interfaces, think Layered.
These patterns define how components talk to each other. The key distinction is whether communication is synchronous (request-response) or asynchronous (fire-and-forget).
Compare: Publish-Subscribe vs. Event-Driven—Pub-Sub is a messaging pattern (how messages flow), while Event-Driven is an architectural style (how the system behaves). Event-Driven architectures often use Pub-Sub as their communication mechanism. Think of Pub-Sub as a tool within the Event-Driven toolbox.
These patterns structure applications as collections of services rather than monolithic codebases. The driving principle is that independent services can evolve, scale, and fail independently.
Compare: SOA vs. Microservices—both decompose applications into services, but SOA typically involves larger services sharing an Enterprise Service Bus (ESB) for communication, while Microservices favor smaller services with direct API calls. Microservices emerged partly as a reaction to SOA's complexity. FRQs may ask you to identify which suits a startup (Microservices) versus a legacy enterprise integration (SOA).
These patterns focus on how data moves through a system. The core idea is creating predictable, often unidirectional paths for data transformation.
findById() without knowing if data comes from SQL, NoSQL, or an APICompare: Pipe and Filter vs. Repository—these solve different problems entirely. Pipe and Filter handles data transformation workflows (think Unix commands piped together), while Repository handles data persistence abstraction. Both promote separation of concerns but at different architectural levels.
| Concept | Best Examples |
|---|---|
| Separation of Concerns | Layered Architecture, MVC, Component-Based |
| Synchronous Communication | Client-Server |
| Asynchronous Communication | Event-Driven, Publish-Subscribe |
| Service Decomposition | SOA, Microservices |
| Data Abstraction | Repository Pattern |
| Data Transformation | Pipe and Filter |
| Independent Deployment | Microservices, Component-Based |
| Loose Coupling | Event-Driven, Publish-Subscribe, SOA |
Which two patterns both enable parallel development by isolating components, but differ in how they define those components—one by technical layer, one by interaction role?
A system needs to process real-time stock trades where multiple downstream services (logging, analytics, alerting) must react to each trade. Which pattern best fits, and why would Client-Server be insufficient?
Compare and contrast SOA and Microservices: what shared principle do they embody, and what key differences would influence your choice for a new greenfield project versus integrating legacy enterprise systems?
You're designing a data processing pipeline that ingests CSV files, validates records, transforms formats, and outputs to a database. Which pattern would you apply, and how does it promote reusability?
An FRQ asks you to refactor a monolithic application where UI code directly queries the database. Which two patterns would you combine to introduce proper separation, and what specific problem does each solve?