PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )

Descrição

POOL-1 30 question, This only my study notes, questions will NOT be found on the final exam. They might be similar. 60 questions 90mi 64% to pass Based on Magento Open Source (2.3) and Magento Commerce (2.3),
Miska Red
Quiz por Miska Red, atualizado more than 1 year ago
Miska Red
Criado por Miska Red mais de 5 anos atrás
13536
8

Resumo de Recurso

Questão 1

Questão
You see this code in etc/adminhtml/routes.xml: <route id="mymodule" frontName="user-subscriptions"> <module name="MyCompany_MyModule" /> </route> You have placed a controller in Controller/Index/Subscribe.php. If you want to create layout XML instructions for this controller, what would be the layout XML's filename?
Responda
  • mymodule_index_subscribe.xml
  • mymodule_subscribe_[ACTION NAME].xml
  • user_subscriptions_index_subscribe.xml
  • user_subscriptions_subscribe_[ACTION NAME].xml

Questão 2

Questão
You have created a new product type, sample, and need to customize how it renders on the shopping cart page. Keeping maintainability in mind, how do you add a new renderer?
Responda
  • Create the layout file, checkout_cart_item_renderers.xml, reference the checkout.cart.item.renderers block and add a new block with an as="sample" attribute.
  • Override the cart/form.phtml template and add logic for the sample product type.
  • Create the layout file, checkout_cart_index.xml, and reference the checkout.cart.renderers block and add a block with the as="sample" attribute.
  • Create the layout file, checkout_cart_index.xml, and update the cart page's uiComponent to appropriately render the sample product type.

Questão 3

Questão
You are building an tool that imports products from an ERP. There are 20 columns of additional information that are associated with each product. This extra information must also be associated with an update time to know when to refresh the data. Keeping maintainability in mind, how do you build this into Magento?
Responda
  • Utilize an extension attribute.
  • Override the Product model and add the fields.
  • Create a separate model and build code to associate the two record types.
  • Create 20 EAV attributes and check their updated_at column.

Questão 4

Questão
What interface should a frontend controllers action implement?
Responda
  • \Magento\Framework\App\ActionInterface
  • \Magento\Frontend\Controller\ActionInterface
  • \Magento\Frontend\Controller\ControllerInterface
  • \Magento\Framework\App\ControllerInterface

Questão 5

Questão
You are making some major adjustments to a core Magento class (ClassA). These adjustments are only necessary when utilized from a specific Magento class (ClassB). You have created MyClass that contains the needed customizations. Keeping upgradeability in mind, how do you configure di.xml to make the substitution happen?
Responda
  • Ensure that MyClass extends ModuleA and set the <argument/>, for ModuleB to point to your new class in di.xml.
  • Set a <preference/> for ModuleA to be replaced by MyClass
  • Create a rewrite node that injects MyClass into ClassB.
  • Create a virtual type that extends ModuleB, specifying an <argument/> for MyClass.

Questão 6

Questão
You are customizing the display of product details page. On this page ur customer need to change the url in which the product category name will be appear as http://mystore.com/women/tops-women/helena-hooded-fleece.html , Keeping ,maintainability in mind ,How to get product url with category?
Responda
  • Admin -> Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> "Use Categories Path for Product URLs" set to "Yes"
  • It is not possible to display Categories name on product url
  • $product->setCategoryId($categoryId)->getProductUrl();
  • You Can Build category URL path \vendor\magento\module-catalog-url-rewrite\Model\CategoryUrlPathGenerator.php

Questão 7

Questão
You are building a new module to add extra functionality to the Magento application. What files are required?
Responda
  • registration.php
  • etc/module.xml
  • composer.json
  • Setup/InstallSchema.php
  • etc/config.xml

Questão 8

