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

Description

POOL-2 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 by Miska Red, updated more than 1 year ago
Miska Red
Created by Miska Red over 5 years ago
1264
3

Resource summary

Question 1

Question
You need to Replace a default JS component, To use a custom implementation of an existing Magento JS component: Place the custom component source file in one of the --------- locations: (Select 2)
Answer
  • Theme JS files: /web/js or /_/web/js
  • Module view JS files: <module_dir>/view/frontend/web/js
  • Module view JS files: <module_dir>/web/js
  • Theme JS files: /view/frontend/web/js or /_/view/frontend/web/js

Question 2

Question
You Create a RequireJS configuration file requirejs-config.js, having specified the following: var config = { "map": { "*": { "<default_component><custom_component>" } } }; What do you meaning <default_component> & <custom_component> ?
Answer
  • <default_component>: the name of the default component you replace
  • <custom_component>: the name of the custom component
  • <default_component>: the name of the custom component
  • <custom_component>: the name of the default component you replace

Question 3

Question
A merchant asks you to add frontend validation to their newsletter form. You notice the form has the following attributes: <form class="form newsletter” novalidate id="newsletter-validate-detail"> Which of the following choices will add frontend validation?
Answer
  • Add a validation object using data-mage-init attribute.
  • Add form_key input inside of form.
  • Remove the novalidate attribute from form.
  • Add the class mage-validate to form.

Question 4

Question
You need to add a custom block of HTML to the header of every page using a layout file in MyCompany/mytheme. Keeping upgradability in mind, how do you add the block?
Answer
  • Put your customization in MyCompany/mytheme/Magento_Theme/layout/default.xml
  • Keep track of your changes and apply them to Magento/Theme/layout/default.xml after upgrade
  • Put your customization in MyCompany/mytheme/layout/extend.xml
  • Include <extend file="Magento_Theme::default.xml"> in your MyCompany/mytheme/Magento_Theme/layout/default.xml

Question 5

Question
Without customization, what types are filtered through the magento2 directives parser? (2)
Answer
  • CMS blocks
  • CMS Pages
  • Module
  • Theme

Question 6

Question
You are creating a new Magento theme for a merchant. This theme will be included in the project's git repository.Keeping upgradeability in mind, where do you place the files and directories that pertain to this theme?
Answer
  • app/design/frontend/MyCompany/MyTheme/
  • vendor/mycompany/my-theme/
  • app/design/MyCompany/MyTheme/frontend/
  • lib/themes/frontend/MyCompany/MyTheme/

Question 7

Question
You are describing the design scheduling to a merchant. What options are available for you to customize when applying a design change in Content > Design Schedule? (Select 2)
Answer
  • Theme
  • Start/end dates
  • Layout Updates
  • Design change name

Question 8

Question
You are building a new theme for this purpose which three properties are set in theme.xml? (Select 3)
Answer
  • Parent theme
  • Theme preview image
  • Title of a theme
  • Theme area: frontend or adminhtml
  • Version of a theme

Question 9

Question
You are creating a uiComponent that is used on the checkout page that displays the customer's email address, with realtime updates as they change it How do you track the value of their email?
Answer
  • In your uiComponent's configuration, add: imports: { "customer-email:email" }
  • Add 'Magento_Checkout/js/view/form/element/email' to the dependencies for your uiComponent.
  • In requirejs-config.js add: { "MyCompany_MyModule/js/email-signup" : { "listens": { "Magento_Checkout/js/view/form/element/email" }}}
  • In your uiComponents configuration, add: exports: {"customer-email:email"}

Question 10

Question
Your Customise Theme for template files with the same name which following override rules apply? (select 3)
Answer
  • Themes should only be for applying changes to existing code.
  • Theme templates override module templates
  • Child theme templates override parent theme templates
  • New functionality should go into Theme specific to the use case

Question 11

