First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Adobe Commerce architecture and development fundamentals
In Adobe Commerce, which file is the primary XML configuration used to declare a module and its dependencies?
- etc/module.xml Correct answer.
- etc/di.xml
- etc/config.xml
- etc/events.xml
Explanation
A module's identity and load order are declared in etc/module.xml via the <module> element and its <sequence> child, which lists modules that must load first. Other etc XML files configure areas such as DI preferences, events, or default config values.
Question 2Adobe Commerce architecture and development fundamentals
Which directory in a module contains its PHP classes under the Adobe Commerce PSR-4 autoloading convention?
- Block Correct answer.
- Setup
- Model
- etc
Explanation
In the standard Magento\{Vendor}\{Module}\ namespace, PHP classes live under the module's root namespace mapped to its base directory, with subfolders such as Block, Model, and Controller. Block holds block classes; Model holds models; etc holds configuration.
Question 3Adobe Commerce architecture and development fundamentals
Which design pattern does Adobe Commerce's object manager implement for resolving class dependencies?
- Active record
- Service locator only
- Singleton registry
- Dependency injection Correct answer.
Explanation
The object manager constructs objects and injects their constructor dependencies, which is dependency injection. It also consults di.xml preferences and virtual types when resolving a requested type.
Question 4Adobe Commerce architecture and development fundamentals
What is the purpose of a preference node in di.xml?
- To map a requested interface or class to a concrete implementation Correct answer.
- To declare an observer for a dispatched event
- To define a database table schema
- To register a new CLI command
Explanation
A <preference for="..." type="..."/> node tells the object manager which concrete class to instantiate when a given interface or class is requested. This is the standard way to swap implementations without changing consumer code.
Question 5Adobe Commerce architecture and development fundamentals
Which XML file declares a module's database table structure in the declarative schema system?
- etc/di.xml
- etc/schema.xml
- etc/db_schema.xml Correct answer.
- Setup/InstallSchema.php
Explanation
Declarative schema defines tables, columns, indexes, and constraints in etc/db_schema.xml, and Adobe Commerce compares it to the current database to generate changes. InstallSchema.php belongs to the older setup script approach.
Question 6Adobe Commerce architecture and development fundamentals
Which layout file type defines the page structure for a specific route and controller action?
- A requirejs-config.js file in view/frontend
- A layout XML file such as route_id.xml in view/frontend/layout Correct answer.
- A template .phtml file in view/frontend/templates
- A UI component XML file in view/frontend/ui_component
Explanation
Layout XML files named after the route, controller, and action (for example catalog_product_view.xml) declare blocks, containers, and arguments for that page. Templates render markup, while UI component XML defines component configuration.
Question 7Adobe Commerce architecture and development fundamentals
Which area is used when Adobe Commerce renders storefront pages for customers?
- adminhtml
- frontend Correct answer.
- webapi_rest
- crontab
Explanation
The frontend area loads layout, templates, and configuration used to serve storefront requests. The adminhtml area serves the admin panel, and webapi_rest serves REST API calls.
Question 8Adobe Commerce architecture and development fundamentals
What does the etc/module.xml sequence node control?
- The list of modules disabled at runtime
- The version number of the module
- The list of observers registered by the module
- The order in which modules are loaded Correct answer.
Explanation
The <sequence> node lists modules that must be loaded before the current module, establishing load order for configuration merging. It does not enable or disable modules or set version numbers.
Question 9Adobe Commerce architecture and development fundamentals
A developer needs to replace a core class with a custom implementation for all consumers. Which mechanism should be used?
- A plugin declared in di.xml
- A preference declared in di.xml Correct answer.
- An observer declared in events.xml
- A virtual type declared in di.xml
Explanation
A preference maps an interface or class to a different concrete type globally, so every consumer requesting that type receives the custom class. Plugins intercept method calls but do not change which class is instantiated.
Question 10Adobe Commerce architecture and development fundamentals
Which file is used to declare a plugin that intercepts a method on a specific class?
- etc/module.xml
- etc/routes.xml
- etc/di.xml Correct answer.
- etc/events.xml
Explanation
Plugins are declared inside di.xml using a <plugin> node with the target type, plugin name, and plugin class. The interceptor framework then wraps calls to the target method.
Question 11Adobe Commerce architecture and development fundamentals
What is the effect of a plugin using beforeBefore on a target method?
- It modifies the arguments before the original method runs Correct answer.
- It can prevent the original method from running
- It modifies the return value after the original method runs
- It runs after every other plugin on the method
Explanation
A before-prefixed plugin method receives the original arguments and returns modified arguments that are passed to the observed method. Around plugins handle both argument modification and skipping; after plugins modify return values.
Question 12Adobe Commerce architecture and development fundamentals
Which observer declaration correctly targets an event named my_event in the frontend area?
- An <event name="my_event"> node in etc/events.xml with an observer instance Correct answer.
- A <plugin name="my_event"> node in etc/di.xml
- A <preference for="my_event"> node in etc/di.xml
- An <event name="my_event"> node in etc/module.xml
Explanation
Observers are declared in etc/events.xml (or an area-specific events.xml) using an <event> node containing an <observer> with its instance class. The event name must match the name passed to the event manager dispatcher.
Question 13Adobe Commerce architecture and development fundamentals
What is the main difference between a virtual type and a regular class in di.xml?
- A virtual type is a plugin that runs before instantiation
- A virtual type is a configured instance of an existing class that requires no PHP file Correct answer.
- A virtual type is a database view generated from schema
- A virtual type is a PHP class that extends the object manager
Explanation
A virtual type is declared with <virtualType> and references an existing type while overriding constructor arguments, so it needs no corresponding PHP class. It lets developers create differently configured instances of the same class.
Question 14Adobe Commerce architecture and development fundamentals
Which file declares the routes a module exposes for frontend requests?
- etc/acl.xml
- etc/routes.xml Correct answer.
- etc/system.xml
- etc/webapi.xml
Explanation
Frontend and admin routes are declared in etc/routes.xml with a <route> node specifying the route id, frontName, and module. The frontName becomes the URL prefix that maps to the module's controllers.
Question 15Adobe Commerce architecture and development fundamentals
A controller action class in a module is placed in which location to be discovered for the frontend area?
- Block/Controller/Index.php in the module root
- Controller/Frontend/Index.php in the module root
- Model/Controller/Index.php in the module root
- Controller/Index/Index.php in the module root Correct answer.
Explanation
Frontend controller actions follow the Controller/{ControllerName}/{ActionName}.php convention in the module root, matching the route's controller and action segments. The class extends the appropriate action base class and implements execute().
Question 16Adobe Commerce architecture and development fundamentals
What does a block's template property in layout XML specify?
- The .phtml file rendered by the block Correct answer.
- The PHP class of the block
- The cache lifetime of the block
- The area in which the block loads
Explanation
The template argument points to the .phtml file, relative to the module's view/{area}/templates directory, that the block renders. The block class itself is set with the class attribute.
Question 17Adobe Commerce architecture and development fundamentals
Which mechanism allows a module to add a new column to an existing table without writing imperative SQL?
- Adding the column in an InstallData.php script
- Creating a plugin on the table save method
- Editing the core module's Setup script
- Declaring the column in etc/db_schema.xml for the existing table Correct answer.
Explanation
Declarative schema lets a module declare additions to existing tables in its own etc/db_schema.xml, and the schema comparison generates the ALTER statement. This avoids editing core files or writing manual SQL.
Question 18Adobe Commerce architecture and development fundamentals
Which XML file maps a URL path to a REST endpoint for a module?
- etc/di.xml
- etc/events.xml
- etc/routes.xml
- etc/webapi.xml Correct answer.
Explanation
REST and SOAP service contracts are declared in etc/webapi.xml, which maps a URL to a service interface method and lists the resources allowed to call it. Frontend page routes use routes.xml instead.
Question 19Adobe Commerce architecture and development fundamentals
Which caching layer in Adobe Commerce stores fully rendered HTML for cacheable pages?
- The full page cache Correct answer.
- The block cache
- The translation cache
- The configuration cache
Explanation
The full page cache stores rendered responses for cacheable pages so repeat requests are served without rebuilding layout and blocks. Block cache and configuration cache operate at different layers.
Question 20Adobe Commerce architecture and development fundamentals
What is the purpose of the etc/frontend/di.xml file in a module?
- To declare frontend routes
- To declare DI configuration that applies only in the frontend area Correct answer.
- To register frontend observers for all areas
- To define frontend layout handles
Explanation
Area-specific di.xml files such as etc/frontend/di.xml are merged only when the object manager runs in that area, allowing area-specific preferences, plugins, and virtual types. Global di.xml applies to all areas.
Question 21Adobe Commerce architecture and development fundamentals
A developer writes a plugin with an around method that never calls the proceed callback. What is the result?
- The original method body is skipped and the plugin's return value is used Correct answer.
- A fatal error is thrown at compile time
- The plugin is ignored and the original method runs normally
- The original method runs twice
Explanation
An around plugin receives a callable that invokes the next plugin or the original method. If the plugin returns without calling that callable, the original method never runs and the plugin's return value becomes the result.
Question 22Adobe Commerce architecture and development fundamentals
How does Adobe Commerce resolve the order in which multiple plugins declared for the same method execute?
- By the sortOrder attribute, with lower values executing first Correct answer.
- By the order the modules appear in the filesystem
- By alphabetical order of the plugin class names
- By the area in which the plugin is declared
Explanation
Plugins on the same method are sorted by their sortOrder attribute, and lower values run earlier in the interception chain. When sortOrder is equal, declaration order across merged configuration determines the sequence.
Question 23Adobe Commerce architecture and development fundamentals
Which statement best describes how the object manager treats a shared (singleton) instance by default?
- It creates a new instance every time the type is requested
- It returns the same instance for repeated requests of the same type within a request Correct answer.
- It stores instances in the database between requests
- It disables plugins on the returned instance
Explanation
By default the object manager caches created objects as shared instances, so repeated get() calls for the same type return the same object during a request. Non-shared behavior must be configured explicitly for specific types.
Question 24Adobe Commerce architecture and development fundamentals
A module needs to change a constructor argument of a class only when it is used in the adminhtml area. Where should the argument be modified?
- In the module's etc/db_schema.xml
- In the module's etc/module.xml
- In the module's etc/adminhtml/di.xml Correct answer.
- In the global etc/di.xml
Explanation
Constructor arguments are configured in di.xml, and area-specific files like etc/adminhtml/di.xml apply only in that area. Placing the change in global di.xml would affect every area, which is broader than required.
Question 25Adobe Commerce architecture and development fundamentals
Which combination correctly describes how layout and templates interact during page rendering?
- Layout XML generates PHP classes for each template
- Templates declare blocks, and layout XML renders the final HTML
- Blocks are generated from templates at compile time
- Layout XML declares blocks and containers, and each block renders its assigned template Correct answer.
Explanation
Layout XML defines the block and container hierarchy and sets arguments such as template and class. During rendering, each block produces output by rendering its template, and containers assemble child block output into the page.
Question 26Adobe Commerce architecture and development fundamentals
Which file in a module is used to declare a new CLI command's class so that Adobe Commerce registers it?
- etc/di.xml Correct answer.
- registration.php
- etc/commands.xml
- etc/module.xml
Explanation
CLI commands are registered as types/arguments in the module's dependency injection configuration, typically etc/di.xml, where the command class is added to the Magento\Framework\Console\CommandList argument. This is the standard declarative mechanism for exposing commands.
Question 27Adobe Commerce architecture and development fundamentals
In Adobe Commerce, what is the primary role of a ViewModel class referenced from a block's layout arguments?
- It replaces the block instance in the layout at render time.
- It renders the HTML template file directly.
- It caches the block output for the current request.
- It supplies presentation logic and data to a template without extending the block class. Correct answer.
Explanation
A ViewModel is a plain class passed into a template via a block argument, letting templates call methods for presentation logic while keeping the block class free of that logic. It does not extend or replace the block.
Question 28Adobe Commerce architecture and development fundamentals
Which directory in a module contains the PHP classes that are autoloaded under the module's namespace by convention?
- Block Correct answer.
- view
- Controller
- etc
Explanation
Module PHP classes live under the module's root directory and are mapped to the module namespace via PSR-4 autoloading declared in composer.json. Block classes conventionally sit in a Block directory, and other class directories follow the same namespace-to-path convention.
Question 29Adobe Commerce architecture and development fundamentals
What does the setup_version attribute historically declared in etc/module.xml control?
- The version of the module's database schema and data setup scripts. Correct answer.
- The version of the composer package that contains the module.
- The PHP version required to run the module.
- The Magento framework version the module requires.
Explanation
The setup_version attribute tracked the module's setup scripts so the framework knew which schema and data patches had been applied. Modern Adobe Commerce versions use declarative schema and the setup_module table instead, but the attribute's purpose was setup script versioning.
Question 30Adobe Commerce architecture and development fundamentals
A developer wants to add a new method to a class that already exists in a module without editing the original file. Which approach fits the Adobe Commerce extension model?
- Override the class by copying it into the app/code directory under the same class name.
- Use a plugin to add the method through interception.
- Declare a virtual type that adds the method at runtime.
- Create a preference that points the class to a subclass containing the new method. Correct answer.
Explanation
Preferences replace the implementation used for a class, so a subclass can add methods and existing consumers resolve to the subclass. Plugins intercept existing methods but cannot introduce new public methods on the original class.
Question 31Adobe Commerce architecture and development fundamentals
Which statement describes how an interceptor generated for a plugin delegates to the next plugin in the chain when the original method is called?
- Plugins are executed by the event manager after the original method returns.
- Each interceptor calls the next interceptor's method, and the last one invokes the original method. Correct answer.
- Only the plugin with the highest sortOrder executes; the others are skipped.
- The object manager invokes all plugins in parallel and merges their return values.
Explanation
Adobe Commerce generates an interceptor class per target method that chains plugins by sort order; each interceptor calls the next, and the final link calls the original method. This chaining is what allows around plugins to wrap the whole chain.
Question 32Adobe Commerce architecture and development fundamentals
Which mechanism should a developer use to pass a runtime value into a block's template from layout XML without writing PHP in the block class?
- Add an <argument> node with a value to the block declaration in layout XML. Correct answer.
- Create a new store configuration field for the value.
- Declare the value in etc/config.xml.
- Add the value to the module's composer.json extra section.
Explanation
Layout XML supports argument nodes on block declarations, and those arguments are injected into the block at generation time and become available to the template. This avoids hardcoding values in PHP or requiring new configuration.
Question 33Adobe Commerce architecture and development fundamentals
A developer needs to run custom logic whenever an order is placed, regardless of which area triggers the placement. Which declaration should be used?
- An observer declared in etc/frontend/events.xml
- An observer declared in etc/events.xml Correct answer.
- A cron job declared in etc/crontab.xml
- A plugin on the order repository declared in etc/di.xml
Explanation
etc/events.xml is the global area configuration, so observers declared there fire for events dispatched in any area, including adminhtml and cron. Area-specific events.xml files restrict the observer to that area.
Question 34Adobe Commerce architecture and development fundamentals
Which file type is used to define a new database table declaratively in modern Adobe Commerce?
- A data patch class in Setup/Patch/Data
- A PHP install script in Setup/InstallSchema.php
- A schema declaration XML file in etc/db_schema.xml Correct answer.
- A recurring script in etc/di.xml
Explanation
Declarative schema uses etc/db_schema.xml to describe tables, columns, indexes, and constraints, and the framework generates and applies the SQL. This replaces the older imperative install and upgrade scripts.
Question 35Adobe Commerce architecture and development fundamentals
A developer wants a class to receive a different implementation of an interface only within the adminhtml area. Where should the preference be declared?
- etc/frontend/di.xml
- etc/webapi.xml
- etc/di.xml
- etc/adminhtml/di.xml Correct answer.
Explanation
Area-specific di.xml files such as etc/adminhtml/di.xml apply their preferences only when the object manager runs in that area. Declaring it in the global etc/di.xml would affect every area.
Question 36Adobe Commerce architecture and development fundamentals
What is the purpose of a repository interface paired with a getList method returning a search results object in a module?
- It generates the database schema for the entity's table.
- It validates entity data before it is persisted.
- It provides a service contract for reading entities with filtering, sorting, and pagination. Correct answer.
- It caches entity data in the default cache for later requests.
Explanation
Service contracts expose business logic through interfaces, and getList with a SearchCriteria object supports filtering, sorting, and pagination for entity retrieval. This decouples callers from the persistence implementation.
Question 37Adobe Commerce architecture and development fundamentals
Which statement best describes the difference between a proxy and a factory in the Adobe Commerce object manager?
- A proxy creates a new instance per request, while a factory returns a lazy reference.
- A proxy and a factory are identical and differ only in naming convention.
- A proxy returns a shared singleton, while a factory returns the same cached instance.
- A proxy defers instantiation of a slow dependency until it is used, while a factory creates a new instance each time it is requested. Correct answer.
Explanation
Injected proxies are lightweight stand-ins that instantiate the real class only when a method is first called, useful for heavy dependencies. Factories, by contrast, are generated classes whose create method returns a fresh instance on each call.
Question 38Adobe Commerce architecture and development fundamentals
A module declares a dependency on another module in etc/module.xml sequence. What does this affect?
- The database tables created by the dependent module.
- The list of modules shown in the admin configuration.
- Whether the dependent module can be disabled.
- The order in which the modules' configuration and setup are loaded. Correct answer.
Explanation
The sequence node declares load-order dependencies so that the listed module's configuration and setup are processed before the declaring module. It does not enable or disable modules or control their schema.
Question 39Adobe Commerce architecture and development fundamentals
Which caching configuration is required for a block's rendered output to be stored in the full page cache?
- The block must be listed in env.php under cache types.
- The block must implement a custom serializer interface.
- The block must be declared cacheable in its layout declaration and avoid uncacheable child blocks. Correct answer.
- The block must extend a specific cacheable block class.
Explanation
Full page cache stores rendered pages for blocks marked cacheable in layout, provided the page contains no uncacheable blocks that would force a hole-punch. Cacheability is thus a layout-level declaration, not a class requirement.
Question 40Adobe Commerce architecture and development fundamentals
A developer needs to modify the behavior of a final method on a class. Which statement is accurate?
- Plugins can intercept final methods only in the adminhtml area.
- Plugins can intercept final methods if a preference is also declared.
- Plugins cannot intercept final methods, so the class must be replaced or refactored. Correct answer.
- Plugins can intercept final methods as long as the plugin method is public.
Explanation
Interceptor generation relies on subclassing the target, so final methods cannot be wrapped by plugins in any area. The supported alternatives are replacing the class through a preference or changing the original code.
Question 41Adobe Commerce setup and configuration
In Adobe Commerce, which file is the primary place to define a module's dependencies on other modules and its version number?
- module.xml
- di.xml
- composer.json Correct answer.
- registration.php
Explanation
A module's composer.json declares its name, version constraints, and require entries for other modules, and the module loader reads these to order loading. registration.php only registers the module with the component registrar.
Question 42Adobe Commerce setup and configuration
Which command applies pending declarative schema changes and data patches to the database in a standard Adobe Commerce installation?
- bin/magento setup:static-content:deploy
- bin/magento cache:flush
- bin/magento setup:upgrade Correct answer.
- bin/magento setup:di:compile
Explanation
setup:upgrade runs module schema and data install/upgrade scripts, applies declarative schema changes, and executes data patches. It is the standard step after enabling a module or changing db_schema.xml.
Question 43Adobe Commerce setup and configuration
A developer wants a custom module to load after Magento_Catalog so its preferences can override catalog behavior. Which mechanism in the module configuration declares this ordering?
- The setup_version attribute in composer.json
- A plugin declared in etc/frontend/di.xml
- A <preference> node in di.xml
- The sequence node in etc/module.xml Correct answer.
Explanation
The <sequence> element inside etc/module.xml lists modules that must be loaded before the current module, which controls load order and therefore override precedence. Preferences only take effect once load order is correct.
Question 44Adobe Commerce setup and configuration
Which file declares a new module to the Adobe Commerce component registrar so the application recognizes it at all?
- composer.json
- etc/di.xml
- registration.php Correct answer.
- etc/module.xml
Explanation
registration.php calls the component registrar to register the module's name and type with the framework. Without it the module is not discovered, regardless of its other configuration files.
Question 45Adobe Commerce setup and configuration
In which configuration scope can a store-view-specific value for a store configuration field be set?
- Store view and global
- Global only
- Store view only
- Website and store view Correct answer.
Explanation
Adobe Commerce configuration scopes are default (global), website, and store view. A field marked showInWebsite and showInStore can be overridden at website and store view scope, with store view taking precedence.
Question 46Adobe Commerce setup and configuration
A merchant needs a value that differs per website but should fall back to a single default elsewhere. Which configuration scope arrangement achieves this with the least duplication?
- Set the default value globally and override at website scope for the differing website Correct answer.
- Set the value in env.php for each website code
- Set the value only at website scope for all websites
- Set the value at store view scope for every store view
Explanation
Configuration inherits from global to website to store view. Setting a global default and overriding only the affected website avoids duplicating values across every store view.
Question 47Adobe Commerce setup and configuration
Which deployment mode should be used in production because it pre-generates and does not check for file changes at runtime?
- production Correct answer.
- developer
- default
- maintenance
Explanation
Production mode uses pre-generated DI and static files and does not perform on-the-fly generation or change detection, which improves performance and safety. Developer mode generates files dynamically for development.
Question 48Adobe Commerce setup and configuration
What is the purpose of the env.php file in an Adobe Commerce installation?
- It defines the layout XML for CMS pages
- It maps interfaces to concrete classes for dependency injection
- It stores deployment-specific settings such as database credentials and cache hosts Correct answer.
- It declares module dependencies and version constraints
Explanation
app/etc/env.php holds environment and deployment configuration like database connection details, cache and session backends, and crypt keys. It is environment-specific and should not be committed with secrets.
Question 49Adobe Commerce setup and configuration
A developer needs to override a core class with a custom implementation for an interface. Which di.xml element accomplishes this?
- <type>
- <virtualType>
- <plugin>
- <preference> Correct answer.
Explanation
A <preference> node maps an interface or class to a concrete implementation, replacing the default globally. Virtual types and plugins serve different purposes such as configuring object variants or intercepting methods.
Question 50Adobe Commerce setup and configuration
Which type of cache in Adobe Commerce stores fully rendered HTML for pages and must be refreshed after content changes?
- Configuration cache
- Block HTML cache
- Layout cache
- Full page cache Correct answer.
Explanation
Full page cache stores rendered page output to serve subsequent requests quickly, and it must be invalidated or cleaned when content changes. Other caches store configuration, layout structures, or block output fragments.