Questão
You need to add the Google Tag Manager (GTM) to every page. What three steps do you take to accomplish this in MyCompany_MyModule?
Responda
  • Add into view/frontend/layout/default.xml.
  • Create view/frontend/layout/default.xml.
  • Create view/frontend/templates/script.phtml and add GTM code.
  • Run bin/magento create:module:template script.phtml
  • Copy vendor/module-catalog/view/template/script.phtml to view/template/script.phtml and add GTM script.

Questão 9

Questão
You need to control access to a custom controller action. How do you tell Magento about this new control option?
Responda
  • Create etc/acl.xml and add <resource id="MyCompany_MyModule::customAction" ... />
  • In the controller, implement the _isAllowed method.
  • Create etc/adminhtml/acl.xml and add <acl id="MyCompany_MyModule::customAction" ... />
  • Use the CLI to add the new resource option.

Questão 10

Questão
You are trying to determine why a product is not appearing in a category. What table does Magento on the frontend to locate the relationship between a category and its products?
Responda
  • catalog_category_product
  • catalog_product_parent
  • catalog_category_product_index
  • catalog_category_product_relationship

Questão 11

Questão
How do you instruct Magento to enable a new module?
Responda
  • bin/magento module:enable MyCompany_MyModule
  • Magento automatically enables all new modules.
  • Go to Admin > System > Module Management.
  • Add MyCompany_MyModule to the setup_module table.

Questão 12

Questão
As you are scanning folder in the vendor/module-catalog directory, you see a directory that is named Ui. What is this folder's purpose?
Responda
  • It contains UI component data providers and component information.
  • It contains templates, CSS and JS pertinent to the module.
  • It contains the block PHP files that render HTML onto the frontend.
  • It is not a normal folder and further investigation is necessary to determine the purpose.

Questão 13

Questão
You are updating a module to add extra functionality to the Magento application, Where would Magento look for modules?
Responda
  • app/code/VendorName/ModuleName
  • vendor/vendor-name/module-name
  • app/vendor/vendor-name/module-name
  • lib/vendor-name/module-name

Questão 14

Questão
You are reviewing a module to some special functionality to the Magento 2 application, You see directory /Console, What task you think in this directory contain script for this modules?
Responda
  • contains CLI commands
  • contains any PHP classes exposed to the API
  • contains cron job definitions.
  • contains section files
  • open directory /Console & check script what code contaib

Questão 15

Questão
You are reviewing a module to some special functionality to the Magento 2 application, You see directory /CustomerData, What task you think in this directory contain script for this modules?
Responda
  • Contains section files that works with the data stored on the client side.
  • contains aggregated functionality.
  • contains localization files.
  • contains view files, including static view files, design templates, email templates, and layout files.

Questão 16

Questão
You are building a new module to add extra functionality to the Magento application.You want to works with CustomerData the data stored on the client side. Where initialized sections Cart and Directory-data are on the server side via the classes ?
Responda
  • Magento\Checkout\CustomerData\Cart and Magento\Checkout\CustomerData\DirectoryData
  • Magento\Checkout\Api\Cart and Magento\Checkout\Api\DirectoryData
  • Magento\Checkout\Block\Cart and Magento\Checkout\Block\DirectoryData
  • Magento\Checkout\Plugin\Cart and Magento\Checkout\Plugin\DirectoryData

Questão 17

Questão
Magento and third-party developers can find it difficult to track and report the dependencies that customized extensions have on other extensions. To address these issues, the Magento system introduces service contracts. What is a Service Contracts - Data interfaces ?
Responda
  • set of PHP interfaces that are defined for a module includes data interfaces
  • set of API interfaces that are defined for a module includes web APIs
  • set of UI Library that are defined for a module includes ui content
  • set of JS Library that are defined for a module includes js Library

Questão 18

Questão
You have created a module to show manufacturer-list, but in your page need to show Pagination that already ready in your block. Keeping maintainability in mind, where you call echo $block->getPagerHtml(); ?
Responda
  • /Manufacturer/view/frontend/templates/content.phtml
  • /Manufacturer/Block/Index.php
  • /Manufacturer/Controller/Index/Index.php
  • /Manufacturer/view/frontend/layout/manufacturer_index_index.xml

