Ticker

6/recent/ticker-posts

Magento interview question

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) Define Magento.

Magento is excellent software that helps retailers to sell their products online. It is a feature-rich, open-source ecommerce solution to help the merchants with the design, content handling and functionality of their e-commerce website. It was developed by Varien (now Magento Inc) with a strong support from programmers within the open source community.
Magento helps the merchandisers to create a customized website with a variety of content management tools.

2) What was the initial release date of Magento?

Magento was initially released on 31st March, 2008.

3) Describe various 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.

Magento is a typical MVC application where controller remains at one place while the models at the other.

5) What is the technology used by Magento?

In Magento, PHP is used as a scripting language while MySQL is used as the database.

6) Explain some features of Magento?

Magento has following basic features.
  • SEO Friendly
  • Google sitemap support
  • Accounts of Customers
  • Managing orders
  • Report and analysis
  • Site management
  • Payment
  • Marketing promotion and tools
  • International support
  • Extremely modular architecture

7) What are the limitations of Magento?

There are the following limitations of Magento.
  • Due to the fact that it is written in PHP, it is slower in performance as compare to other platforms.
  • It consumes more space in the memory. It can consume gigabytes of RAM during heavy processes.
  • In the absence of Object oriented programming, it can become complex.

8) How can you improve performance of Magento?

There are various ways to improve Magento performance.
  • Disable any unused modules
  • Magento Caching
  • Optimize your Server
  • Use a Content Delivery Network (CDN)
  • Put Stylesheets at the Top
  • Put Scripts at the Bottom
  • Avoid CSS Expressions
  • Disabling Magento Log
  • improve the image

9) How can you make Magento more secure for client.

You can use following instructions to improve the security of magneto.
  • Have some complex passwords and change them time to time.
  • Do not let the Magento Content Manager remotely accessed.
  • Don't provide the download facilities on production sites.

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,
    1. if(Mage::getSingleton('customer/session')->isLoggedIn()):  
    2. Mage::getDesign()->setPackageName('package_name')->setTheme('themename');  
    3. endif;  

    19) How can you add an external JavaScript/ CSS file to Magento? 


    20) State the syntax to call a CMS page in your module's PHTML file.

    1. $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

    1. $db = Mage::getSingleton('core/resource')->getConnection('core_write');  
    2. $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?

    Change the directory to the directory where Magento is installed and execute the following commands.
    1.find. -type d -exec chmod 755  
    2.
    1. chmod+x magento   

    29) How to make Magento working with another domain?

    To let the Magento working with another domain, URL option of Magento base can be changed.
    Follow these steps:
    • select Magento admin -? System ? configuration and then click Web.
    • Choose unsecure option
    • Replace the base URL filed

    30) How will you get first and last item from the collection in Magento?

    1. $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.

    1. $maintenanceFile = 'maintenance.flag';  
    2.    
    3. if (file_exists($maintenanceFile)) {  
    4.     include_once dirname(__FILE__) . '/errors/503.php';  
    5.     exit;  
    6. }  

    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:

    1. $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?


    1. Mage::getResourceModel('reports/product_collection')  
    2. ->addOrderedQty()  
    3. ->addAttributeToSelect('*')  
    4. ->setPage(1, 5)  
    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