Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70special

Magento Magento-2-Certified-Associate-Developer Magento 2 Certified Associate Developer Exam Exam Practice Test

Magento 2 Certified Associate Developer Exam Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$37.5  $124.99

PDF Study Guide

  • Product Type: PDF Study Guide
$33  $109.99
Question 1

How do you persist an entity to the database?

Options:

A.

Calling the store() method on the entity’s model

B.

Calling the update() method on the entity’s collection

C.

Calling the persist() method on the entity’s repository

D.

Calling the save() method on the entity’s repository

Question 2

You need to add a new text attribute to all products in the Magento store. When this attribute is displayed on the product page, its values must be different depending on the selected language.

Keeping simplicity in mind, how do you add this attribute?

Options:

A.

Use the Magento CLI to create a new custom attribute, then generate dictionaries for all supported languages

B.

Use a Data Patch to create a new EAV attribute

C.

Add a new column to the catalog_product_entity table using declarative schema

D.

Use the admin panel to create a new extension attribute

Question 3

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

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 4

The constructor function for \Magento\Catalog\Model\Category contains this excerpt:

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

Options:

A.

If no $storeManager is provided, Magento’s code generator creates a shell concrete class based on \Magento\Store\Model\StoreManagerInterface

B.

Magento finds all classes that implement \Magento\Store\Model\StoreManagerInterface (ordered alphabetically) and injects the first class.

C.

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

D.

Magento throws an exception because you cannot instantiate an interface

Question 5

A merchant tasked you to add an input field for notes to the Customer Account Information backend page.

Which three actions do you specify in a module’s Data Patch to add a customer notes attribute? (Choose three.)

Options:

A.

$cache->clean([‘eav’, ‘db_ddl’]);

B.

$customerSetup->addAttribute(‘customer’, ‘notes’, $options);

C.

$customerSetup->getConnection()->addColumn(‘customer_entity’, ‘notes’, $columnSpecs);

D.

$notesAttribute->setData(‘used_in_forms’, [‘adminhtml_customer’]);

E.

$customerSetup->addAttributeToSet(‘customer’, $attributeSetIdCustomer, $groupId, ‘notes’);

Question 6

What scopes are available for customer attributes?

Options:

A.

Global only

B.

Website only

C.

Global and Website

D.

Global, Website and Store

Question 7

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?

Options:

A.

Create a custom block which will dynamically choose the appropriate template

B.

Specify custom layout update XML in the admin panel for every product

C.

Write a Data Patch which will set the appropriate layout update XML for every product record

D.

Enable the dynamic product page UI component and configure it to use a different layout per price range

Question 8

You have created a module with a custom ACL resource and want to restrict access to resources of your module.

Which three items are restricted based on ACL role permissions? (Choose three.)

Options:

A.

CLI Commands

B.

Webapi resources

C.

Storefront login

D.

System configuration sections

E.

Adminhtml controllers

Question 9

Magento allows you to specify custom values per store for product attributes created in the admin panel.

Which architectural pattern makes it possible?

Options:

A.

Store Manager

B.

Extension Attribute

C.

Entity Attribute Value

D.

Dependency Injection

Question 10

You have created a custom module which must perform an action immediately after an order is placed, but only on the store front of the merchant site. You have selected the checkout_submit_all_after as the target event which the module will observe.

In which file will the event observer be declared?

Options:

A.

etc/frontend.xml

B.

etc/events.xml

C.

etc/config.xml

D.

etc/frontend/events.xml

Question 11

How many shipping addresses may be selected for an order during the checkout process?

Options:

A.

One shipping address per line item is possible

B.

Only one shipping address per order is possible

C.

One shipping addresses per unit of quantity is possible

D.

One shipping address per product type is possible

Question 12

A module declares the route:

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

Question 13

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

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

Question 14

Magento 2’s architecture uses code to bootstrap a custom module that resides in app/code.

What two files are required to make a module usable? (Choose two.)

Options:

A.

Helper/Data.php

B.

etc/config.xml

C.

etc/module.xml

D.

registration.php

Question 15

In layout files you can change al element’s order on a page. This can be done using one of the following:

  • instruction
  • before and after element attributes?

How are two methods different?

Options:

A.

They are the same, both provide access to the same functionality

B.

Elements are renamed by default when using the move instruction

C.

The move instruction allows altering an element’s parent node

D.

Before and after attributes can only be used with referenceContainer and referenceBlock