It allows using objects without having to know how these objects are persisted. It is an abstraction of the data layer. It means that our business logic no need to know how data is retrieved. The business logic relies on the repository to get the correct data.

Basically it is used to decouple the data access layers and business logic in our application.

BY Best Interview Question ON 30 Dec 2023