Question
You are developing a German language theme for the Magento Marketplace named mytheme. In your Magento installation you have a third-party German language package installed. The theme “mytheme” already contains a mytheme/i18n/de_DE.csv file. The graphic designer wants you to rename the Add to Cart button to make the text shorter. Keeping upgradability in mind, where do you add the new string?
Answer
  • Add the string to mytheme/i18n/de_DE.csv
  • Override the Magento_Catalog/view/frontend/templates/product/view/addtocart.phtml template in mytheme and replace the string
  • Add the string to the third-party German language package.
  • Add the translation to the core_translate database table.

Question 12

Question
You have written a customer uiComponent implementation that connects with a phtml template that is output into a pages's source. How do u connect uiComponent's Knockout features with the HTML element?
Answer
  • Add data-bind="scope: 'your-uicomponent-name' " to your HTML element
  • Add targetElement: ".selector" to your uiComponent's defaults object
  • Add this.el =$('.selector'); to your uiComponent's constructor
  • Add link="uicomponents.your-uicomponent-name" to your HTML element

Question 13

Question
Which layout handles are always applied to a product page? (3)
Answer
  • catalog_product_prices
  • catalog_product_view
  • catalog_product_view_type_(product_type)
  • catalog
  • catalog_product_view_layout_(product layout update)

Question 14

Question
You are auditing a module that contains phtml file: $product=$block->getProduct(); for($i=0;$i<count($products); $i++){ echo $products[i]->getName() } To comply with magento templete standards, what do you change? (Select 2)
Answer
  • Change the { and } to : and endforeach; respectively
  • Change the for to foreach.
  • Change the $block->getProduct; to $block->getData('products');
  • Inside the for loop, add $product=$products[i]; & change the reference from $product[i] to $product

Question 15

Question
You need not use Common layout instructions Use layout instructions to customize your layout: What are the layout instructions <body></body> child ? (2)
Answer
  • <action><attribute> <block> <container>
  • <move> <referenceBlock> <referenceContainer>
  • <title> <meta> <link> <css> <script>
  • <html> <head> <body> <update>

Question 16

Question
You are reviewing Luma theme Magento Theme that inherits from blank theme What directories are found in themes? (3)
Answer
  • etc/
  • i18n/
  • web/
  • Observer/
  • Model/

Question 17

Question
You are working on a website that previous developer built on Magento, u've been taked with creating a form page for MyCompany_MyModule. MyCompany_MyModule contains following etc/frontend/routes.xml: <?xml version="1.0"?> <config> <router id="standard"> <route id="product_list" frontName="products"> <module name="MyComany_MyModule"/> </route> </router> </config> Controller is located in app/code/MyCompany/MyModule/Controller/Display/Grid.php. What is correct layout handle associated with this?
Answer
  • products_list_display_grid
  • category_products_display_grid
  • category_products_list_grid
  • category_products_view_grid

Question 18

Question
How to override an existing Magento 2 jQuery UI widget?
Answer
  • add My/Mod/view/frontend/requirejs-confg.js
  • add My/Mod/view/frontend/web/js/tabsmixin.js
  • edit lib/web/mage/list.js
  • extent vendor/magento/magento2-base/lib/web/mage/menu.js

Question 19

Question
You override price-utils.js specific method as below // My/Mod/view/frontend/js/price-utilsoverride.js defne([], function() { var updates = { formatPrice: function(amount, format, isShowSign){ return '00000';} }; return function(target) { return Object.assign(target, updates);} }); Where u add requirejs-confg.js in My_Mod?
Answer
  • My/Mod/view/requirejs-confg.js
  • My/Mod/frontend/view/requirejs-confg.js
  • My/Mod/templete/layout/requirejs-confg.js
  • My/Mod/web/requirejs-confg.js

Question 20

Question
You are reviewing XML head as : <?xml version="1.0"?> <page xmlns:xsi="http://www. w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/ Layout/etc/page_confguration.xsd"> <body>... What type of declaration does it mean?
Answer
  • uiComponent
  • Theme
  • RequirJS
  • KnockoutJs

Question 21

Question
Where are the CSS merging and minification options found?
Answer
  • Stores > Configuration > Advanced > Developer > JavaScript Settings >Merge JavaScript Files
  • Content > Design >Theme>Advanced >JavaScript Settings>Merge JavaScript Files>Yes
  • Stores > Configuration >Developer>Advanced >JavaScript Settings>Merge JavaScript Files>Yes
  • Stores > Configuration > Advanced > Developer > CSS Settings

