Magento 2 Interview Questions Answer

  • Which command are used to enable or disable a magento2 module?

php bin/magento module:enable NameSpace_ModuleName
php bin/magento module:disable NameSpace_ModuleName

  • Which files is necessary to install – upgrade database tables and to records in it?

Normally, there are four files for this listed below


  • What is the recommended steps to be followed before Magento2 programming?

Before development starts, disable whole cache.
Set Development mode as SetEnv MAGE_MODE developer in .htacces or run the command 
php bin/magento deploy:mode:set developer
Switch off xdebug (php.ini settings) in development environment mode so process can run faster.

  • Which file are responsible for keeping database credentials in Magento2?

Its env.php situated at app/etc/ folder.

  • Which file stores the vendor path?

Its vendor_path.php situated at app/etc/ folder.

  • Which class Magento 2 helper extend?


  • Which function refers the action in any controller file?

Its execute() function

  • What are the difference between cache:clean and cache:flush?

Typically, cache:clean deletes all enabled cache related to magento whereas cache:flush deletes the whole cache storage, whether its magento cache or any third party cache (whether enabled or disabled)

  • What are resource attribute for admin menu item?

resource attribute defines the ACL rule, that a user must have in order to access this Menu Item

  • Where does all core modules are located in Magento2?

They are under vendor/magento folder.

  • Where are the module’s base definition file?

They are at app/code/Module/etc/module.xml.


Please enter your comment!
Please enter your name here