Challenge - 5 Problems
Clean Architecture Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Identify the correct Clean Architecture layer for UI code
In Flutter Clean Architecture, where should you place your widgets and UI code?
Attempts:
2 left
💡 Hint
Think about where the user sees and interacts with the app.
✗ Incorrect
The Presentation layer contains UI code like widgets because it handles what the user sees and interacts with.
🧠 Conceptual
intermediate2:00remaining
Role of the Domain layer in Clean Architecture
What is the main responsibility of the Domain layer in Clean Architecture for Flutter apps?
Attempts:
2 left
💡 Hint
This layer contains the core logic that does not depend on UI or data sources.
✗ Incorrect
The Domain layer holds business rules and use cases, making it independent from UI and data layers.
❓ ui_behavior
advanced2:00remaining
Effect of mixing Data layer code in Presentation layer
What happens if you put API calls directly inside Flutter widgets in the Presentation layer?
Attempts:
2 left
💡 Hint
Consider separation of concerns and testability.
✗ Incorrect
Mixing API calls in UI code breaks separation of concerns, making the app harder to maintain and test.
❓ lifecycle
advanced2:00remaining
Dependency direction in Clean Architecture
In Clean Architecture, which direction should dependencies flow between layers?
Attempts:
2 left
💡 Hint
Think about which layer is the core and should not depend on others.
✗ Incorrect
Dependencies flow inward toward the Domain layer, which is independent and core to the app.
🔧 Debug
expert3:00remaining
Identifying layer violation causing test failure
You wrote a unit test for a Domain use case but it fails because it tries to access Flutter widgets. What is the likely cause?
Attempts:
2 left
💡 Hint
Domain layer should not depend on UI code.
✗ Incorrect
Domain layer must be independent of UI. Importing widgets there breaks this and causes test failures.