Question 22

Question
You are working with high level magento partner company developing a new theme that no parent theme exists & Also use to composer installation Which file are required in a theme? Select all that are required.(3)
Answer
  • /registration.php
  • /theme.xml
  • /etc/view.xml
  • /composer.json
  • /web/js
  • i18n/en_US.csv

Question 23

Question
Which of the following is a Knockout virtual element?
Answer
  • <!-- ko foreach: payments --><li data-bind="text: $data.name"></li> <!-- /ko -->
  • <li class="heading">My heading</li>
  • <div data-bind="payments: payments">
  • <div data-init="payments: payments">

Question 24

Question
What is Magento 2 Themes improvements than 1 ? such as the use of_____________________ to name a few.(Select 4)
Answer
  • containers
  • better modularity
  • better extensibility
  • more control over settings
  • Auto Bug Solving

Question 25

Question
You have tasked with creating _theme.less is for redefining to your theme globally, Which below are correct ? (3)
Answer
  • create variables
  • defining new variables
  • mixins that apply
  • create block
  • create Weget

Question 26

Question
You want to use Magento 2 library in your theme , Where is UI library has some built-in documentation & how access?
Answer
  • in: /lib/web/css/source/docs. It's possible to access it on the frontend of your site with some changes to .htaccess,
  • in: /module/web/css/source/docs. It's possible to access it on the frontend of your site with some changes to .htaccess,
  • in: /theme/web/css/source/docs. It's possible to access it on the frontend of your site with some changes to .htaccess,
  • in: /plugin/web/css/source/docs. It's possible to access it on the frontend of your site with some changes to .htaccess,

Question 27

Question
Where is UI Library variables defined n Magento Blank?
Answer
  • Each of LESS files has extensible mixins that are used to define the look of global elements , using default variables defined in: /lib/web/css/source/lib/variables.
  • Each of JS files has extensible mixins that are used to define the look of global elements , using default variables defined in: /lib/web/js/source/lib/variables.
  • Each of PHTML files has extensible mixins that are used to define the look of global elements , using default variables defined in: /lib/web/html/source/lib/variables.
  • Each of php files has extensible mixins that are used to define the look of global elements , using default variables defined in: /lib/web/php/source/lib/variables.

Question 28

Question
You are troubleshooting a US website that sells discs of sandpaper. There is Js syntax error in this code:"unknown character',' ". Template: <sc>var productName= "<?=$blcok->get </sc> Which renders to: < <sc> var productName = "SuperSandpaper disc, 6 ", 100 grit"; </sc>
Answer
  • Change the $block->getProductName(); to $block->escapeJs($block->getProductName());
  • Change the var productName ="<?=$block->getproductName; ?> to var productName = <<<PRODUCTNAME <?=$block->getproductName; ?> PRODUCTNAME;
  • Change the $block->getProductName(); to $block->escapeHtml($block->getProductName());
  • Change the $block->getProductName(); to $block->escapeChar($block->getProductName());
  • Modify the block's getProductName() methods to add a slash in front of the result

Question 29

Question
What is the custom LESS directive added by Magento in order to implement a fallback system in the import mechanism?
Answer
  • //@magento_import
  • //@mage_import
  • //@magento_imports
  • //@mage_imports

Question 30

Question
What is the correct way to Combinator indents add spaces before and after combinators. Less coding standard?
Answer
  • .nav + .bar { color: @bar__color; }
  • .nav+.bar { color: @bar__color; }
  • .nav +.bar { color: @bar__color; }
  • .nav+ .bar { color: @bar__color; }

Question 31

Question
If you need to override a module layout, where would you put the layout file?
Answer
  • <module_dir>/view/frontend/layout/<layout1>.xml
  • <theme_dir>/<Namespace>_<Module>/layout/<layout1>.xml
  • <Namespace>_<Module>/<theme_dir>/layout/<layout1>.xml
  • <theme_dir>/view/frontend/layout/<layout1>.xml

