Jan 29, 2012
kalpesh

Magento Interview Questions

Here is a list of Magento advanced interview questions that I can think off now.
EDIT: There are also Expert interview questions that I added lately.

1. Explain Magento’s MVC architecture
2. How Magento’s ORM work?
3. What is EAV in Magento?
4. Difference between Mage::getSingleton() and Mage::getModel()
5. What are the steps to change the theme of Magento
6. If you want to add/modify core functionality, how will you do it?
7. How will you create a new module in Magento?
8. How will you call a CMS page in your module’s PHTML file?
9. What is codePool in Magento?
10. Explain handles in Magento’s layout
11. What is in Magento’s config XML?
12. Explain Magento’s URL structure
13. How will you optimize Magento featured website?
14. Explain in detail cache management in Magento
15. When will you need to clear cache to see the changes in Magento?
16. Explain the flow of placing an order technically
17. How will you enable product’s custom attribute visibility in frontend?
18. How will you upgrade your custom module?
19. Difference between EAV and flat table
20. Is it mandatory to give Namespace while creating custom module in Magento?
21. How will you override Block/Model/controllers in Magento?
22. What is difference between override and rewrite?
23. How will you add/remove content from core’s system.xml file?
24. Can you have more than one Grid in a module?
25. How will you join flat table and EAV table in Magento?
26. How will you enable maintenance mode of your Magento website?
27. What are “magic methods” in Magento?
28. How many database tables will Magento create when you make a new EAV module?
29. Explain Magento’s Collections
30. Explain events and observers in Magento
31. Difference between block’s “name” and “as” attributes in layout XML
32. When to use session and when to use registry to store variables?
33. Where will you write your module’s business logic in Magento?
34. Explain different types of sessions in Magento (e.g. customer/session, checkout/session, core/session) and the reason why you store data in different session types.
35. What are the commonly used block types? What is the special in core/text_list block type.
36. What are the different design patterns used in Magento?
37. What can you do to optimize Magento performance?
38. Where is the relation between configurable product and it’s simple product stored in database?
39. How will you log current collection’s SQL query?
40. How to get first item or last item from the collection?

If you are looking for answers to these questions, check it out here:
Magento Interview questions and answers for experienced and freshers

Best luck!

13 Comments

  • thanks for the questions,
    It would be great if you can provide answers for them…

  • very useful magento question list! plz also provide answer of them, thanks

  • Yes, answer pls!!
    🙂


    Thanks

  • Thanks for Questions!!!!

  • Awesome question!!!

  • Answer 1 :
    How Magento’s MVC works:
    1. When you enter the URL (something like http://mysite.com/frontname/controller/method/param1/value1/param2/value2), this URL is intercepted by one PHP file called index.php which instantiates Magento application
    2. Magento application instantiates Front Controller object
    3. Further, front controller instantiates Router objects (specified in module’s config.xml, global tag)
    4. Now, Router is responsible to “match” the frontname which is in our URL
    5. If “match” is found, it sees controller name and method name in the URL, which is finally called.
    6. Now depending on what is written in action name (method name), it is executed. If any models are called in it, the controller method will instantiate that model and call the method in it which is requested.
    7. Then the controller action (method) instantiate the Layout object, which calls Block specified for this action (method) name (Each controller action name have block and template file associated with it, which can be found at app/design/frontend or adminhtml/namespace/module/layout/module.xml file, name of layout file (module.xml) can be found in config.xml of that module, in layout updates tag).
    8. Template file (.phtml) now calls the corresponding block for any method request. So, if you write $this->methodName in .phtml file, it will check “methodName” in the block file which is associated in module.xml file.
    9. Block contains PHP logic. It references Models for any data from DB.
    10. If either Block, Template file or Controller need to get/set some data from/to database, they can call Model directly like Mage::getModel(‘modulename/modelname’).

  • Answer2:
    ORM stands for Object Relational Mapping. It’s a programming technique used to convert different types of data to Objects and vice versa.
    In Magento, ORM is shown as Model (based on Zend Framework’s Zend_Db_Adapter), which further breaks down to two types of Models.
    – First is the “simple” i.e. Regular Models which is nothing but flat table or our regular table structure.
    – Second Model is EAV (Entity Attribute Value), which is quite complicated and expensive to query.
    All Magento Models interacting with database are inherited from Mage_Core_Model_Abstract class, which is further inherited from Varien_Object.
    Difference between two Models is, Simple Model is inherited from Mage_Core_Model_Resource_Db_Abstract class,
    while EAV is inherited from Mage_Eav_Model_Entity_Abstract.
    For those who don’t know what EAV is, please read my 3rd answer below.
    So, to end up this question,
    when you want to get some data in Magento, you call it like this:
    Mage::getModel(‘module/model’)->load(1);
    where 1 is the primary key id for some Regular/Simple table, while in EAV so many tables are joined to fetch just single row of data.

  • Answer3:
    In EAV database model, data are stored in different smaller tables rather than storing in asingle table.product name is stored in catalog_product_entity_varchar tableproduct id is stored in catalog_product_entity_int tableproduct price is stored in catalog_product_entity_decimal tableMagento Use EAV database model for easy upgrade and development as this model givesmore flexibility to play with data and attributes.

  • Answer4:
    Mage::getSingletone() always finds for an existing object if not then create that a newobject but Mage::getModel() always creates a new object.

  • Please gimme a link where is the rest answer

    I am really thankful of u

    Pls give it soon as I have interview on monday

  • Hi Kaplesh,
    I have a make website in magento but here, problem is dublication. If any customer see any product and click on add to cart button then automatic create same as dublicate product.

    Please tell me how to sort out this issue….

    Thanks in Advance !

    Bhavesh

  • Really useful .thanks for such a nice blog

  • Hi kalpesh ,
    I am really thanx to you bro!
    this blog is very good and questions as well,
    and keep it up to post like this one.
    thank you in advance.

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions