Pass4itsure > Magento > Magento Certification > MAGENTO2-CERTIFIED-ASSOCIATE-DEVELOPER > MAGENTO2-CERTIFIED-ASSOCIATE-DEVELOPER Online Practice Questions and Answers

MAGENTO2-CERTIFIED-ASSOCIATE-DEVELOPER Online Practice Questions and Answers

Questions 4

Assume that $collection is a new instance of a class that extends Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection, and $ids is an array of ids.

How do you select a list of records from the database where the record ids are in the $ids list?

A. $collection->addFieldToFilter(`record_id',[`in'=>$ids]);

B.

C. $collection->in($ids);

D. $collection->filterIn($ids);

Buy Now
Questions 5

A third-party module uses a layout update that changes the template path for a core block from product/ view/addto/compare.phtml of the Magento_Catalog module to custom/view/addto/compare.phtml of your custom module. The merchant has a customized version of this template in their custom theme.

What is a consequence of this setup?

A. If the custom module is removed, the custom template will no longer apply

B. This setup will throw an IllegalStateException

C. If a preference for the core block is set, the template will no longer apply

D. If another module is installed which also customizes the same core template, the templates will be rendered sequentially

Buy Now
Questions 6

What is a valid use case for an around plugin?

A. The execution of the pluginized method must be suppressed

B. The arguments of the before plugins must be modified

C. The arguments of the after plugins must be modified

D. The execution of the before and after plugins must be suppressed

Buy Now
Questions 7

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?

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

Buy Now
Questions 8

How do you obtain customer information in a JavaScript module?

A. Magento does not expose customer information in JavaScript for security reasons

B. By sending an AJAX request to the url: /customer/account/info/?json=1

C. By using customerData.get(`customer') call, where customerData is an instance of Magento_Customer/ js/customer-data

D. Customer information is available in localStorage and be retrieved by calling window.localStorage.getItem(`customer')

Buy Now
Questions 9

You want to declare a block of the type \Magento\Framework\View\Element\Template with a template named view.phtml in the layout XML.

What is the correct layout declaration for this?

A. B. C.

D.

Buy Now
Questions 10

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

A. You should implement a new API endpoint instead of returning JSON from a controller

B. The string value of \Zend_Json::encode()

C. An instance of \Magento\Framework\Controller\Result\Json

D. No return needed, an object that can be converted to JSON must be set as the Response body

Buy Now
Questions 11

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?

A. cache:clean config_webservice

B. cache:refresh config_webservice

C. cache:flush

D. cache:purge

Buy Now
Questions 12

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?

A. The sort order of the plugin is too high and supersedes the priority of the intercepted method

B. The plugin implementation returned something other than its callable argument

C. The plugin implementation is skipping the execution of its callable argument

D. The plugin implementation overlooked using the AbstractPlugin parent class

Buy Now
Questions 13

What are two functions of a resource model? (Choose two.)

A. It executes create, retrieve, update and delete actions for an entity

B. It loads lists of entity models

C. It is made available in the Magento API for the purpose of data manipulation

D. It maps an entity to one or more database rows

Buy Now
Exam Name: Magento 2 Certified Associate Developer
Last Update: Apr 27, 2024
Questions: 103
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$45.99

VCE

$49.99

PDF + VCE

$59.99