EMT Practice Test

1. Question Content...


Question List

Question1: Recent code changes to an existing cartridge do not appear correctly on a Storefront. The developer confirms that the code is uploaded in the IDE and ensures that the cartridge is associated with the sandbox.
Which two additional steps should the developer take to troubleshoot this problem?
Choose 2 answers

Question2: Server.get('Show', consentTracking.consent, cache.applyDefaultCache, function (req,res,next){ Var Site = require('dw/system/Syte"); Var pageMetaHelpter = require('*/cartridge/scripts/helpers/pageMetaHelper'); pageMetaHelpter.setPageMetaTags(req.pageMetaData, Site.current); res.render('/home/homePage'); Missing code here
}, pageMetadata.computedPageMetadata);
The controller endpoint code snippet above does not work.
Which line of code should the developer use to replace line 6 and correct the problem?

Question3: A developer must configure permissions for an Open Commerce API resource on a sandbox instance that currently does not have any permissions configured.
Which two configuration properties are required to enable Access to the resource?
Choose 2 answers

Question4: Universal Containers is preparing their storefront to use Open Commerce APIs (OCAPI).
To which hook should the Digital Developer move taxation logic to ensure consistent order totals within B2C Commerce?

Question5: Business Manager has the configuration:
* Active log category is "root"
* Log level of INFO
The code below execites:
Var log = Logger.getLogger("products","export");
Log.info ("This is important information");
Using this information, what is the beginning of the filename in which the log will be written?

Question6: When looking at Custom Object instances for a site, a merchant notices that the creation date is not showing up on the instances in Business Manager.
Where should the developer add this attribute to the Custom Object so it is visible for the merchant to see in Business Manager'

Question7: Given the requirements:
* To show the washing instructions for a clothing product on a dedicated section the detail page
* Washing instructions come from the product information manager(PIM)
* To have this attribute available to localize in the Storefront.
Which action meets these requirements?

Question8: In Log Center, a developer notes a number of Cross Site Request Forgery (CSRF) log entries. The developer knows that this happens when a CSRF token is either not found or is invalid, and is working to remedy the situation as soon as possible.
Which two courses of action might solve the problem?
Choose 2 answers

Question9: Which line of code creates a content slot that can be included on homepage.isml to display on the home page?

Question10: Given the code snippet aboce, what should be added after this code so it can be used for page component display?

Question11: A Digital Developer creates a B2C Commerce server connection in their UX Studio workspace. The Developer adds new cartridges to the workspace, but the cartridges do NOT execute as the Developer expects.
Which three things should the Digital Developer verify to ensure the cartridges are uploaded? (Choose three.)

Question12: A merchant has a content slot on a page that currently displays products based on the top Sellers for the current week.
They wish to change this functionality and, instead, have the slot render a specific content asset so that the content experience is more personalized to the visitors.
Which two actions are necessary to make this change?
Choose 2 answers

Question13: A developer has a sandbox configured with a service and its profile and credential. Now there is a requirement to allow changes to the service URL manually from the sandbox.
Which B2C feature should the developer use to achieve the request?

Question14: The Home-Show route uses this middleware chain:

The developer added Home.;s in another cartridge, which is before the original cartridge in the cartridge path, to extend that route but it does not have the middleware chain:

Assuming the code is correct on both functions, what is the expected result?

Question15: A client has two B2C Commerce sites in the same instance: one for the U.S. market, the other for the European market. They offer free gift wrapping on a selection of products. For each order, five products can be wrapped in the U.S., but only three products can be wrapped in the European region.
How should a developer allow the merchant to independently adjust this number?

Question16: In order to build the SFRA code to a developer sandbox for the first time, which build steps should the developer perform for the site to appear and function as designed?

Question17: Below is a form definition snippet from the newsletter.xml file:
<?xml version="1.0"?>
<form xmlns=http://www.demandware.com/xml/form/2008-04-15>
<field formid="email" lavel="Email" type="String" mandatory="True" max-length="50" />
</form>
Which line of code creates a JSON object to contain the form data?

Question18: A merchant has a requirement to render personalized content to n a category page via a Content Slot that targets VIP high-spending customers during a specific promotional period.
Which two items should the developer create to achieve the specified requirements?
Choose 2 answers:

Question19: A Digital Developer needs to add a new form to the shopping cart page to allow customers to enter their rewards pass ID. There is already an existing Cart.js controller that handles processing of the other cart forms. In addition, a form field node is in the form XML and the necessary form input is present in the ISML template.
The code below is the submit button for the ISML markup.

What additional steps must occur before the Digital Developer can begin writing the processing code for this request?

Question20: A client has a requirement to render different content on the homepage based on if the customer is logged in or guest user.
What should a developer implement to achieve this requirement?

Question21: A merchant requires that an existing section of the Site become editable from the Business Manager, so that they can modify it independently of the developer.
Which of these is an important factor for a developer to consider when choosing the appropriate solution between a content slot and a Page Designer component?

Question22: Given the requirements:
* To integrate with an external web service using HTTP requests
* To create a service for this purpose with the Service framework using the LocalServiceRegistry class.
* To test the service before the external service provider makes the API available Which solution allows the developer to satisfy the requirements?

Question23: A Digital Developer has identified that the code segment below is causing performance problems.

What should the Developer do to improve the code?

Question24: Which two items are appropriate content of custom logs implemented at checkout?
Choose 2 answers:

Question25: A merchant asks a developer to create a Cache Partition for the home page, so that when the home page is edited, only the home page is cleaned.
Given the above requirement, where should the developer create that partition in Business Manager?

Question26: To ensure SFRA best practices and protect against request forgery, the developer introduced CSRF token generation in the customer address form:
<form ... action = "submit">
<input name ="${dw.web.CSRFProtection.getTokenName()}"
value = "${dw.web.CSRFProtection.generateToken()">
...
<the rest of the Form fields>
...
</form>
To implement CSRF protection when the form is submitted, the developer needs to introduce the CSRF validation using one or both of these methods as applicable:
* validateRequest
* validateAjaxRequest
Where in the code does the developer need to add this CSRF validation check?

Question27: A merchant uploads an image using the Content Image Upload module of Business Manager.
Which three modules can the merchant or developer use to display the image on the Storefront7 Choose 3 answers

Question28: A merchant checked the "Show Orderable Products Only" preference in Business Manager. What impact does this have on the Storefront from a user perspective?

Question29: Given a template rendered by a controller with caching and a remote include without caching, which situation applies?

Question30: Universal Containers wants to add a model field to each product. Products will have locale-specific model values.
How should the Digital Developer implement the requirement?

Question31: A developer is asked to write a log containing the ID and name of the product with a variable named myProduct.
Which snippet of code should be used?

Question32: Given the customer basket described below:
* A customer has an existing basket that consists of multiple items.
* One of the items is identified as a gift item by an attribute at the product line item.
The developer needs to write custom code to fetch the customer basket and then modify the basket based upon the items in the cart. If the basket contains any gift items, modify the basket and create a separate shipment for the gift item.
Four hooks are required to make the modification, beginning with modifyGETRespone and ending with validatebasket.
* Dw.ocapi.shop.basket.modifyGETResponse
* -- missing hook -
* -- missing hook --
* dw.ocapi.shop.basket.validateBasket
What are the two missing hooks in the middle?

Question33: Which code sample is required to use a custom tag provided in SiteGenesis in an ISML template?

Question34: A Digital Developer wants to selectively retrieve products and process them from an iPhone.
Which action should the Developer take, given that JavaScript controllers CANNOT be used?

Question35: A Digital Developer needs to check for product inventory in a specific inventory list using the Open Commerce API.
An example request URL is:

Which resource_id value enables the appropriate resource?

Question36: A developer wants to add a link to the My Account Page.
What is the correct code to accomplish this?

Question37: A developer is given the requirement to add a step to the existing business logic of the registration process. How should the developer modify the route that handles the customer registration?

Question38: Refer to the screen shot below:

Given a site called RefArch that has the settings shown, what must be done for RefArch to use the same customer list as RefArchGlobal?

Question39: The developer is asked to enhance the functionality of an existing controller route by adding information to the response's viewData.
How should the developer approach this task while following SFRA best practices?

Question40: A client uses tax tables in Business Manager to calculate tax. They recently started shipping to a new country, Italy, and the taxi s not being calculated correctly on the Storefront What is the likely problem?

Question41: A Digital Developer adds the following line of code to a script.

The code executes without error; however, the log file on disk does NOT contain the log message.
Which two actions should be completed to write the log message to disk? (Choose two.)

Question42: A developer uses the call() instance method of dw.svc.Service to invoke a web service and implemented the callback methods defined by the dw.avc.ServiceCaliback class.
Which callback method is required only when invoking a SOAP service?

Question43: A Digital Developer is inspecting the weekly service status report for a critical internally-hosted web service used in the application and notices that there are too many instances of unavailability.
Which two solutions are possible options to reduce the unavailability of the service? (Choose two.)

Question44: Universal Containers requires that a new order comments attribute is added to the existing SiteGenesis checkout flow. This new attribute needs to be included as part of the standard order export.
Aside from updating the HTML markup and form definition, which option contains all necessary steps to achieve this task?

Question45: The following code ensures that an address ID CANNOT be used if it is already in use by another address in the customer's address book. There is a problem with the code. The error message for an invalid address ID is never shown to the user on the form field.

How should the Digital Developer resolve this issue so that the error message is displayed on the address ID form field?

Question46: A developer wants to use an external application to manage their stores information (such as opening hours, and so on), and see their changes in their B2C Commerce Staging instance aas son as they are saved.
What is the appropriate technique the developer should perform to allow the merchant to create a new store in this scenario?

Question47: Which three configuration does a developer need to ensure to have a new product visible in the Storefront?
Choose 3 answers

Question48: A merchant has a new requirement to accept American Express credit cards on its Storefront. A credit card payment method already exists.
Which step must a developer take in Business Manager to achieve this?

Question49: A developer is writing a server side script that needs to maintain state across calls. The persistent information needed includes these items.
* The current customer
* Whether or not the customer is authenticated
* The privacy attributes (such as tracking consent or cookie policy)
Which technique should the developer use to maintain state in an efficient and scalable manner that follows best practice?

Question50: A client sells its product in single-brand stores as well as in multi-brand stores. When shown in the store locator list, the client wants the single-brand stores to have a particular background color to highlight them.
Which Business Manager action should be completed to allow the developer to apply different styling to the single-brand stores?

Question51: The client provides the system integrator with translation messages for the newly added "French" ("fr") locale.
What is the correct folder to store the associated .properties files?

Question52: Given the following snippet:
* Server.append( 'Show' , function (req, res, next) )
According to SFRA, which two options shows a correct way to complete the code above in order to provide data to the response using a controller?
Choose 2 answers

Question53: The following sample code is NOT providing the desired results. The Digital Developer needs to add an entry to the logs to debug the problem.

Which statement correctly adds a log entry?

Question54: Universal Containers specifies a new category hierarchy for navigating the digital commerce storefront. A Digital Developer uses Business Manager to manually create a catalog with the specified category hierarchy, then uses the Products & Catalogs > Import & Export module to export the catalog as a file.
How can other Developers with sandboxes on the same realm create the same catalog in their own sandboxes?

Question55: A developer needs to update the package.json file so that it points to the hock file for a cartridge, using the hooks keyword. Which snippets work correctly when added to the file?:

Question56: A client has two B2C Commerce sites in the same instance: one for the U.S market, the other for the European market. The products they make are sold with different safety certificates based-on the world location.
For example, they sell a smartphone with certificate A in the U.S and certificate B in Europe, a hairdryer with certificate C in the U.S and certificate D in Europe, and more.
How should a developer allow the merchant to display the appropriate certification logo in the produce to details page, depending on the customer's location?

Question57: A Digital Developer is asked to optimize controller performance by lazy loading scripts as needed instead of loading all scripts at the start of the code execution.
Which statement should the Developer use to lazy load scripts?

Question58: A Digital Developer must resolve a performance issue with product tiles. The Developer determines that the product tiles are NOT being cached for a long enough period.
Which two methods can the Developer use to verify the cache settings for the product tiles? (Choose two.)