Quality Magento-2-Certified-Associate-Developer PDF Dumps - Magento-2-Certified-Associate-Developer Exam Questions [Q54-Q78]

Share

Quality Magento-2-Certified-Associate-Developer PDF Dumps - Magento-2-Certified-Associate-Developer Exam Questions

Most UptoDate Magento Magento-2-Certified-Associate-Developer Exam Dumps PDF 2022

NEW QUESTION 54
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 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
  • C. Magento throws an exception because you cannot instantiate an interface
  • D. Magento finds all classes that implement \Magento\Store\Model\StoreManagerInterface (ordered alphabetically) and injects the first class.

Answer: A

 

NEW QUESTION 55
Your module, MyCompany_MyModule, is using the frontName mymodule. You need to locate the class
responsible for the frontend path /mymodule/custom.
What file contains the controller class for the frontend path /mymodule/custom?

  • A. Controller/Custom/Index.php
  • B. Controller/Custom.php
  • C. Controller/Frontend/MyModule/Custom.php
  • D. Controller/MyModule/Custom/Index.php

Answer: A

Explanation:
Explanation/Reference: https://www.simicart.com/blog/magento-create-controller/

 

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

  • A. By modifying the data_version value in the setup_module table
  • 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 removing the Data Patch, running the command: bin/magento setup:db-data:upgrade, then copying the file back and running the command again

Answer: B

 

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

  • A. Specify custom layout update XML in the admin panel for every product
  • B. Enable the dynamic product page UI component and configure it to use a different layout per price range
  • C. Write a Data Patch which will set the appropriate layout update XML for every product record
  • D. Create a custom block which will dynamically choose the appropriate template

Answer: D

Explanation:
Explanation
https://www.rohanhapani.com/magento-2-change-product-view-page-layout-based-on-price/

 

NEW QUESTION 58
Where do you change the frontName for the admin router?

  • A. app/etc/config.xml
  • B. app/etc/local.xml
  • C. app/etc/env.php
  • D. composer.json

Answer: C

Explanation:
Explanation/Reference: https://amasty.com/knowledge-base/magento-2-admin-url.html

 

NEW QUESTION 59
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 60
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

Explanation:
Explanation/Reference: https://www.magestore.com/magento-2-tutorial/3464-2/

 

NEW QUESTION 61
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 62
How do you add a foreign key to an existing table created by another module?

  • A. This can only be done with raw SQL in a Schema Patch file
  • B. Create etc/db_schema.xml file with the table node and constraint child node
  • C. Create the etc/db_constraints.xml file and specify foreign key there in the constraint node
  • D. Run the command bin/magento setup:db-schema:upgrade <table> <constraint declaration>

Answer: B

Explanation:
Explanation
https://magento.stackexchange.com/questions/192317/magento-2-how-to-add-foreign-key-in-update-schema

 

NEW QUESTION 63
You are building a report using complex SQL aggregations to locate the required data.
In what type of class do you put these SQL statements?

  • A. Repository
  • B. Resource model
  • C. Model
  • D. Helper

Answer: C

 

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

  • A. Specify sortOrder="100"
  • B. Specify parent="Magento_Backend::marketing_seo"
  • C. Specify item XML in the file etc/adminhtml/menu/marketing/seo/menu.xml
  • D. Specify parent="Magento_Sitemap::catalog_sitemap"

Answer: A,B

 

NEW QUESTION 65
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 66
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 67
In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locate is used.
What is the public URL for this file?

  • A. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/register.js
  • B. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/web/register.js
  • C. https://magento.host/pub/static/frontend//Magento/luma/en_US/MyCompany_MyModule/js/register.js
  • D. https://magento.host/app/code/MyCompany_MyModule/view/frontend/web/register.js

Answer: C

 

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

  • A. \Magento\Catalog\Api\Data\ProductInterfaceFactory
  • B. \Magento\Catalog\Api\Data\ProductInterface
  • C. \Magento\Catalog\Model\Product
  • D. \Magento\Catalog\Model\ProductBuilder

