Pass the Magento Magento Certified Developer Magento-2-Certified-Associate-Developer Questions and answers with CertsForce

Viewing page 1 out of 3 pages
Viewing questions 1-10 out of questions
Questions # 1:

You are adding a child node to the product.info block using the XML:

Question # 1

How will this block be rendered?

Options:

A.

Child block nodes are automatically rendered as HTML


B.

By calling $block->getChildHtml(‘mynewblock’) in the parent block’s template


C.

The layout is invalid since block elements cannot be nested


D.

Automatically if the block class Custom implements the _toHtml method


Expert Solution
Questions # 2:

While developing a module you need to modify an existing Data Patch.

How can you force Magento to execute an existing Data Patch file again?

Options:

A.

By removing the Data Patch, running the command: bin/magento setup:db-data:upgrade, then copying the file back and running the command again


B.

By deleting the record with the Data Patch class name from the table patch_list table


C.

By changing the version of the Data Patch in the getVersion method


D.

By modifying the data_version value in the setup_module table


Expert Solution
Questions # 3:

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?

Options:

A.

Create a before plugin for \Magento\Customer\Api\AccountManagementInterface’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 \Magento\Customer\Controller\AccountController.php


Expert Solution
Questions # 4:

A module declares the route:

Question # 4

What is the layout handle of the storefront path /custom/feature/?

Options:

A.

mymodule_feature


B.

custom_feature


C.

mymodule_feature_index


D.

custom_feature_index


Expert Solution
Questions # 5:

You got a notification about error that occurred on a production environment. The merchant gave you the error identifier.

How do you find the error message based on the identifier?

Options:

A.

An error is written to the var/log/exception.log file including the identifier


B.

The error is sent to the pre-configured error email with the identifier in the subject


C.

A file with a name matching the identifier is written to the var/report folder


D.

An error message is written to the database table error_log with an error_id field matching the identifier


Expert Solution
Questions # 6:

How do you add a foreign key to an existing table created by another module?

Options:

A.

Create etc/db_schema.xml file with the table node and constraint child node


B.

Run the command bin/magento setup:db-schema:upgrade <title>


C.

This can only be done with raw SQL in a Schema Patch file


D.

Create the etc/db_constraints.xml file and specify foreign key there in the constraint node


Expert Solution
Questions # 7:

Products may be accessed using SEO friendly URLs like /my-product instead of /catalog/product/view/id/{ID}

How is this one?

Options:

A.

An event observer adds RewriteRules to .htaccess on product save


B.

Magento\Catalog\Controller\Product\View::loadByUrlKey loads product pages using the url_key attribute value


C.

Using a URL Rewrite stored in the database connecting the request path with the target path


D.

A plugin on \Magento\UrlRewrite\Controller\Router::match loads products by the url_key attribute


Expert Solution
Questions # 8:

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

Options:

A.

Using slash-separated values in the path field


B.

in the table catalog_category_index


C.

in the parent_id field


D.

Using comma-separated values in the parent-ids field


Expert Solution
Questions # 9:

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?

Options:

A.

Declare a new preference for the LoggerInterface in app/code/myCompany/MyModule/etc/frontend/di.xml


B.

Declare a new preference for the LoggerInterface in MyCompany/MyModule/etc/di.xml


C.

Overwrite the existing preference for the LoggerInterface in app/etc/di.xml


D.

Declare a new preference for the LoggerInterface in app/code/MyCompany/MyModule/etc/global/di.xml


Expert Solution
Questions # 10:

You are developing a module MyCompany_StoreInfo to display information about brick and mortar stores on a frontend page. The displayed information varies based on the country of a given store.

What two elements automatically render their children? (Choose two.)

Options:

A.


B.


C.


D.


Expert Solution
Viewing page 1 out of 3 pages
Viewing questions 1-10 out of questions