Questão 19

Questão
You have created a module to show manufacturer-list,Your customer need url as www.storeurl/manufacturer which file are mendatory to show correct url?
Responda
  • Controller: /Manufacturer/Controller/Index/Index.php
  • Block: /Manufacturer/Block/Index.php
  • Layout: Manufacturer/view/frontend/layout/manufacturer_index_index.xml
  • Templates:/Manufacturer/view/templates/content.phtml
  • Layout: Manufacturer/view/frontend/layout/index_index.xml
  • Layout: Manufacturer/view/frontend/layout/manufacturer.xml

Questão 20

Questão
You are facing a bug, which is supposedly caused by the customization of \Magento\Catalog\Api\ProductRepositoryInterface::save(). To resolve the issue, you decide to find all logic which customizes this method. Which two places do you search for customization declarations? (Choose 2)
Responda
  • */di.xml
  • */events.xml
  • */config.xml
  • */plugins.xml

Questão 21

Questão
You are implementing a customization of the sales management within a module MyCompany_MySalesProcess. You have created several event observers to add the custom functionality. Each observer is a separate class, but they require some common functionality. How do you implement the common functionality in the event observers, keeping maintainability and testability in mind?
Responda
  • You create a regular class implementing the common functionality as public methods and use constructor injection to make them available to the observers.
  • You create a trait with the common methods and use the trait in the observer classes.
  • You create a regular class implementing the common functionality as public static methods and call those from the observers.
  • You create an abstract class AbstractObserver with the common methods and extend the observer classes from it.

Questão 22

Questão
A custom module is performing an optimized custom query for quote items. The class applies the query customizations on the select object of a quote item collection instance. public function __construct( \Magento\Quote\Model\ResourceModel\Quote\Item\Collection $collection) { $this->collection = $collection; } public function fetchData() { $select = $this->collection->getSelect(); ... code modifying $select... return $this->collection->getData(); } You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module. How do you resolve the issue, keeping maintainability in mind
Responda
  • You change the argument type to \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory and instantiate the collection using $collectionFactory->create();
  • You remove the constructor argument and use ObjectManager::getInstance()- >create(\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::class) to instantiate the collection instead.
  • You inject \Magento\Framework\DB\Select instead of the collection and perform the desired query independently of the collection.
  • You inject \Magento\Quote\Api\CartItemRepositoryInterface because low level query customizations are not allowed.

Questão 23

Questão
In a custom module you implement the interface \Magento\Framework\App\Config\DataInterface. /** Configuration data storage @api */ interface DataInterface { public function getValue($path); public function setValue($path, $value); } What version constraint for magento/framework do you add to your module’s composer.json file?
Responda
  • minor
  • major
  • patch
  • stable

Questão 24

Questão
You are building CLI that use the console to create a customer account with our custom command as like php bin/magento customer:user:create --customer-firstname="Mahin" --customer-lastname="Rahman" --customer-email="mahin@example.com" --customer-password="mahin@123" --website="1" using: protected function configure() { $this->setName('customer:user:create') ->setDescription('Create new customer') ->setDefinition($this->getOptionsList()); } protected function getOptionsList(){ return [ ------------------]; } Which below Option are not required in blank? (Choose 2)
Responda
  • new InputOption(Customer::KEY_SENDEMAIL, 0, InputOption::VALUE_OPTIONAL, '(1/0) Send email? (default 0)')
  • new InputOption(Customer::KEY_STORE, null, InputOption::VALUE_REQUIRED, '(Required) Store ID'),
  • new InputOption(Customer::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, '(Required) Customer password'),
  • new InputOption(Customer::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, '(Required) Customer email'),
  • new InputOption(Customer::KEY_LASTNAME, null, InputOption::VALUE_REQUIRED, '(Required) Customer last name'),
  • new InputOption(Customer::KEY_FIRSTNAME, null, InputOption::VALUE_REQUIRED, '(Required) Customer first name'),
  • new InputOption(Customer::KEY_WEBSITE, null, InputOption::VALUE_REQUIRED, '(Required) Website ID'),

