Questions

Magento 2 real certification questions

Which architectural pattern makes it possible?

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

A. Store Manager
B. Extension Attribute
C. Entity Attribute Value
D. Dependency Injection

How is the StoreManagerInterface resolved?

The constructor function for MagentoCatalogModelCategory contains this excerpt:

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

A. If no $storeManager is provided, Magento’s code generator creates a shell concrete class based on MagentoStoreModelStoreManagerInterface
B. Magento finds all classes that implement MagentoStoreModelStoreManagerInterface (ordered alphabetically) and injects the first class.
C. Magento looks to the di.xml files in the entire system for a preference node for MagentoStoreModelStoreManagerInterface. This class is constructed and injected
D. Magento throws an exception because you cannot instantiate an interface

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.)

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 MyCompanyMyModuleControllerAdminhtmlCustomEntityIndex

A. Register my_module route for the AdminRouter in MyCompany/MyModule/etc/adminhtml/di.xml
B. Create a new menu item in MyCompany/MyModule/etc/adminhtml/menu.xml
C. Specify the my_module/custom_entity URL using a @route annotation in the action controller execute() method
D. Register my_module route in MyCompany/MyModule/etc/adminhtml/routes.xml

Which mechanism do you use?

A custom module needs to log all calls of MagentoCustomerApiAddressRepositoryInterface::save().

A. An observer on the customer_address_repository_save event, which is automatically fired for every repository save
B. A proxy configured to intercept all calls to any public method and log them
C. An extension attribute configured in the extension_attributes.xml
D. A plugin declared for the save() method

How is this done?

You are tasked with ensuring customers who log into the site are authorized. By default, this consists of ensuring the customers email and password match the values in the database. On this project, you need to verify additional data in this process. Keeping in mind upgradeability, how is this done?

A. Create a before plugin for MagentoCustomerApiAccountManagementInterface’s authenticate method
B. Create a mutation of a CustomerInterface object to intercept the username and password
C. Create an event observer for the user_save_after observer
D. Override MagentoCustomerControllerAccountController.php

How is this implemented?

A merchant asks you to extend customer functionality to allow customer accounts to be associated with two or more billing addresses.

A. By adding the attribute like customer_address_billing2 and customizing both My Account and Checkout functionality to use that new attribute
B. By changing the System Configuration setting: Customer>Allow multiple billing addresses to Yes
C. By altering the customer_entity table, adding the field billing_address2, and customizing both My Account and Checkout functionality to use that new field
D. This is out-of-the box functionality

How do you specify the class that will process the uploaded file?

A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.

A. <upload_model>MagentoConfigModelConfigUploadFile</upload_model>
B. <frontend_model>MagentoConfigModelConfigFrontendFile</frontend_model>
C. <backend_model>MagentoConfigModelConfigBackendFile</backend_model>
D. <source_model>MagentoConfigModelConfigSourceFile</source_model>

How do you identify which REST endpoints are supported by the module?

A merchant gives you the module MyCompany_MyModule to install.

A. REST endpoints are declared in etc/webapi_rest/di.xml
B. Every public method of every interface in the Api folder automatically is exposed as a REST endpoint
C. REST endpoints are declared in etc/rest.xml
D. REST endpoints are declared in etc/webapi.xml