SOLID Coding Challenge
Scenario:
You are asked to build a simple Notification System for a bank. must The system support:
Email Notification
SMS Notification
Push Notification
Your task:
Follow SRP, OCP, LSP, ISP, DIP
System must be easy to extend (e.g., Telegram later)
Use good architecture
Use clean dependency injection
com.company.project └── notification ├── NotificationService.java ├── NotificationStrategy.java ├── EmailNotification.java └── SmsNotification.java
| Principle | Applied? | Why |
|---|---|---|
| SRP | ✔ | Each notifier only sends one type of message |
| OCP | ✔ | Add new notifier without changing existing code |
| LSP | ✔ | All notifiers can replace each other safely |
| ISP | ✔ | Small interface with only one method |
| DIP | ✔ | NotificationService depends on Notifier interface |