Questão 25

Questão
You are building CLI that use the console to create a customer account with our custom command, Adding a new command to CLI is based on passing on the argument from the XML level to the class . Dependency Injection comes in handy here. you create the file app/code/Mycompany/Customer/etc/di.xml with the following content: <type name="---------------------"> </type> What is the correct in below?
Responda
  • Magento\Framework\Console\CommandList
  • Magento\Framework\Console
  • Magento\Framework\CommandList
  • Magento\Framework\CommandList\Console

Questão 26

Questão
You are creating a new indexer which must run after the targetrule_product_rule index process. When you run bin/magento indexer:reindex, your rule always runs first creating inaccurate data. What is the resolution?
Responda
  • Use a dependencies node in your indexer configuration
  • Specify the sortOrder in your indexer configuration.
  • Use a plugin on the IndexManager class to change load order.
  • Create a bash script to execute each indexer in the correct order.

Questão 27

Questão
You need to render a product attribute’s raw value as a variable in a script tag. This value will be used to initialize an application on the frontend. How do you render this value?
Responda
  • <?= $block->escapeJs($value) ?>
  • <?= $block->escapeJsVar($value) ?>
  • <?= $block->renderJs($value) ?>
  • <?= $block->escapeHtml($value) ?>

Questão 28

Questão
You need to add a new column to the sales_shipment and the sales_shipment_grid tables. Other than utilizing the default addColumn methods, what way is automatic?
Responda
  • Utilize the SalesSetup class’ addAttribute method.
  • On the default EavSetup class, utilize the addColumn method.
  • On the ModuleDataSetupInterface, call $setup->getSales()->addColumn().
  • Ensure your UpgradeSchema class extends CoreSetup and call $this->addSalesColumns().

Questão 29

Questão
You are creating a module that will be sold on the Magento Marketplace. You wish for this module to be easily extensible, and decide to add the capability for other developers to utilize extension attributes. What is the minimum update necessary to enable this capability?
Responda
  • Add the getExtensionAttributes() method and implement ExtensionAttributesInterface in each model.
  • Create an ExtensionAttributeInterface for each model.
  • Ensure each model extends Magento\Framework\Model\AbstractExtensibleModel.
  • Configure your models in etc/extension_attributes.xml

Questão 30

Questão
There is a custom extension called MyCompany_MyModule. It has the following layout customization declared in MyCompany/MyModule/view/frontend/layout/default.xml: <referenceContainer name=”content”> <block class=”Magento\Framework\View\Element\Template” name=”my.block” template=”MyCompany_MyModule::my_template.phtml” cacheable=”false”/> </referenceContainer> What will be the result of the customization?
Responda
  • All store front pages will be non-cacheable
  • Only the default landing page will be non-cacheable
  • my.block on the default landing page only will be cached using ESI.
  • my.block on the all store front pages will be cached using ESI

Semelhante

SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Miska Red
Cloud Developer Exam Test-01(MAGENTO 2 CERTIFIED Professional )
Miska Red
Magento 2 Cloud
Oleksiy P
70-411 - MCSA: Administering Windows Server 2012 - Exam 4
Mike M
PROFESSIONAL DEVELOPER TEST POOL-02 (MAGENTO 2 CERTIFIED )
Dario Dorfelli
70-411 - MCSA: Administering Windows Server 2012 - Exam 3
Mike M
70-411 - MCSA: Administering Windows Server 2012 - Exam 5
Mike M
70-411 - MCSA: Administering Windows Server 2012 - Exam 6
Mike M
MAGENTO 2 CERTIFIED SOLUTION SPECIALIST PRACTICE TEST
Pankaj Sharma
SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Khrystyna Balog
Certified Performance Elevation Professional Prep Exam Flashcards
Sereen Lee