Question 32

Question
Templates are stored in the following locations:
Answer
  • <module_dir>/view/frontend/templates/<path_to_templates>
  • <theme_dir>/<Namespace>_<Module>/templates/<path_to_templates>
  • <theme_dir>/<Namespace>_<Module>/view/frontend/templates/<path_to_templates>
  • <theme_dir>/<Namespace>_<Module>/view/templates/<path_to_templates>

Question 33

Question
Using PHP short tags in template PHTML files
Answer
  • <?= $block->getAdjustmentsHtml() ?>
  • <?php echo $block->getAdjustmentsHtml() ?>
  • <?php echo $block->returnAdjustmentsHtml() ?>
  • <?= $block->returnAdjustmentsHtml() ?>

Question 34

Question
Customize header and footer templates?
Answer
  • <Magento_Email_module_dir>/view/frontend/email/header.html
  • <Magento_Email_module_dir>/view/frontend/email/footer.html
  • <Magento_Email_module_dir>/view/frontend/email/default.html
  • <Magento_Email_module_dir>/view/frontend/email/emailBody.html

Question 35

Question
Media queries in Magento default themes
Answer
  • Media queries @media-common, max screen__s and max screen__m will be added to styles-m.css.
  • Media queries min screen__m and min screen__l will be added to styles-l.css.
  • Media queries min screen__m and min screen__l will be added to style-l.css.
  • Media queries @media-common, max screen__s and max screen__m will be added to style-m.css.

Question 36

Question
You are Creating a mobile-specific theme <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <remove src="css/styles-l.css" /> </head> </page> Where you add this file to get your own style?
Answer
  • <theme_dir>/Magento_Theme/layout/default_head_blocks.xml
  • <theme_dir>/Magento_Theme/layout/frontend/default_head_blocks.xml
  • <theme_dir>/Magento_Theme/template/default.phtml
  • <theme_dir>/Magento_Theme/layout/html/header.xml

Question 37

Question
To call a mixin with parameter values different from default, set these values when calling the mixin, like in the following example: Which correct with specifying any parameters?
Answer
  • .example-button { .lib-button( @_button-padding: @button-padding, @_button-color: #fff, @_button-color-hover: #ccc ); }
  • .breadcrumbs { .lib-breadcrumbs(); }
  • .example-button { .lib-button(); }
  • .breadcrumbs { .lib-breadcrumbs(); .lib-button(); }

Question 38

Question
Example of the accordion initialization with the active option specified: Which is correct? (Select 2)
Answer
  • $("#element").accordion({ active: "0 1"});
  • $("#element").accordion({ active: [0,1]});
  • $("#element").accordion.active: (0 1);
  • $("#element").accordion.active: [0, 1];

Question 39

Question
You are going to create widget named Samplewidget. where you declare widget?
Answer
  • etc/widget.xml
  • etc/di.xml
  • etc/config.xml
  • etc/system.xml

Question 40

Question
What happens if you use a {{block id="my_id"}} template directive like this?
Answer
  • The Cms block with the identifier "my_id" is outputted
  • An empty block with the class \Magento\Framework\View\Element\Template and a name of "my_id" is created
  • There is an error because the block id must be numeric
  • There is an error because the block id can not contain special character(_)
Show full summary Hide full summary

Similar

Bloc testing
Sanny Lin
Backend y Frontend
Carlos Alberto Castillo Cortes
Dier (Onderdeel plant&dier toets)
samanthabirdsall
Functions of a Political Party
Phoebe Fletcher
Key Biology Definitions/Terms
courtneypitt4119
Mapa Conceptual de Liderazgo
gabbi.mendoza
AQA A2 Biology Unit 5 Chapter 11: Muscle Contraction
Charlotte Lloyd
el centro comercial
Pamela Dentler
Test Primer Parcial - Tecnologías de la Información I
Ing. José Luis A. Hernández Jiménez
EPISTEMOLOGÍA
Dayanna Fonseca
New PSBD/PSCOD/ASSD Edition 2018
David Thapa