EMT Practice Test

1. Question Content...


Question List

Question1: You are trying to determine why a product is not appearing in a category. What table does Magento on the frontend to locate the relationship between a category and its products?

Question2: A merchant asks you to extend customer functionality to allow customer accounts to be associated with two or more billing addresses.
How is this implemented?

Question3: You have configured an event observer to watch the checkout_submit_all_after event using this XML:

What is the required class definition for the event observer?

Question4: You have been given the task of importing products from an external source. You decide to create a custom module to do this. The class handling the import creates a product for each record, sets the data on it and saves it to the database.
What do you inject into a constructor to represent each product you create?

Question5: The module MyCompany_MyModule will add a new page to the admin interface at the URL path admin/mycompany/entity_grid.
How do you name the file containing the action controller class so the admin router matches the path to the class?

Question6: You are reviewing a theme in app/design/frontend/MyCompany/MyTheme and see the file etc/view.xml.
What is the function of this file?

Question7: You have created a new section in system configuration under the Catalog tab:

How do you restrict an access to the section using Magento ACL?

Question8: How do you add a new link into the My Account sidebar?

Question9: You are reviewing a module to some special functionality to the Magento 2 application, You see directory
/CustomerData, What task you think in this directory contain script for this modules?

Question10: There is a custom extension called MyCompany_MyModule. It has the following layout customization declared in MyCompany/MyModule/view/frontend/layout/default.xml:
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template"
name="my.block"
template="MyCompany_MyModule::my_template.phtml"
cacheable="false"/>
</referenceContainer>
What will be the result of the customization?

Question11: You are tasked to install an extension to the merchant's Magento instance.
The extension is developed by the company called MyCompany and its codebase is available from all four locations listed below.
Which two installations options do you choose from to prevent version conflicts during upgrade? (Choose two.)

Question12: You are implementing a custom module MyModule, which provides an implementation of
\Psr\Log\LoggerInterface called \MyCompany\MyModule\Logger.
The LoggerInterface has the default preference declared in app/etc/di.xml.
Keeping upgradability in mind, how do you make \MyCompany\MyModule\Logger the default implementation of the LoggerInterface globally?

Question13: You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml Which two actions are required to ensure the new plugin will execute last? (Choose two.)

Question14: What happens when a category's is_anchor attribute is set to 1?

Question15: Magento allows you to specify custom values per store for product attributes created in the admin panel.
Which architectural pattern makes it possible?

Question16: The constructor function for \Magento\Catalog\Model\Category contains this excerpt:

With the automatic dependency injection that Magento provides, how is the StoreManagerInterface resolved?

Question17: The module MyCompany_MyModule provides custom admin interface pages.
Access to these pages should only be granted to specific users.
You add the required configuration to the module's acl.xml file, but the setting does not seem to work as expected.
How do you visually check if Magento evaluates your ACL resource as expected?

Question18: A merchant gives you the module MyCompany_MyModule to install.
How do you identify which REST endpoints are supported by the module?

Question19: You need to find all orders in the processing state. You have written the code:

When you run the code, you get the following exception:

How do you resolve the exception?

Question20: A merchant gives you the module MyCompany_MyModule to install.
How do you identify which REST endpoints are supported by the module?

Question21: A custom module is performing an optimized custom query for quote items. The class applies the query customizations on the select object of a quote item collection instance.

You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module. How do you resolve the issue, keeping maintainability in mind?

Question22: What order operation is available in the My Account section in the storefront?

Question23: A merchant sells shoes with multiple variations such as a color and size. A shoe is represented by a configurable product. There are seven different colors and four sizes.
What is the minimal amount of simple products that represent a combination of color and size needs to be created in order to make a shoe salable?

Question24: What is the connection between product attribute sets and categories?

Question25: You have created a new block and will be adding this block on every page. The block contains user-specific information and cannot be cached. The block is added to the default.xml with:

What does this accomplish?

Question26: You are writing a customization for the customer module. You need to make sure the configuration files from your module are loaded after the customer module's configuration.
Where should the dependency be declared?

Question27: You are working on a project that contains a million SKUs. The merchant has requested the product view page to have a custom color schema and page layout depending on the product price range.
How do you implement this, keeping simplicity in mind?

Question28: You want to remove a column introduced by a third-party extension via declarative schema.
How do you do that?

Question29: You are adding a new entry to the backend menu that appears after
Marketing > SEO & Search > Site Map
You see the existing site map menu item is declared by the node:

What two actions do you take to configure the new menu entry location? (Choose two.)

Question30: Your module adds a new controller class which will return a JSON response.
What will be the return type of the execute method?

Question31: You are building a new module to add extra functionality to the Magento application.You want to works with CustomerData the data stored on the client side. Where initialized sections Cart and Directory-data are on the server side via the classes?

Question32: You are working on a custom web API endpoint and have configured it in etc/webapi.xml. This config is cached as part of the config_webservice cache type.
Keeping performance in mind, how do you refresh the cached version of this config using Magento CLI?

Question33: Which two ways does Magento persist category relationships in the database? (Choose two.)

Question34: You have created a module controller that responds to the following URL: /mycompany/product/load/id/123.
Which two methods will load the product model by ID as specified in the URL? (Choose two.)

Question35: You have created a custom module which must perform an action immediately after an order is placed, but only on the store front of the merchant site. You have selected the checkout_submit_all_after as the target event which the module will observe.
In which file will the event observer be declared?

Question36: In a code review of a merchant's site you have discovered that there are multiple observers for the checkout_submit_all_after event. After closer inspection, you notice one of these observers is relying on the others being executed before it is called.
What risk does this pose, and how can it be mitigated?

Question37: Which entity in Magento supports scoped attributes?

Question38: You are working on a jewelry store that sells rings. Each ring allows an adjustment in size. The customer specifies finger size in inches and the merchant physically adjusts the stocked ring to the required size.
How is this represented in Magento?

Question39: You need to render a product attribute's raw value as a variable in a script tag. This value will be used to initialize an application on the frontend. How do you render this value?

Question40: You are adding a new menu item to the admin backend which will link to a custom backend page.
The declaration of the route:

What do you specify as the menu item action attribute value so it links to /admin/mycompany/mymodule/?

Question41: You are debugging a problem resulting from a recently deployed around plugin. The plugin is intercepting the doSomething method. The aroundDoSomething plugin method is called successfully, but the original doSomething method is no longer being executed as expected.
What is causing this?

Question42: The module MyCompany_MyModule will add a new page in the admin interface to display a custom entity in a grid.
You created a controller for this grid \MyCompany\MyModule\Controller\Adminhtml\CustomEntity\Index Which two actions are required to make the new page accessible at the
https://your.store.base.url/admin/my_module/custom_entity URL? (Choose two.)

Question43: You are facing a bug, which is supposedly caused by the customization of
\Magento\Catalog\Api\ProductRepositoryInterface::save().
To resolve the issue, you decide to find all logic which customizes this method. Which two places do you search for customization declarations? (Choose 2)

Question44: A Magento industry partner shipping provider has tasked you to build their integration module called MyCompany_ShippingProvider.
Where do you define the class that provides options for the select field that enables or disables the provider in the file etc/adminhtml/system.xml?

Question45: Where do you change the frontName for the admin router?