Magento, now Adobe Commerce (with Magento Open Source as its free edition), runs large and complex online stores. These Magento interview questions cover the architecture, catalogue and admin for beginners, then modules, plugins, observers, dependency injection, indexing, caching and performance for Magento 2 developers.
30 questions · Updated
Reading answers is not the same as saying them.Practise Magento questions out loud and get a score, what you missed and a model answer for each one.
Practise free with AIMagento Interview Questions: 30 questions with model answers on this page.
Basic Magento interview questions
Fundamentals, definitions and simple scenarios. Good for freshers and warm-ups.
1. What is Magento, and what is the difference between Magento Open Source and Adobe Commerce?
Answer flow · 3 steps
1
Magento is a PHP e-commerce platform built for large catalogues, multiple stores and complex business rules.
2
Magento Open Source is free and self-hosted.
3
Adobe Commerce is the paid edition with B2B features, advanced marketing and segmentation, Page Builder extras, staging, and a cloud hosting option, plus Adobe support.
2. What are the product types in Magento 2?
Answer flow · 3 steps
1
Simple, configurable (a parent product with options such as size and colour, each linked to a simple product), grouped, bundle (customer builds a package from options), virtual (no shipping, such as a service) and downloadable products.
2
Adobe Commerce adds gift cards.
3
Configurable products are the most common for clothing and other items with variants.
3. What is the website, store and store view hierarchy?
Answer flow · 4 steps
1
A Magento installation can have several websites, each with its own customers and possibly different prices.
2
Each website has one or more stores, each with its own root category.
3
Each store has store views, usually used for languages or regional versions of the same store.
4
Configuration settings can be scoped at global, website or store view level.
4. What are the main areas of the Magento admin?
Sales (orders, invoices, shipments, credit memos), Catalog (products and categories), Customers, Marketing (promotions, SEO, newsletters), Content (pages, blocks, widgets and design configuration), Reports, Stores (configuration, attributes, tax rates, currency) and System (cache management, index management, import and export, permissions and integrations).
5. What are attributes and attribute sets?
Attributes are product properties such as colour, size, brand or material, with settings for input type, scope (global, website or store view), whether they appear in layered navigation, search or comparison, and whether they can create configurable products. Attribute sets group attributes for a type of product, such as clothing or electronics, so each product form shows only relevant fields.
6. What is the difference between catalog price rules and cart price rules?
Catalog price rules discount products before they are added to the cart, for example 10% off a category for a customer group, and the discounted price shows on product pages. Cart price rules apply in the cart based on conditions such as subtotal, quantity or coupon codes, for example free shipping above ₹2,000 or buy two get one free.
7. What cache types does Magento have?
Answer flow · 3 steps
1
Cache types include configuration, layouts, blocks HTML output, collections data, reflection, database DDL, EAV, page cache (full page cache), translations, integrations and web services configuration.
2
They are managed in System > Cache Management or with bin/magento cache:clean and cache:flush.
3
Production stores use Varnish for the full page cache and Redis for the others.
8. What are Magento's deploy modes?
Answer flow · 4 steps
1
Default mode is used out of the box and is not optimised for either development or production.
2
Developer mode shows errors, generates code on the fly and does not cache static files, for development.
3
Production mode serves pre-compiled code and deployed static files and hides errors, giving the best performance.
4
Maintenance mode shows a maintenance page during updates.
9. Which bin/magento commands do you use often?
setup:upgrade after installing modules or updates, setup:di:compile to compile dependency injection, setup:static-content:deploy for static files, cache:clean and cache:flush, indexer:reindex and indexer:status, deploy:mode:set, module:enable and module:disable, maintenance:enable, cron:run and admin:user:create.
10. Which frontend themes are used with Magento?
Answer flow · 3 steps
1
Luma is the default demo theme and Blank is a minimal base theme for building custom themes, both built on RequireJS, Knockout.js and LESS, which makes them heavy.
2
Hyvä is a popular modern theme that replaces that stack with Alpine.js and Tailwind CSS, giving much better performance.
3
Headless options include PWA Studio and other frontend frameworks.
11. What is Multi-Source Inventory?
Multi-Source Inventory (MSI) lets a store manage stock across several sources, such as warehouses, stores and drop shippers, and assign them to stocks linked to sales channels (websites). Salable quantity accounts for reservations from placed orders, and source selection algorithms decide which source ships each order, for example by priority or distance.
Intermediate Magento interview questions
Applied problems, trade-offs and questions about your own projects.
12. Explain the structure of a Magento 2 module.
A module lives in app/code/Vendor/Module with registration.php and etc/module.xml to declare it. etc/di.xml configures dependency injection, etc/routes.xml and Controller/ handle URLs, Model/ and Api/ hold business logic and service contracts, view/ holds layouts, templates and JavaScript, and Setup/ or db_schema.xml handles database changes. It is enabled with bin/magento module:enable and setup:upgrade.
13. What is the difference between plugins (interceptors), observers and preferences?
Answer flow · 3 steps
1
A plugin intercepts a public method of a class with before, after or around methods to change its arguments, result or execution, without replacing the class.
2
An observer listens to a dispatched event, such as checkout_onepage_controller_success_action, and runs code when it fires.
3
A preference replaces a whole class with your own in di.xml, which is the most invasive and can conflict with other modules, so I use plugins or observers first.
14. What is dependency injection in Magento 2?
Answer flow · 4 steps
1
Classes declare the objects they need as constructor arguments, and Magento's object manager creates and passes them in, based on di.xml configuration.
2
This makes code testable and replaceable.
3
Factories create new instances of models, and proxies delay loading heavy dependencies.
4
Calling the ObjectManager directly in your code is considered bad practice.
15. What are indexers in Magento, and what is the difference between update on save and update by schedule?
Answer flow · 3 steps
1
Indexers transform data such as prices, stock, categories and URLs into flat tables that the storefront can read quickly.
2
"Update on save" reindexes immediately when an admin saves something, which slows the admin for big catalogues.
3
"Update by schedule" records changes and processes them by cron in the background, which is recommended for large stores.
16. How do layout XML, blocks and templates work together?
Answer flow · 3 steps
1
Layout XML files define the page structure: containers, blocks, their order and which templates they use, and can add, move or remove elements.
2
Blocks are PHP classes that provide data to templates, and templates (.phtml files) render HTML.
3
View models are now preferred for adding logic to templates instead of custom block classes.
17. What are UI components?
UI components are configurable building blocks defined in XML and powered by JavaScript (Knockout.js), used mainly for admin grids and forms, such as product listings with filters, mass actions and inline editing, and for frontend parts such as checkout. They let developers build complex interfaces by configuration and extend existing ones.
18. What is the EAV model?
Entity-Attribute-Value stores entities such as products, categories and customers across several tables: a main entity table and separate value tables by data type (varchar, int, decimal, text, datetime) for each attribute. It allows unlimited custom attributes without changing the schema, but queries need many joins, which is why Magento uses flat indexes and caches heavily.
19. How does cron work in Magento?
Magento depends on cron for indexing (update by schedule), sending emails, generating sitemaps, currency rates, catalog price rules, cleaning up and processing message queues. A system cron job runs bin/magento cron:run every minute, which schedules and runs jobs defined in modules' crontab.xml files, grouped into cron groups.
20. How are message queues used in Magento?
Magento uses message queues, with RabbitMQ or the MySQL adapter, for asynchronous work such as bulk API operations, mass product updates, inventory reservations and exports. Publishers send messages to topics and consumers process them, configured in XML files, so heavy tasks do not slow down the admin or storefront.
21. What are declarative schema and data patches?
Answer flow · 3 steps
1
Declarative schema (db_schema.xml) describes the desired database structure, and Magento calculates the changes during setup:upgrade, replacing the older install and upgrade scripts.
2
Data patches are classes that run once to insert or change data, such as creating attributes or CMS blocks, and schema patches handle complex changes.
3
Patches can depend on other patches and be reverted.
22. What are service contracts and repositories?
Service contracts are PHP interfaces in a module's Api folder that define its public API: data interfaces describe entities and repository interfaces provide methods such as getById, save, delete and getList with search criteria. Other modules and web APIs use these interfaces instead of internal models, which keeps code stable across upgrades.
High level Magento interview questions
System design, deep internals, leadership and tough follow-ups.
23. How do you optimise Magento performance?
I run production mode with compiled code and deployed static content, use Varnish for full-page caching and Redis for cache and sessions, and use Elasticsearch or OpenSearch for catalogue search. I set indexers to update by schedule, use a CDN, merge and minify assets, profile slow pages with Blackfire or New Relic, and audit third-party extensions, which are a common source of slow queries.
24. How do you handle a Magento upgrade?
Answer flow · 3 steps
1
I check that the PHP version, services and every third-party extension support the target version, then upgrade on a staging copy with Composer.
2
I run setup:upgrade, recompile and redeploy static content, and fix custom code that uses deprecated APIs, using the Upgrade Compatibility Tool.
3
I run regression tests on checkout and key flows before upgrading production during a low-traffic window, with a backup ready.
25. How do Magento's APIs work for integrations?
Answer flow · 4 steps
1
Magento exposes REST, SOAP and GraphQL APIs based on service contracts.
2
Integrations authenticate with OAuth tokens, admin tokens or customer tokens, and access is controlled by ACL resources.
3
GraphQL is used by headless storefronts such as PWA Studio.
4
For high volumes I use bulk and asynchronous API endpoints backed by message queues.
26. Why choose Hyvä over the Luma frontend?
Answer flow · 3 steps
1
Luma loads large amounts of JavaScript (RequireJS, jQuery and Knockout) and CSS, which makes Core Web Vitals hard to pass.
2
Hyvä rebuilds the frontend with Alpine.js and Tailwind CSS, cutting the size of what loads dramatically and making development simpler, while keeping Magento's server-side rendering.
3
Third-party extensions need Hyvä compatibility modules, which most popular ones now offer.
27. What headless options exist for Magento?
Answer flow · 3 steps
1
Magento's GraphQL API supports headless storefronts.
2
Adobe's PWA Studio provides React components, and other options include Vue Storefront (Alokai), Next.js or Hydrogen-style custom frontends.
3
Headless gives frontend freedom and app-like speed but requires rebuilding features such as checkout, and extension compatibility through APIs must be checked.
28. How is Adobe Commerce Cloud deployed?
Adobe Commerce on cloud infrastructure uses Git-based deployments to integration, staging and production environments, with build and deploy phases configured in .magento.app.yaml and .magento.env.yaml, managed with the magento-cloud CLI. It includes Fastly CDN and WAF, New Relic monitoring, and managed services such as Redis, OpenSearch and RabbitMQ.
29. How do you secure a Magento store?
Apply security patches promptly, use two-factor authentication for the admin and a custom admin URL, restrict admin access by IP, use strong passwords and least-privilege roles, keep extensions updated and from trusted vendors, enable a web application firewall, use the content security policy module, scan with Magento's Security Scan tool, protect against card skimming with integrity checks and keep card data with PCI-compliant gateways.
30. How would you design a multi-store Magento setup at scale?
Use websites for different businesses, price scopes or customer bases, stores for different catalogues, and store views for languages, configuring scope carefully. Share infrastructure with separate caches and search indexes, use MSI for regional inventory, scale web nodes horizontally behind a load balancer with Varnish, Redis and OpenSearch, and move heavy jobs to queues and cron groups.
Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.