Answer: A

Explanation:
Explanation/Reference: https://magento.stackexchange.com/questions/102922/programmatically-create-a-simple-product-
in-magento-2

 

NEW QUESTION 69
Assume that a customer's cart only includes one downloadable product.
What effect will it cause on the quote object?

  • A. The quote object will have a downloadable URL instead of an address
  • B. The quote object will not have a billing address
  • C. The quote object will not have shipping address
  • D. The quote object will not have any address

Answer: C

 

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

  • A. Update the module's setup_priorityin etc/modules.xml
  • B. Write a plugin intercepting \Magento\Setup\Model\Installer::handleDBSchemaData
  • C. Create an UpgradeSchemaAfterclass which implements InstallSchemaInterface
  • D. Create a Recurringclass which implements InstallSchemaInterface

Answer: D

Explanation:
Explanation/Reference: https://www.pierrefay.com/magento2-training/install-upgrade-setup.html

 

NEW QUESTION 71
Which three scopes can be used to set different System Configuration values in Magento? (Choose three.)

  • A. Store View
  • B. Area
  • C. Website
  • D. Language
  • E. Store

Answer: A,C,E

Explanation:
Explanation/Reference:
https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-config-mgmt-set.html

 

NEW QUESTION 72
How do you obtain customer information in a JavaScript module?

  • A. By using customerData.get('customer') call, where customerData is an instance of Magento_Customer/js/
    customer-data
  • B. Customer information is available in localStorage and be retrieved by calling window.localStorage.getItem
    ('customer')
  • C. By sending an AJAX request to the url: /customer/account/info/?json=1
  • D. Magento does not expose customer information in JavaScript for security reasons

Answer: A

Explanation:
Explanation/Reference: https://belvg.com/blog/customer-data-management-in-magento-2.html

 

NEW QUESTION 73
You are adding an entry to the backend menu. To do so you open a core etc/adminhtml/menu.xml file as a reference. In the file you see the node:

What is the result of specifying resource="Magento_Catalog::catalog"?

  • A. The menu item will only be visible if the class method specified by the resource returns a true value
  • B. The menu item will only be visible to users who are assigned to a role with access to the matching ACL resource
  • C. The last selected menu item for a user is stored in the DB so the previously visited page can be restored on the next login
  • D. The resource is used to locate the correct translation for the attributes listed in title="..."

Answer: B

 

NEW QUESTION 74
While reviewing a layout file named sales_order_view.xml you notice the element
<update handle="customer_account"/>
What is the purpose of this element?

  • A. Replaces the customer_account handle with sales_order_view
  • B. Updates the current page handle to customer_account
  • C. Nothing, this element has been deprecated
  • D. Adds the customer_account handle to the page's handles list

Answer: B

 

NEW QUESTION 75
Your module, MyCompany_MyModule, is using the frontName mymodule. You need to locate the class responsible for the frontend path /mymodule/custom.
What file contains the controller class for the frontend path /mymodule/custom?

  • A. Controller/Custom/Index.php
  • B. Controller/Custom.php
  • C. Controller/Frontend/MyModule/Custom.php
  • D. Controller/MyModule/Custom/Index.php

Answer: A

 

NEW QUESTION 76
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 77
How do you pass an array ['one', 'two] as a parameter to you block using the layout XML arguments directive?

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

Answer: C

 

NEW QUESTION 78
......


How to book the Magento 2 Associate Developer Exam

There are following steps for registering the Magento 2 Associate Developer Exam.

  • Step 1: Visit to Magento Exam Registration
  • Step 2: Signup/Login to Magento account
  • Step 3: Search for Magento 2 Associate Developer Certifications Exam
  • Step 4: Select Date and Center of Exam and confirm with payment value of $195

 

100% Free Magento Certified Developer Magento-2-Certified-Associate-Developer Dumps PDF Demo Cert Guide Cover: https://www.vceprep.com/Magento-2-Certified-Associate-Developer-latest-vce-prep.html