Capgemini interview question

why we resource interface in magento2