Disclaimer : I will be using Kotlin code as example. When I mention DI, I mean Dependency Injection and not Dependency…