Magento Interview Questions
There is given Magento interview questions and answers that has been asked in many companies. Let's see the list of top Magento interview questions.
1) What is Magento?
Magento is a feature rich e-Commerce platform created on open-source technology. It provides online merchants with unprecedented flexibility and control over the look, content and functionality of their e-Commerce store.
2) What was the initial release date of Magento?
Magento was initially released on 31st March, 2008.
3) What are the different versions of Magento?
Following are the different versions of Magento:
Magento Enterprise Edition
Magento Community Edition
Magento Professional Edition
Magento .go Edition
4) Explain the architecture of Magento?
The architecture of Magento is a typical PHP MVC (Model-View-Controller) application where the entire controller will be in one folder and all the models in another. Files are grouped together and known as modules in Magento.
5) What technology does Magento use?
Magento uses PHP as a web server scripting language and MySQL as a database.
6) What are the different features of Magento?
Some of the basic features of Magento are:
SEO Friendly
Google sitemap support
Reporting and analytics
Customer accounts
Order management
Site management
Payment
Marketing promotion and tools
International support
Extremely modular architecture
7) What are the limitations of Magento?
There are three reasons to use UNITS in programming:
Magento is written in PHP so it is comparatively slower in performance to other e-Commerce solutions.
Magento requires more space and memory. It can consume gigabytes of RAM during heavy processes.
It becomes complex if it is not using object-oriented programming.
8) How can you enhance the Magento performance?
The first Pascal standard was documented by the author of the Pascal programming language Niklaus Wirth but it was an unofficial Pascal standard.
Disable the Magento log
Disable any un-used modules
Magento Caching
Optimize your image
Optimize your Server
Use a Content Delivery Network (CDN)
Put Stylesheets at the Top
Put Scripts at the Bottom
Avoid CSS Expressions
9) How can you make Magento more secure for the client?
You can use following instructions to make Magento more secure for the client:
Use a strong password and change them at regular interval.
Disable remote access to Magento Connect Manager.
Disable Downloader on production sites.
Restrict access to safe IP addresses.
10) What type of web applications are created in Magento.
Magento is mainly used for shopping cart software.
11) What is EAV in Magento?
EAV stands for Entity Attribute Value. It is a technique that facilitates users to add unlimited columns to their table virtually.
12) How many tables will be created in EAV module in Magento? Name them.
EAV module will create 6 tables in database.
They are as follows:
module
module_datetime
module_decimal
module_int
module_text
module_varchar
13) Explain the difference between EAV and flat model..
EAV database model is fully in normalized form. Each column's value is stored in their respective data type table which makes it more complex as they have to join 5-6 tables even if you need only one detail. In EAV, columns are called attributes.
Flat model uses just one table. It is not normalized and uses more database space. It is not good for dynamic requirements where you may have to add some more columns in future. Its performance is fast as it needs only one query instead of joining 5-6 tables. In flat model, columns are called fields.
14) What are Magento product types?
Magento simple product: It is used for a single item without any specific selectable variations. For example, a pen, copy, etc.
Magento grouped product: It is used for a combination of Magento simple product. For example, a pen and copy together.
Magento configurable product: It is used for a single item with specific selectable variations. For example, a pen with different color options.
Magento virtual product: It is used for a virtual item i.e: non touchable item. For example, reservation, insurance, etc.
Magento bundle product: It is used for a bundle of simple products. For example, laptop with various items such as processor, hard disk, RAM, etc.
Magento downloadable product: It is used for online software items. For example, PowerPoint presentation, MP3 files, servers, etc.
15) Explain the difference between Mage::getModel() and Mage::getSingletone() in Magento.
Mage::getModel(): It creates a new object.
Mage::getSingletone(): It first checks the existence of object and if object doesn?t exist, then it creates a new one.
16) Explain ORM in Magento.
ORM stands for Object Relational Mapping. It is a programming technique used to convert different types of data into objects and vice versa.
There are two types of ORM:
Converts different types of data into objects.
Converts objects to various types of data.
17) Explain different modules in Magento.
Core modules
Commercial modules
Community modules
18) How to change theme for login users?
To change theme for login users,
if(Mage::getSingleton('customer/session')->isLoggedIn()):
Mage::getDesign()->setPackageName('package_name')->setTheme('themename');
endif;
19) How can you add an external JavaScript/ CSS file to Magento?
css/yourstyle.css
or
skin_jsjs/ yourfile.js
skin_csscss/yourstyle. css
20) State the syntax to call a CMS page in your module's PHTML file.
$this->getLayout()->createBlock('cms/block')->setBlockId('blockidentifier')->toHtml();
21) When you need to clear the cache to see the changes made in Magento?
When you have added or modified XML, CSS or JS files.
22) How to run custom query in Magento?
To run custom query,
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
$result=$db->query('SELECT * FROM users where id=4');
23) How to enable product's custom attribute visibility in frontend?
In Manage Attributes section under custom attribute, select Yes for "Visible on Product View Page on Frontend" and "Used in Product Listing".
24) State whether namespace is mandatory while creating a custom module in Magento?
No, namespace is not mandatory while creating custom module.
25) Is it possible to have more than one grid in Magento?
Yes it is possible.
26) List the magic methods in Magento?
Magic methods in Magento:
__get()
__set()
__isset()
__call()
__tostring()
__construct()
__has()
__uns()
27) How many types of sessions are there? Why we use different sessions in Magento?
There are namely three sessions in Magento:
customer session
checkout session
core session
All these sessions are stored in one session only. We use different sessions because sometimes we need to clear only a particular session data and not all session data.
28) How can you reset Magento files and Directory permissions?
To reset Magento files and directory to their default and secure permissions, use the following commands from the directory where Magento is installed.
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod +x mage
29) How to configure Magento to work with another domain?
To configure Magento to work with another domain, you have to change the Magento base URL option in the admin area.
Follow these steps:
Go to Magento admin area > System > Configuration and click Web on the left menu.
Select unsecure option
Edit the base URL field to change the URL that will be used for normal (HTTP) connections.
30) How will you get first and last item from the collection in Magento?
$collection->getFirstItem() and $collection->getLastItem();
31) Explain the use of namespace in Magento?
Magento core modules are placed in mage namespace, core/Mage/Catalog and all custom modules are placed in local/CustomModule.
You can have more than one module with same name but they need to be placed in different namespaces.
32) Explain handles in Magento?
Handles control the structure of the page to be displayed. It decides which block will be placed where in the page. Handle is called for every page and every page request can have several unique handles.
33) Explain compilation feature in Magento?
Compilation feature allows us to compile all Magento files to create a single include path to increase performance.
34) How to enable Maintenance mode in Magento?
Create a file named as maintenance.flag and upload it to Magento home directory containing following code.
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
35) How to convert default currency to others in Magento?
To convert default currency to others, select the currency and import currency rates from System-> Manage currency-> Rates.
Syntax:
$convertedPrice = Mage::helper('directory')->currencyConvert($price, currentCurrency, newCurrency);
36) Explain Google checkout in Magento.
Magento allows the integration of online stores with Google checkout. Google checkout is the online payments service provided by the Google. It works like PayPal.
37) Explain how to change Magento core API setting?
You have to follow these steps to change Magento core API setting.
Go to Admin menu, choose System -> Configuration
Select Magento Core API on the left side of the Configuration Panel, under Services
Click on to expand the General Settings section
Type name of the Default Response Charset that you want to use
Determine the Client Session Timeout in seconds
Click the Save Config button when completed
38) Can all billing information be managed through Magento?
You can do the following things through client Magento account:
You can update your billing address.
You can add a credit card.
You can view your billing history.
You can add a PayPal account.
You can produce a print ready receipt.
39) What are the advantages of applying Connect Patches in Magento?
In Magento, applying Connect Patches provides following features:
Enable easy installation of packages with installation and overwrite any existing translations for the same time
Enhance security, by default Magento Connect uses HTTP to download extensions instead of FTP
Facilitate the extension developers to create new extensions with a dash character in the name
Magento administrators will be informed now who tries to install an extension with insufficient file system privileges.
40) How to fetch 5 bestsellers products programmatically in Magento?
Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->setPage(1, 5)
->load();
41) What is codePool?
Code pool is a concept to pull the code in Magento structured format. It is specified when you register new module in app/etc/modules/Company_Module.xml
There are 3 codePools in Magento: core, community and local, which reside at app/code/ directory.
CodePools:
_community: It is generally used by 3rd party extensions.
_core: It is used by Magento core team.
_local: Local codePool should be used for in-hour module development and overriding of core and community modules for custom requirement.
Residing directory:
_app
_code
So in short, you can say that codePool helps Magento to locate module inside app/code/ for processing
There is given Magento interview questions and answers that has been asked in many companies. Let's see the list of top Magento interview questions.
1) What is Magento?
Magento is a feature rich e-Commerce platform created on open-source technology. It provides online merchants with unprecedented flexibility and control over the look, content and functionality of their e-Commerce store.
2) What was the initial release date of Magento?
Magento was initially released on 31st March, 2008.
3) What are the different versions of Magento?
Following are the different versions of Magento:
Magento Enterprise Edition
Magento Community Edition
Magento Professional Edition
Magento .go Edition
4) Explain the architecture of Magento?
The architecture of Magento is a typical PHP MVC (Model-View-Controller) application where the entire controller will be in one folder and all the models in another. Files are grouped together and known as modules in Magento.
5) What technology does Magento use?
Magento uses PHP as a web server scripting language and MySQL as a database.
6) What are the different features of Magento?
Some of the basic features of Magento are:
SEO Friendly
Google sitemap support
Reporting and analytics
Customer accounts
Order management
Site management
Payment
Marketing promotion and tools
International support
Extremely modular architecture
7) What are the limitations of Magento?
There are three reasons to use UNITS in programming:
Magento is written in PHP so it is comparatively slower in performance to other e-Commerce solutions.
Magento requires more space and memory. It can consume gigabytes of RAM during heavy processes.
It becomes complex if it is not using object-oriented programming.
8) How can you enhance the Magento performance?
The first Pascal standard was documented by the author of the Pascal programming language Niklaus Wirth but it was an unofficial Pascal standard.
Disable the Magento log
Disable any un-used modules
Magento Caching
Optimize your image
Optimize your Server
Use a Content Delivery Network (CDN)
Put Stylesheets at the Top
Put Scripts at the Bottom
Avoid CSS Expressions
9) How can you make Magento more secure for the client?
You can use following instructions to make Magento more secure for the client:
Use a strong password and change them at regular interval.
Disable remote access to Magento Connect Manager.
Disable Downloader on production sites.
Restrict access to safe IP addresses.
10) What type of web applications are created in Magento.
Magento is mainly used for shopping cart software.
11) What is EAV in Magento?
EAV stands for Entity Attribute Value. It is a technique that facilitates users to add unlimited columns to their table virtually.
12) How many tables will be created in EAV module in Magento? Name them.
EAV module will create 6 tables in database.
They are as follows:
module
module_datetime
module_decimal
module_int
module_text
module_varchar
13) Explain the difference between EAV and flat model..
EAV database model is fully in normalized form. Each column's value is stored in their respective data type table which makes it more complex as they have to join 5-6 tables even if you need only one detail. In EAV, columns are called attributes.
Flat model uses just one table. It is not normalized and uses more database space. It is not good for dynamic requirements where you may have to add some more columns in future. Its performance is fast as it needs only one query instead of joining 5-6 tables. In flat model, columns are called fields.
14) What are Magento product types?
Magento simple product: It is used for a single item without any specific selectable variations. For example, a pen, copy, etc.
Magento grouped product: It is used for a combination of Magento simple product. For example, a pen and copy together.
Magento configurable product: It is used for a single item with specific selectable variations. For example, a pen with different color options.
Magento virtual product: It is used for a virtual item i.e: non touchable item. For example, reservation, insurance, etc.
Magento bundle product: It is used for a bundle of simple products. For example, laptop with various items such as processor, hard disk, RAM, etc.
Magento downloadable product: It is used for online software items. For example, PowerPoint presentation, MP3 files, servers, etc.
15) Explain the difference between Mage::getModel() and Mage::getSingletone() in Magento.
Mage::getModel(): It creates a new object.
Mage::getSingletone(): It first checks the existence of object and if object doesn?t exist, then it creates a new one.
16) Explain ORM in Magento.
ORM stands for Object Relational Mapping. It is a programming technique used to convert different types of data into objects and vice versa.
There are two types of ORM:
Converts different types of data into objects.
Converts objects to various types of data.
17) Explain different modules in Magento.
Core modules
Commercial modules
Community modules
18) How to change theme for login users?
To change theme for login users,
if(Mage::getSingleton('customer/session')->isLoggedIn()):
Mage::getDesign()->setPackageName('package_name')->setTheme('themename');
endif;
19) How can you add an external JavaScript/ CSS file to Magento?
css/yourstyle.css
or
skin_jsjs/ yourfile.js
skin_csscss/yourstyle. css
20) State the syntax to call a CMS page in your module's PHTML file.
$this->getLayout()->createBlock('cms/block')->setBlockId('blockidentifier')->toHtml();
21) When you need to clear the cache to see the changes made in Magento?
When you have added or modified XML, CSS or JS files.
22) How to run custom query in Magento?
To run custom query,
$db = Mage::getSingleton('core/resource')->getConnection('core_write');
$result=$db->query('SELECT * FROM users where id=4');
23) How to enable product's custom attribute visibility in frontend?
In Manage Attributes section under custom attribute, select Yes for "Visible on Product View Page on Frontend" and "Used in Product Listing".
24) State whether namespace is mandatory while creating a custom module in Magento?
No, namespace is not mandatory while creating custom module.
25) Is it possible to have more than one grid in Magento?
Yes it is possible.
26) List the magic methods in Magento?
Magic methods in Magento:
__get()
__set()
__isset()
__call()
__tostring()
__construct()
__has()
__uns()
27) How many types of sessions are there? Why we use different sessions in Magento?
There are namely three sessions in Magento:
customer session
checkout session
core session
All these sessions are stored in one session only. We use different sessions because sometimes we need to clear only a particular session data and not all session data.
28) How can you reset Magento files and Directory permissions?
To reset Magento files and directory to their default and secure permissions, use the following commands from the directory where Magento is installed.
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod +x mage
29) How to configure Magento to work with another domain?
To configure Magento to work with another domain, you have to change the Magento base URL option in the admin area.
Follow these steps:
Go to Magento admin area > System > Configuration and click Web on the left menu.
Select unsecure option
Edit the base URL field to change the URL that will be used for normal (HTTP) connections.
30) How will you get first and last item from the collection in Magento?
$collection->getFirstItem() and $collection->getLastItem();
31) Explain the use of namespace in Magento?
Magento core modules are placed in mage namespace, core/Mage/Catalog and all custom modules are placed in local/CustomModule.
You can have more than one module with same name but they need to be placed in different namespaces.
32) Explain handles in Magento?
Handles control the structure of the page to be displayed. It decides which block will be placed where in the page. Handle is called for every page and every page request can have several unique handles.
33) Explain compilation feature in Magento?
Compilation feature allows us to compile all Magento files to create a single include path to increase performance.
34) How to enable Maintenance mode in Magento?
Create a file named as maintenance.flag and upload it to Magento home directory containing following code.
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
35) How to convert default currency to others in Magento?
To convert default currency to others, select the currency and import currency rates from System-> Manage currency-> Rates.
Syntax:
$convertedPrice = Mage::helper('directory')->currencyConvert($price, currentCurrency, newCurrency);
36) Explain Google checkout in Magento.
Magento allows the integration of online stores with Google checkout. Google checkout is the online payments service provided by the Google. It works like PayPal.
37) Explain how to change Magento core API setting?
You have to follow these steps to change Magento core API setting.
Go to Admin menu, choose System -> Configuration
Select Magento Core API on the left side of the Configuration Panel, under Services
Click on to expand the General Settings section
Type name of the Default Response Charset that you want to use
Determine the Client Session Timeout in seconds
Click the Save Config button when completed
38) Can all billing information be managed through Magento?
You can do the following things through client Magento account:
You can update your billing address.
You can add a credit card.
You can view your billing history.
You can add a PayPal account.
You can produce a print ready receipt.
39) What are the advantages of applying Connect Patches in Magento?
In Magento, applying Connect Patches provides following features:
Enable easy installation of packages with installation and overwrite any existing translations for the same time
Enhance security, by default Magento Connect uses HTTP to download extensions instead of FTP
Facilitate the extension developers to create new extensions with a dash character in the name
Magento administrators will be informed now who tries to install an extension with insufficient file system privileges.
40) How to fetch 5 bestsellers products programmatically in Magento?
Mage::getResourceModel('reports/product_collection')
->addOrderedQty()
->addAttributeToSelect('*')
->setPage(1, 5)
->load();
41) What is codePool?
Code pool is a concept to pull the code in Magento structured format. It is specified when you register new module in app/etc/modules/Company_Module.xml
There are 3 codePools in Magento: core, community and local, which reside at app/code/ directory.
CodePools:
_community: It is generally used by 3rd party extensions.
_core: It is used by Magento core team.
_local: Local codePool should be used for in-hour module development and overriding of core and community modules for custom requirement.
Residing directory:
_app
_code
So in short, you can say that codePool helps Magento to locate module inside app/code/ for processing
No comments:
Post a Comment