FRONT END DEVELOPER POOL-1 (MAGENTO 2 CERTIFIED PROFESSIONAL)

Description

POOL-1 Full . This quiz was made using my own study notes & the study guide from https://u.magento.com/magento-2-certified-professional-front-end-developer . It is by no means official and is not necessarily similar to the real Magento 2 certification exam. Real Exam need more deep knowledge to working with magento 2 . Hints: 60 items 90m to complete exam,63% pass , 1.5+ hands-on experience Based on Magento (2.2) front end development
Miska Red
Quiz by Miska Red, updated more than 1 year ago
Miska Red
Created by Miska Red about 5 years ago
2690
4

Resource summary

Question 1

Question
You are building MyCompany/MyTheme and need to customize the header template. Where do you place the new phtml template to override the header?
Answer
  • MyCompany/MyTheme/templates/html/header.phtml
  • MyCompany/MyTheme/Magento_Theme/html/header.phtml
  • MyCompany/MyTheme/Magento_Theme/templates/html/header.phtml
  • MyCompany/MyTheme/Magento_Theme/templates/override/html/header.phtml

Question 2

Question
What is true regarding the differences between the define and require functions?(2)
Answer
  • define is passive and only runs when it is called.
  • require is always run (as long as the module's file is loaded).
  • define is an application's entry point. This is what should be used in a phtml template.
  • require is a dependency of the application and a error will result if this module is missing.

Question 3

Question
You are making some major modifications to the customer account page. These modifications mean that you are unable to use the original layout instructions for this page. In what file do you place your custom layout instructions?
Answer
  • app/design/frontend/MyCompany/MyTheme/layout/customer_account_index.xml
  • app/design/frontend/MyCompany/MyTheme/Magento_Customer/layout/customer_account_index.xml
  • app/design/frontend/MyCompany/MyTheme/Magento_Customer/layout/override/frontend/customer_account_index.xml
  • app/design/frontend/MyCompany/MyTheme/Magento_Customer/customer_account_index.xml

Question 4

Question
You are browsing the Magento_Catalog's widget file and see this: <widget id="new_products" class="Magento\Catalog\Block\Product\Widget\NewWidget"> <parameters> <!-- ... --> </parameters> <containers> <container name="sidebar.additional"> <template name="default" value="list_default" /> <template name="names_only" value="list_names" /> <template name="images_only" value="list_images" /> </container> </containers> </widget> What is the purpose of the template nodes?
Answer
  • It filters options for the template when the widget is inserted into a page's layout.
  • It sets a data value on the block when it is used in a CMS page or block.
  • It adds a new option to the widget configuration area.
  • It creates new templates when the widget is used in a container.

Question 5

Question
How do you locate strings to be translated a custom module.
Answer
  • Enable inline translation in Stores > Configuration
  • bin/magento i18n:collect-phrases
  • grep your module for __\(['"].*?['"]\)
  • Open the admin panel's Content > Translation Wizard.

Question 6

Question
What command symlinks files from a module or the var/view_preprocessed directories to their respective location in pub/static?
Answer
  • bin/magento dev:source-theme:deploy
  • bin/magento indexer:reindex
  • bin/magento setup:static-content:deploy
  • bin/magento setup:di:compile

Question 7

Question
On the catalog product page, this XML instruction is executed: <block class="Magento\Catalog\Block\Product\View" name="product.info.review" template="Magento_Catalog::product/view/review.phtml" after="product.info.stock.sku"/> You have created MyCompany_MyModule which needs to utilize your own version of review.phtml. What layout XML instruction do you use to accomplish this?
Answer
  • <referenceBlock name="product.info.review" template="MyCompany_MyModule::new-review.phtml"/>
  • <referenceBlock name="product.info.review"> <action method="setTemplate"><template>MyCompany_MyModule::new-review.phtml</template></action> </referenceBlock>
  • <referenceBlock name="product.info.review"> <parameters> <argument name="template" xsi:type="string">MyCompany_MyModule::new-review.phtml</argument> </parameters> </referenceBlock>
  • <referenceBlock name="product.info.review" remove="true"/> <block name="product.info.review" template="MyCompany_MyModule::new-review.phtml"/>

Question 8

Question
Magento 2 Themes use a combination of ------ to achieve the desired look(Fill in gap)
Answer
  • PHP,HTML & XML
  • XML, CSS & HTML
  • CSS and JavaScript
  • HTML, JavaScript & CSS
  • All

Question 9

Question
Where Composer-based themes can be stored ?
Answer
  • app/design/frontend/<vendor>/<theme> /
  • m2-root/vendor/
  • app/code/<vendor>/<module>/
  • Anywhere
  • Nowhere

Question 10

Question
You are building a module that will be sold on Magento Marketplace . This module adds significant functionality is meant as a foundation for building extra functionality & u need to provide developers with a way to easily add additional style. How do you do this?
Answer
  • In your _module.less file , add //@magento_import source/_foundation.less'; This will include all _foundation.less files into your module's _module.less
  • The _extends.less with an S at the end within the Blank Theme, is a file where they created all the classes that can be extended via LESS later within the theme, without the need of creating new components or modular structure for style changes
  • In your _modules.less file , Add @import 'source/_foundation.less'; .Magento has extentded the @import directive to search all modules
  • In view/web/css/source/includes.xml add: <includeAll>_foundation.less<includeAll>
  • You need to utilize the Assuilder class to compile other module's LESS files.

Question 11

Question
You see this <script/> in the source on a page: { "*": {"MyCompany_MyModule/js/modal": {} } } What is the effect of the asterisk (*)?
Answer
  • The asterisk means that this module is not initialized with an associated element.
  • The asterisk means that this module is initialized with an associated element.
  • The asterisk is a typo & should be a dash (-)
  • The asterisk means that this module is initialize for each element on the page
  • The asterisk means that the module is initialized once for each root element

Question 12

Question
You are building a jQuery widget that renders this text : Welcome, %s! . How do you translate this?
Answer
  • Require mage/translate as $t , then : $t('Welcome, %s ').replace('%s', name)
  • Require magento/translate as $t , then : $t('Welcome, %s ').replace('%s', name)
  • _('Welcome, %s!', name);
  • Require mage/translate as $t , then : $t('Welcome, %s ', name)
  • Create a translation.json in view/web/js . Then , require MyCompany_MyModule/translation.json & parse the JSON

Question 13

Question
Your reviewing a Magento 2 build that another company developed , before the website goes live. In this process, you notice that while the original page load quickly ( and you see unformatted text & images ), it takes several seconds for the text & images to become styled. What is the solution ?
Answer
  • Switch the LESS compilation mode from Client-side to Server-side
  • Switch the SASS compilation mode from Client-side to Server-side
  • Switch the CSS compilation mode from Client-side to Server-side
  • Switch the JS compilation mode from Client-side to Server-side

Question 14

Question
You have been tasked with configuring a new setting in Content> Design. Where are the values saved that are set in this panel?
Answer
  • core_config_data
  • etc/system.xml
  • etc/config.xml
  • design_change
  • theme_confiquration

Question 15

Question
u r customizing the display of particular product. On this page u need to change the container in which the product option appear. Keeping ,maintainability in mind , how do u do this?
Answer
  • In the product admin page , choose the correct option in the "Display Product Option in" drop-down list
  • In the category that the product is associated with , choose the correct option in the "Product Options Container" dropdown
  • This is only possible with a layout XML update
  • In the product's admin page, change the Layout to be "2 columns with right bar"

Question 16

Question
U'v built a module: MyCompany_ProductEnhancements. ThirdParty_ProductModifier already exists in installation. u need to change a data variable set in <arguments> node . However, that change is not taking effect: it continues as value set by ThirdParty_SalesTax. How do u solve this problem?
Answer
  • Make MyCompany_ProductEnhancements dependent on ThirdParty_ProductUpdates
  • Copy the layout instructions from ThirdParty_ProductEnhancements into MyCompany_MyModule
  • Make ThirdParty_ProductUpdates depend on MyCompany_ProductEnhancements
  • Create a new layout XML file in MyCompany_ProductEnhancements layout/modifier directory

Question 17

Question
Magento contains the following layout instructions: <head><css src="css/styles-m.css"> <css src="css/style-l.css" meadia="screen and (min-width:768px)"> </head>. However, styles-m.css generated? How is styles-m.css generated?
Answer
  • Magento replace the .css files extension with .less & searches for styles-m.less in the web/css directory.
  • The Less preprocessor looks for all LESS files that match styles-m.less in the app/design/frontend directory
  • Magento automaticaly create styles-m.less which contain references to the other LESS files to be iported
  • The association of styles-m.less & sstyles-m.css is in a constant array it is always rendered

Question 18

Question
You Have been tasked with making a couple of small style modification in the Magento Luma Theme. Keeping upgrade-ability in mind, where do you add these changes?
Answer
  • source/_extend.less
  • source/_extends.less
  • Add another stylesheet into the <head> tag
  • source/_module.less

Question 19

Question
u r creating a JS module that applies the magento accordion UI widget to an element . You have written this code: require(['jquery','accordion', ], function ($ , accordion){ var accordionWigdget = $ ("#accordion"). accordion(); }); How do u call method on the accordion after it has been initialized?
Answer
  • $("#accordion").accordion("activate");
  • $("#accordion").callWidgetMethod("accordion","activate");
  • $("#accordion").accordion.activate();
  • $("#accordion").accordion().activate();

Question 20

Question
What module initializes uiComponents?
Answer
  • Magento_Ui/js/core/app
  • ui_component
  • ko/ui_component
  • Magento_Theme/js/ui_component

Question 21

Question
What are differences between a container & a Block?(select 3)
Answer
  • Containers automatically render their children
  • container can render an HTML tag that surrounds child elements
  • Block render text or html
  • Blocks can only be placed inside containers
  • Only blocks render HTML

Question 22

Question
Magento provides a polyfill for ES6's string templates feature. This utilizes the syntax: ${}. What are valid values to be evaluated? (2)
Answer
  • $ { $.e1 }
  • $ { 1+1 }
  • ${ bind:template }
  • ${ this.value }

Question 23

Question
How do you configure a uiComponent on the frontend with layout XML?
Answer
  • <block name="my.block.name template="MyModule_MyCompany::block.phtml"> <arguments> <argument name="jsLayout" xsi:type="array"><!---Config here--> </argument> </arguments> </block>
  • <block name="my.block.name template="MyModule_MyCompany::block.phtml"> <arguments> <argument name="cssLayout" xsi:type="array"><!---Config here--> </argument> </arguments> </block>
  • <referenceBlock name="ui.components" > <add name="new.component"> <!---Config here--> <referenceBlock>
  • <block name="my.blcok.name" template="MyModule_MyCompany::block.phtml"> <ui_component> <!---Config here--> </ui_component> </block>
  • <ui_component name = "conponent_name"/> Then , add configuration in ui_component/component_name.xml

Question 24

Question
When you override an existing template using design fallback directories, what are potential problems? (2)
Answer
  • If the theme that contains the overriding template is not utilized for the website, the template will not be used
  • When original template is upgraded , it is easy to miss that the overriding template needs to be updated
  • If there is an error the new template file , the old one will be rendered
  • If the store configuration , design/templates/allow_symlinks == false , the overriding template will not be rendered

Question 25

Question
You have configured a new block in Layout XML with this code: <block name ="my.block" template="MyCompany_MyModule::myTemplate.phtml"> <argument name="test_value" xsi:type="number">1000<argument> <argument> </arguments> </block> (2)
Answer
  • <?=block->test_value ?>
  • <?= $block->getTestValue; ?>
  • <?= $block->getTestData; ?>
  • <?= $block->getTestArg; ?>

Question 26

Question
ur creating a custom theme(MyCompany/MyTheme) that inherits ModuleVendor>BeautifulTheme. This inherite the Magento Blank theme. I what order will be the Magento fallback mechanism look for files?
Answer
  • MyCompany/MyModule >ModuleVendor/BeautifulTheme>Magento/Blank>Module
  • MyCompany/MyTheme >MyThemeVendor/BeautifulTheme>Magento/Blank>MyTheme
  • MyCompany/MyModule>Module
  • MyCompany/MyModule >ModuleVendor/BeautifulTheme>Module

Question 27

Question
u need to achieve this output fro a container: <div class="product_view"> <!--content goes here--> </div> What attributes do you use on the <container/> layout instruction to achieve this? (2)
Answer
  • htmlTag="div"
  • htmlClass="product__view"
  • htmlTag="Class"

Question 28

Question
Themes provide customization options in etc/view.xml. You are writing a PHTML template that will utilize configuration in this file. In your templete, how do you load a value from etc/view.xml ?
Answer
  • <?= $block->getVar("image_width",Magento_Catalog");?>
  • <?= $block->getScopeConfig()->getValue('theme/Magento_Catalog/image_width'); ?>
  • <?= $block->getData('theme_Magento_Catalog_image_width'); ?>
  • <?php $objectManager= \Magento\Framework\App\objectManager::getInstance(); $configuration =$objectManager->create('\Magento\Framework\Theme\Model\Configuration'); echo $configuration->getValue(Magento_Catalog/image_width); ?>

Question 29

Question
ur needing to add some extra spaces into the rendering of a customer's address. Keeping maintainability in mind , where do you make this change?
Answer
  • Store>Configuration>Customers>Customer Configuration>Address templates
  • Store>Configuration>Customers>Customer Configuration>Account Information Options
  • Store>Configuration>Customers>Customer Configuration>Name and Address Options
  • Store>Configuration>Customers>Customer Configuration>Login Options

Question 30

Question
Calling and initializing JavaScript, Magento 2, you have two options for specifying declarative notation: using the data-mage-init attribute & <script type="text/x-magento-init" /> tag Use the data-mage-init attribute to insert a JS component in a specified HTML element. The following example inserts a JS component in the <nav/> element: What are valid ways to initialize Magento-dependent Javascript on a page? (Select 2)
Answer
  • In a HTML element: <div data-mage-init='{ "MyCompany_MyModule/js/modal": {} }' > </div>
  • In ur modules requirejs-config.js: var config = {deps: [MyConmpany_MyModule/js/modal ]};
  • using the data-mage-init attribute
  • using the <script type="text/x-magento-init" /> tag

Question 31

Question
U'v tasked with creating a new page layout type:text. This similar to a 2-column layout, except that larger of 2columns is slightly smaller so that text is easier to read. U'v created view/page_layout/text.xml but 2 columns r not rendering. Keeping upgradeability in mind, what dud to fix?
Answer
  • Add <update handle="2columns-right">
  • Add <update handle="2columns">
  • Add <update handle="3columns">
  • Add <update handle="1columns">

Question 32

Question
ur browsing the uiComponent confiquration in checkout_index_index.xml & see the following code: <item name="customer-email" xsi:type="array"> <item name="component" xsi:type="string"> Magento_checkout/js/view. </item> <item name="displayArea" xsi:type="string">customer-email </item> </item>
Answer
  • In a knockout template: <!-- ko foreach: getRegion('before-login-form')--> <!-- /ko -->
  • In a knockout template: <!-- ko foreach: getRegion('after-login-form')--> <!-- /ko -->
  • In a knockout template: <!-- ko foreach: getRegion('before-register-form')--> <!-- /ko -->
  • In a knockout template: <!-- ko foreach: getRegion('login-form')--> <!-- /ko -->

Question 33

Question
u see these layout handles r available for customization on the catalog product pages: catalog_product_view catalog_product_vew_type_bundle default 2columns-left ; Which layout handle is always loaded firest on the catalog product page?
Answer
  • default
  • blank
  • custom
  • luma

Question 34

Question
What effects does enableing a category's "Anchor" setting have?(select 2)
Answer
  • it enables layered navigation
  • it includes childs products alongside any products associated with the current category
  • it disables layered navigation
  • it delete layered navigation

Question 35

Question
ur maintaining Magento website that is hosted on an old server(& due to corporate bureaucracy cannot be moved to a better hosting). This server utlizes Apache 2.2 & serves files over a HTTP/1 connection. When the page loads, there is a significant gap untile any Javascript-enabled functionality is usable. What do u do to remediate the slow Javascript?
Answer
  • Enable javascript bundling in Store>Configuration>Advanced> Developer>JS
  • Enable css bundling in Store>Configuration>Advanced> Developer>CS
  • Enable full page cache
  • Remove unnecessary js from running requirejs-config.js
  • Buld the static assets with the --bundleJs flag

Question 36

Question
n browsing through Magento Luma theme, u see a etc/view.xml file .What is purpose of this file?
Answer
  • This file contains configuration settings for aspects of rendering the theme.
  • This file contains configuration settings for aspects of rendering the module.
  • This file contains directive for how to hanlde fallback theme
  • This file contains layout xml for updating parameter for exiting block

Question 37

Question
u have created a new module & all its required files. A ur then making additions to catlog_product_view.xml no change r visible. What is remedy?
Answer
  • Run bin/magento module:enable MyCompnay_MyModule
  • Run bin/magento module: set: enable MyCompnay_MyModule
  • Run bin/magento module:active MyCompnay_MyModule
  • Run bin/magento module:live MyCompnay_MyModule

Question 38

Question
Keeping maintability i mind , how d u render a link on a CMS pages/block?
Answer
  • {{ store url="/path/to/destination"}}
  • {{ store url="/path/to/theme"}}
  • {{ store url="/path/to/module"}}
  • {{ store url="/path/to/plugin"}}

Question 39

Question
u need to set cache_key on a block that does not contain a class attribute. How dud this?
Answer
  • <referenceBlock name="block.name"> <arguments> <argument name="cache_key" xsi:type="string"> kayName<argument> </arguments> </referenceBlock>
  • <referenceBlock name="block.name"> <arguments> <argument name="cache_key" xsi:type="string"> cache_key<argument> </arguments> </referenceBlock>
  • <referenceBlock name="page.name"> <arguments> <argument name="cache_key" xsi:type="string"> cache_key<argument> </arguments> </referenceBlock>
  • <referenceBlock name="page.name"> <arguments> <argument name="kayName" xsi:type="string"> cache_key<argument> </arguments> </referenceBlock>

Question 40

Question
Ur creating a new transactional email template. Keeping maintainability in mind , how du add an image located in u theme?
Answer
  • <img src="{{ view url="Mycompany _MyModule/images/image.png}}">
  • <img src ="/path/to/file.png"/>
  • <img src="{{ media url="Mycompany _MyModule/image/image.png}}">
  • {{ image theme ="MyCompany_MyModule/images/image.png"}}
Show full summary Hide full summary

Similar

PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Miska Red
SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Miska Red
Cloud Developer Exam Test-01(MAGENTO 2 CERTIFIED Professional )
Miska Red
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Станислав Матявин
Magento 2 Cloud
Oleksiy P
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Dario Dorfelli
Bloc testing
Sanny Lin
MAGENTO 2 CERTIFIED SOLUTION SPECIALIST PRACTICE TEST
Pankaj Sharma
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
test test
SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Khrystyna Balog
Magento 2 Certified Professional Front End Developer Exam Questions
Benoit Alix