Adobe Commerce Interview Questions and Answers (2026 Updated)
Adobe Commerce (Magento 2) Interview Questions with Answers for Developers
Dependency Injection (DI)
Q1: What is Dependency Injection?
A design pattern where dependencies are injected via constructor instead of created manually.
Q2: Which file configures DI?
di.xml file.
Q3: What is preference?
Used to override a class or interface globally.
Q4: What is virtualType?
Used to change constructor arguments without modifying original class.
Q5: What is shared="false"?
Creates a new instance every time.
Q6: What is Object Manager?
Magento’s dependency injection container.
Q7: Should Object Manager be used directly?
No, except in rare cases.
“We avoid direct ObjectManager usage because it breaks dependency injection principles, reduces testability, hides dependencies, and creates tightly coupled code. Constructor dependency injection is the recommended Magento approach.”
Q8: What is constructor injection?
Injecting dependencies via constructor.
Q9: What is factory?
Used to create new instances dynamically.
Q10: What is proxy?
Used for lazy loading heavy classes.
Plugins (Interceptors)
Q11: What is a plugin?
Allows modification of public methods without overriding.
Q12: Types of plugins?
before, after, around.
Q13: before plugin?
Executes before original method.
Q14: after plugin?
Executes after method.
Q15: around plugin?
Wraps method and controls execution.
Q16: What is $proceed?
Calls original method.
Q17: If $proceed not called?
Original method will not execute.
Q18: What is sortOrder?
Defines plugin execution order.
Q19: Can plugins modify return value?
Yes.
Q20: Plugin limitation?
Cannot be applied on private/final methods.
Events & Observers
Q21: What is event?
A trigger point in Magento.
Q22: What is observer?
Executes logic when event is fired.
Q23: File for events?
events.xml
Q24: Custom event?
Use dispatch method.
Q25: Plugin vs Observer?
Plugin modifies methods, observer listens to events.
Q26: Can multiple observers exist?
Yes.
Q27: Can observer stop execution?
No.
Q28: Event payload?
Data passed with event.
Q29: Event scope?
Global, frontend, adminhtml.
Q30: Performance?
Observers are lighter than plugins.
Service Contracts
Q31: What is service contract?
Set of interfaces for APIs.
Q32: Repository?
Handles CRUD operations.
Q33: Data interface?
Defines getters/setters.
Q34: Why service contracts?
For API stability.
Q35: Extension attributes?
Used to extend data interfaces.
Q36: SearchCriteria?
Used to filter collections.
Q37: get() vs getList()?
get() returns single, getList() returns multiple.
Q38: API interface?
Defines contract for service.
Q39: REST API?
HTTP-based API.
Q40: SOAP API?
XML-based API.
Database & Models
Q41: Model?
Represents data.
Q42: ResourceModel?
Handles DB operations.
Q43: Collection?
Fetches multiple records.
Q44: load()?
Loads single record.
Q45: save()?
Saves data to DB.
Q46: entity_id?
Primary key.
Q47: CRUD?
Create, Read, Update, Delete.
Q48: Schema patch?
Used for DB structure changes.
Q49: Data patch?
Used for data changes.
Q50: Declarative schema?
XML-based DB structure management.
EAV Model
Q51: What is EAV?
Entity Attribute Value model.
Q52: Used for?
Products, customers.
Q53: Attribute?
Property of entity.
Q54: backend_type?
Defines storage type.
Q55: Attribute set?
Group of attributes.
Q56: Value table?
Stores attribute values.
Q57: Static attribute?
Stored in main table.
Q58: Dynamic attribute?
Stored in value table.
Q59: EAV advantage?
Flexibility.
Q60: Disadvantage?
Complex queries.
Layout & UI
Q61: Layout XML?
Defines page structure.
Q62: Block?
PHP class for UI logic.
Q63: Container?
Holds blocks.
Q64: Template?
PHTML file.
Q65: referenceBlock?
Modify existing block.
Q66: UI component?
JS-based UI system.
Q67: Knockout.js?
Used for data binding.
Q68: Handle?
Layout identifier.
Q69: XML merging?
Combines layout files.
Q70: Override layout?
Use custom XML.
Indexing & Cache
Q71: Indexer?
Improves query performance.
Q72: Cache?
Stores data for speed.
Q73: Full page cache?
Caches full HTML page.
Q74: Cache types?
Config, layout, block, full_page etc.
Q75: Cache flush?
Clears all cache.
Q76: Cache clean?
Clears selected cache.
Q77: Reindex?
Rebuild index tables.
Q78: Cache invalidation?
Marks cache outdated.
Q79: Index vs Cache?
Index optimizes DB, cache stores output.
Q80: Performance?
Both improve speed.
CLI & Deployment
Q81: setup:upgrade?
Runs DB updates.
Q82: di:compile?
Generates DI classes.
Q83: static-content deploy?
Deploys frontend assets.
Q84: production mode?
Optimized performance mode.
Q85: developer mode?
Debugging mode.
Q86: maintenance mode?
Disables frontend access.
Q87: env.php?
Environment config.
Q88: config.php?
Module config.
Q89: cron?
Scheduled tasks.
Q90: run cron?
bin/magento cron:run
Miscellaneous
Q91: module.xml?
Defines module.
Q92: registration.php?
Registers module.
Q93: routes.xml?
Defines routes.
Q94: webapi.xml?
Defines APIs.
Q95: system.xml?
Admin config.
Q96: ACL?
Access control.
Q97: GraphQL?
Query-based API.
Q98: Message Queue?
Async processing.
Q99: RequireJS?
JS module loader.
Q100: Theme inheritance?
Extending themes.
Q101: Magento 2 Request Flow (Frontend Request Lifecycle)
Magento request starts from pub/index.php, bootstrap initializes the framework, FrontController dispatches request through routers to controller action, controller interacts with service/model layer, layout system renders blocks and templates, response is cached and returned to browser.
Browser ↓ Apache/Nginx ↓ pub/index.php ↓ Bootstrap ↓ Object Manager ↓ App\Http ↓ FrontController ↓ Routers ↓ Controller Action ↓ Service Layer / Models ↓ Layout XML Merge ↓ Blocks ↓ PHTML Templates ↓ HTML Response ↓ Cache ↓ Browser
Q102: Constructor DI in Magento 2?
Constructor DI in Magento 2 injects dependencies automatically through Object Manager based on type hints and di.xml configuration.
Q103: Preference in Magento 2?
Preference in Magento 2 is a dependency injection mechanism used to globally override or replace a class/interface implementation with a custom class through di.xml.
Plugins are generally preferred over preferences because preferences completely replace the class behavior globally.
Q104: Virtual Types?
Virtual Types are lightweight dependency injection configurations used to reuse a class with modified dependencies, improving flexibility and reducing unnecessary class inheritance.
Virtual Types do not create physical PHP classes; they only exist in Magento’s DI configuration layer.
Q105: Proxy in Magento 2?
Proxy in Magento 2 is a lazy-loading mechanism that delays the instantiation of heavy objects until they are actually needed.
Proxies improve performance and reduce memory consumption by replacing expensive dependencies with lightweight generated classes that initialize the real object only on first usage.
Q106: Mview in Magento 2?
MView (Materialized View) in Magento 2 is a change-tracking mechanism used for incremental indexing, where database triggers capture entity changes and update indexers asynchronously.
MView enables partial reindexing by monitoring database table changes through changelog tables, improving performance compared to full reindex operations.
Entity Table Change ↓ MySQL Trigger ↓ *_cl (changelog table) ↓ Indexer Reads Changes ↓ Partial Reindex