|
| 1 | +anchor: vertical-slice-architecture |
| 2 | +tier: 3 |
| 3 | +questions: |
| 4 | + recognition: |
| 5 | + question: 'Which of the following best describes "Vertical Slice Architecture |
| 6 | + (VSA)"? |
| 7 | +
|
| 8 | + ' |
| 9 | + options: |
| 10 | + A: Code is organized into distinct horizontal layers (presentation, business, |
| 11 | + data) with clear separation of concerns and dependencies flowing downward |
| 12 | + through each technical layer |
| 13 | + B: Each feature is organized as an end-to-end slice spanning all layers (request, |
| 14 | + validation, domain logic, persistence, API); code for a feature lives together |
| 15 | + regardless of technical layer |
| 16 | + C: The application core is isolated from external dependencies through ports |
| 17 | + and adapters, with business logic at the center surrounded by interface adapters |
| 18 | + that connect to external systems |
| 19 | + D: Commands and queries are separated into distinct models and handlers, with |
| 20 | + write operations handled differently from read operations to optimize for |
| 21 | + different access patterns and scalability requirements |
| 22 | + correct: B |
| 23 | + application: |
| 24 | + scenario: Your team is building an e-commerce platform with features like user |
| 25 | + registration, product catalog, shopping cart, order processing, and payment |
| 26 | + handling. Currently, the codebase is organized into traditional layers (Controllers, |
| 27 | + Services, Repositories) but developers are experiencing frequent merge conflicts |
| 28 | + and find it difficult to work on features independently. Changes to one feature |
| 29 | + often require modifications across multiple layers, slowing down development. |
| 30 | + anchor_prompt: using Vertical Slice Architecture (VSA) |
| 31 | + paraphrase_prompt: How should you reorganize the codebase to enable independent |
| 32 | + feature development and reduce cross-feature coupling? |
| 33 | + options: |
| 34 | + A: Create separate microservices for each feature (UserService, ProductService, |
| 35 | + CartService, etc.) with their own databases and API gateways to ensure complete |
| 36 | + isolation between features. |
| 37 | + B: Organize code by feature slices where each feature (Registration, Catalog, |
| 38 | + Cart, Orders, Payments) contains its own request handlers, validation, business |
| 39 | + logic, and data access in a single vertical slice. |
| 40 | + C: Implement a strict layered architecture with clear interfaces between Controller, |
| 41 | + Service, and Repository layers, using dependency injection to manage cross-layer |
| 42 | + dependencies more effectively. |
| 43 | + D: Apply Domain-Driven Design by creating bounded contexts for each business |
| 44 | + domain and organizing code into aggregate roots with separate application |
| 45 | + services for each domain. |
| 46 | + correct: B |
0 commit comments