Design: Clean Architecture Layered System
Design the layered architecture and explain responsibilities of each layer. Do not cover specific UI or database implementations.
Functional Requirements
FR1: Separate the system into clear layers to improve maintainability and testability
FR2: Ensure dependencies only point inward, from outer layers to inner layers
FR3: Allow easy replacement of UI, database, or external services without affecting core logic
FR4: Support independent testing of business rules without UI or database dependencies
Non-Functional Requirements
NFR1: System must handle up to 1000 concurrent users
NFR2: API response latency p99 under 300ms
NFR3: Availability target 99.9% uptime
NFR4: Code changes in one layer should not require changes in other layers