(2021) Magento-2-Associate-Developer Dumps and Practice Test (105 Questions) [Q39-Q56]

Share

(2021) Magento-2-Associate-Developer Dumps and Practice Test (105 Questions)

Guide (New 2021) Actual Magento Magento-2-Associate-Developer Exam Questions

NEW QUESTION 39
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?

  • A. <backend_model>Magento\Config\Model\Config\Backend\Yesno</backend_model>
  • B. <frontend_model>Magento\Config\Model\Config\Frontend\Yesno</frontend_model>
  • C. <option_model>Magento\Config\Model\Config\Option\Yesno</option_model>
  • D. <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

Answer: D

 

NEW QUESTION 40
What scopes are available for customer attributes?

  • A. Global only
  • B. Global, Website and Store
  • C. Global and Website
  • D. Website only

Answer: A

 

NEW QUESTION 41
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.)

  • A. Use composer CLI to pull the code from MyCompany's repository
  • B. Download the extension code from the developer's website, and put it into app/code
  • C. Clone the code from GitHub and put it into the vendor directory
  • D. Use Magento web setup wizard to pull the code from Magento's composer repository

Answer: A,B

 

NEW QUESTION 42
The constructor function for \Magento\Catalog\Model\Category 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
    \Magento\Store\Model\StoreManagerInterface
  • B. Magento throws an exception because you cannot instantiate an interface
  • C. Magento finds all classes that implement \Magento\Store\Model\StoreManagerInterface (ordered alphabetically) and injects the first class.
  • D. Magento looks to the di.xml files in the entire system for a preference node for
    \Magento\Store\Model\StoreManagerInterface. This class is constructed and injected

Answer: D

Explanation:
Explanation
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html

 

NEW QUESTION 43
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.)

  • A. Add MyCompany_Admission as a dependency in MyCompany_Magic's etc/module.xml file
  • B. Configure plugin sequencing for both plugins in MyCompany_Magic's etc/plugin_sequence.xml file
  • C. Set a sortOrder="10" for MyCompany_Admission's plugin in MyCompany_Magic's etc/di.xml
  • D. Include a sortOrder="20" on the new plugin in MyCompany_Magic's etc/di.xml file

Answer: A,C

 

NEW QUESTION 44
A merchant is interested in setting different prices for the same products in different storescopes.
What do you reply to this inquiry?

  • A. The price scope can be set to storebut this will lead to performance degradation of category pages
  • B. The prices can be scoped per store
  • C. The prices can only be scoped per websiteor globally
  • D. The prices do not support scopes

Answer: C

Explanation:
Explanation/Reference: https://www.quora.com/How-can-I-set-up-different-prices-for-the-same-product-per-Magento-s-
Store-View-Im-using-Magento-2-2

 

NEW QUESTION 45
You are working on a Magento store which will be selling in two countries. Each country has its own set of payment methods.
How do you organize the project to support this requirement?

  • A. Create one website, two store views
  • B. Create one website, one store view
  • C. Create one website, two payment scopes
  • D. Create two websites, two store views

Answer: C

 

NEW QUESTION 46
You are developing a module and need to add another column to a table introduced by another module MyCompany_MyModule via db schema.
How do you do that?

  • A. Create a etc/db_schema.xml file in your module, add the column and run bin/magento setup:upgrade
  • B. Run a command: bin/magento setup:db-schema:upgrade <table> <column definition>
  • C. Create a etc/db.xml file in your module, add the column and run bin/magento setup:db-schema:upgrade
  • D. Create a etc/db_schema_whitelist.json file in your module, add the column and run bin/magento setup:upgrade

Answer: B

 

NEW QUESTION 47
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?

  • A. Declare a new preference for the LoggerInterface in
    app/code/MyCompany/MyModule/etc/global/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/frontend/di.xml

Answer: C

 

NEW QUESTION 48
Which two tasks are supported by Magento CLI? (Choose two.)

  • A. Administrator account creation
  • B. Clearing cache
  • C. Customer password reset
  • D. Codebase deployment from developer machine to staging server

Answer: B,D

 

NEW QUESTION 49
A custom module must make changes to the schema following each setup:upgrade run. This must be done after all other module's schema updates have been applied.
How is this accomplished?

  • A. Create a Recurring class which implements InstallSchemaInterface
  • B. Write a plugin intercepting \Magento\Setup\Model\Installer::handleDBSchemaData
  • C. Update the module's setup_priority in etc/modules.xml
  • D. Create an UpgradeSchemaAfter class which implements InstallSchemaInterface

Answer: A

 

NEW QUESTION 50
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.
  • B. $collection->in($ids);
  • C. $collection->addFieldToFilter('record_id',['in'=>$ids]);
  • D. $collection->filterIn($ids);

Answer: C

Explanation:
Explanation/Reference: https://magento.stackexchange.com/questions/121040/how-to-get-product-collections-by-set-of-ids-
in-magento-2

 

NEW QUESTION 51
How can you render a text on a page using only layout xml?

  • A.
  • B.
  • C.
  • D.

Answer: B

 

NEW QUESTION 52
In a custom module you are adding a new field to the store configuration. The field will set the value for the configuration path mycompany/mymodule/myoption.
How do you supply the default value for that configuration option?

  • A. In the system/section/group/field/value node in the etc/adminhtml/system.xml file
  • B. In the config/default/mycompany/mymodule/myoption node in the etc/config.xml file
  • C. In the menu/default/section/group/field node in the file etc/adminhtml/menu.xml
  • D. In the system/mycompany/group/mymodule/field/myoption node in the etc/system.xml file

Answer: B

Explanation:
Explanation
https://magento.stackexchange.com/questions/173286/magento2-how-to-create-admin-page-with-configuration-f

 

NEW QUESTION 53
How do you set the custom block MyCompany\MyModule\Block\A as a child for the block named product.info using layout XML?

  • A. Option D
  • B. Option A
  • C. Option C
  • D. Option B

Answer: D

 

NEW QUESTION 54
How can you render a text on a page using only layout xml?

  • A. Option D
  • B. Option A
  • C. Option C
  • D. Option B

Answer: D

 

NEW QUESTION 55
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.phtmlof your custom module. The merchant has a customized version of this template in their custom theme.
What is a consequence of this setup?

  • A. This setup will throw an IllegalStateException
  • B. If another module is installed which also customizes the same core template, the templates will be rendered sequentially
  • C. If a preference for the core block is set, the template will no longer apply
  • D. If the custom module is removed, the custom template will no longer apply

Answer: D

Explanation:
Explanation/Reference: https://magento.stackexchange.com/questions/259547/how-to-a-third-party-module-uses-a-layout- update-that-changes-the-template-path

 

NEW QUESTION 56
......

Magento-2-Associate-Developer Exam Dumps Pass with Updated 2021 Certified Exam Questions: https://www.free4torrent.com/Magento-2-Associate-Developer-braindumps-torrent.html