Be able to choose the right LWC communication mechanism — @api, CustomEvent with bubbles/composed, or Lightning Message Service — and handle dates and translations with Intl, Custom Labels, and locale-aware formatting. The critical detail is setting composed on events that must cross shadow boundaries.
Start practicing
User Interface — choose a session length
Free · No account required
Domain overview
The User Interface domain of Salesforce Certified Platform Developer II covers Lightning Web Components: composition, inter-component communication, rendering lifecycle, and localization. Questions present concrete LWC scenarios — nested hierarchies, shadow boundaries, timezone-aware date display, and internationalization — and ask you to select the correct API, event configuration, or Salesforce feature to implement the requirement.
Exam objectives
Lightning Message Service and pub-sub for cross-DOM communication beyond parent-child boundaries
CustomEvent with bubbles and composed flags to cross shadow boundaries in LWC hierarchies
JavaScript Intl object and Lightning formatted date/time for user-timezone display in LWC
Custom Labels and Salesforce locale/translation workbench for internationalizing LWC text and formatting
Assuming a bubbling CustomEvent crosses shadow boundaries by default; composed must be set to true explicitly.
Using Lightning Message Service when a simple parent-to-child @api property or method would suffice.
Hardcoding date formats or locale strings instead of using Intl or Salesforce-provided formatting and translation features.
Click any question to see the full explanation and answer options, or start a focused practice session above.
A developer is building a complex nested Lightning Web Component structure. A deeply nested child component needs to notify an ancestor component, which is not the immediate parent, about a data change. Which configuration of the CustomEvent constructor should the developer use to ensure the event reaches the ancestor across the shadow DOM boundary?
2A developer is tasked with internationalizing a Lightning Web Component that will be deployed globally. Which TWO Salesforce features should be used to handle locale-specific formatting and translations? (Choose TWO)
3A developer is creating a Lightning Web Component to display a list of high-priority Opportunities. The component needs to reactively update whenever an Opportunity is updated elsewhere on the page by another component. Which approach is most efficient and requires the least amount of custom code?
4A developer wants to ensure that a Lightning Web Component is only available for use on Record Pages for the Account and Contact objects in the Lightning App Builder. How should the developer configure the component's metadata file?
5A developer is experiencing performance issues with a Visualforce page that includes multiple complex components and a large amount of data. The page uses a standard controller with several extensions. Which technique should the developer use to reduce the view state size and improve page load time?
6Refer to the exhibit. A developer is attempting to push source code to a scratch org and encounters the error shown. The developer confirms that 'utils.js' and 'utils.js-meta.xml' exist in the 'force-app/main/default/lwc/utils/' directory. What is the most likely cause of this error?
7A developer is building a Lightning Web Component that needs to display a formatted date and time based on the user's timezone. Which standard JavaScript object, compatible with LWC, should be used to handle this without additional libraries?
8A developer is building a Lightning Web Component that needs to communicate with a parent component in a deep containment hierarchy. The event must traverse shadow boundaries without stopping at component boundaries. Which property configuration should the developer apply when instantiating the CustomEvent?
9An enterprise Salesforce implementation requires a Lightning Web Component to display massive amounts of tabular data with extremely high rendering performance. The standard lightning-datatable component fails to meet performance SLAs during stress testing. Which architectural approach should the developer implement to optimize rendering performance?
10A developer is building a Lightning Web Component for a Lightning Experience record page. The component must display a toast notification to the user after a successful save operation. The developer uses the ShowToastEvent from the lightning/platformShowToastEvent module. Which import statement is correct?
11A developer is creating a Lightning Web Component that includes a lightning-input field for a phone number. The component must validate that the input matches a specific pattern before allowing the user to submit a form. The developer wants to use the built-in validation features of lightning-input. Which attribute should be set to enforce a custom validation pattern?
12A developer is building a Lightning Web Component for a Lightning Experience app. The component contains a form with an <input> for a search term and a list of results. When the user types into the input, the component must call an Apex method that returns matching records. The developer observes that the Apex method is being invoked on every keystroke, causing excessive server calls. Which technique should the developer use to limit the number of Apex calls while still updating the results as the user types?
13A developer is creating a Lightning Web Component that includes a button. When the button is clicked, the component should call an Apex method to save data. Which decorator should be used to expose the Apex method to the Lightning Web Component?
14A developer is creating a Lightning Web Component that must expose a public property so that a parent Aura component can pass a record ID into it. The LWC is embedded inside the Aura component using aura:component with an attribute. Which decorator and configuration should the developer use on the LWC property?
15A developer is creating a Lightning Web Component that needs to display a list of Contacts for a given Account. The component will be placed on a Lightning record page for Account. The developer wants to use the getRelatedListRecords wire adapter from lightning/uiRelatedListApi to fetch the contacts. Which two parameters are required in the wire configuration object for getRelatedListRecords? (Choose two.)
16A developer is building a Lightning Web Component that must expose a public method so a parent component can programmatically trigger a refresh of the child's data. The child component's method is decorated with @api and named refreshData. The parent component holds a template reference to the child element. Which code in the parent correctly invokes the child method?
17A developer has a Lightning Web Component named accountTile that exposes a public property accountName decorated with @api. A parent Aura component includes accountTile using <c:accountTile accountName="Acme"/>. During testing, the account name never appears. The developer confirms the property is set in the LWC constructor. What is the cause?
18A developer is building a Lightning Web Component that includes a lightning-button. The button's click handler is defined as an arrow function in the component's JavaScript file. The developer wants to pass the event object to the handler to access the event's target. Which syntax should be used in the component's HTML template to correctly bind the handler and pass the event?
19A developer is building a Lightning Web Component that must surface a toast notification when an Apex callout returns a specific error code. The component is used inside a Salesforce mobile app and on desktop. Which module should the developer import to display the toast?
20A developer is building a Lightning Web Component that includes a button. When the button is clicked, the component must navigate the user to a specific Account record page in Lightning Experience. Which approach should the developer use?
21A developer is building a Lightning Web Component that needs to navigate to a specific record page when a user clicks a button. The developer wants to use the NavigationMixin from lightning/navigation. The component is a child component nested inside another component, and the developer needs to ensure that the navigation works correctly. Which code snippet correctly uses NavigationMixin to navigate to an Account record page?
22A developer is building a Lightning Web Component that must render a large list of order records retrieved from Apex. The component displays each order's formatted total, which follows the user's locale (for example, 1.234,56 € in Germany versus $1,234.56 in the US). Which approach correctly formats each order total for the current user?
23A developer needs a Lightning Web Component to expose a public method so that an Aura component on the same page can call it and pass a string parameter. Which approach should the developer use?
24A developer is building a Lightning Web Component that must display a toast notification when a record is saved successfully. The component uses lightning/platformShowToastEvent. Which import and usage are correct?
25A developer is creating a Lightning Web Component that needs to display a toast message when a record is saved successfully. The developer imports ShowToastEvent from lightning/platformShowToastEvent. Which code correctly dispatches a success toast with the title 'Saved' and message 'Record saved successfully'?
26A developer is building a Lightning Web Component that must navigate the user to a new record's detail page after a successful Apex DML operation. Which module should the developer use to perform the navigation?
27A developer needs a Lightning Web Component placed on a record page to read the 18-character id of the record currently being viewed, without querying the database or calling Apex. Which approach provides this value directly?
28A developer is building a Lightning Web Component that must expose a method to an Aura component wrapper so the Aura component can call it after a user action. The LWC method is decorated with @api and named doSomething. Which code in the Aura component correctly invokes it?
29A developer needs to display a read-only, formatted phone number on a Lightning record page. The value comes from a field on the record and should render consistently with Salesforce's standard phone formatting. Which base component should be used?
30A developer is building a Lightning Web Component that must call an Apex method that performs a callout. The component is placed on a Lightning record page, and the Apex method is annotated with @AuraEnabled(cacheable=true). Users report that the callout never executes and an error is thrown. What is the most likely cause and the correct fix?
31A developer is building a Lightning Web Component that must expose a public method callable from an Aura component on the same page. The method accepts a string and returns a promise that resolves with a boolean. Which TWO steps are required to make this method callable from the Aura parent? (Choose two.)
32A developer is creating a Lightning Web Component that will be placed on a Lightning record page for the Case object. The component must display the case's subject and status. Which approach correctly retrieves the record data so the component updates automatically when the record changes?
33A developer is building a Lightning Web Component that renders a custom list of navigation links. The component must follow the Salesforce Lightning Design System (SLDS) styling and remain accessible to screen readers. Which approach best satisfies both the styling and accessibility requirements?
34A developer is building a Lightning Web Component that contains an iframe hosting an external web application. The external application needs to send a message back to the Lightning Web Component when a user completes a task. Which mechanism should the developer use to receive that message securely?
35A developer is building a Lightning Web Component that must navigate to a new record's detail page after the record is created via a custom form. The component uses NavigationMixin. Which navigation type should the developer use to navigate to the newly created record?
36A developer has a Lightning Web Component that must call an imperative Apex method to save a record, then immediately display a toast confirming success only if the save actually succeeded. The Apex method returns a wrapper with a Boolean success flag and a message. Which imperative call pattern correctly handles both the success and error paths?
37A developer is building a Lightning Web Component that should be embedded inside a Visualforce page. The LWC must receive a parameter passed from the Visualforce page and send an event back when a button is clicked. Which combination of features enables this integration?
38A developer is building a reusable Lightning Web Component that exposes public properties and methods to its parent, and needs to fire an event the parent can handle. Which TWO techniques are valid for this parent-child interaction? (Choose two.)
39A developer needs a Lightning Web Component to navigate the user to a specific Account record's detail page when a button is clicked. Which approach is correct?
Be able to choose the right LWC communication mechanism — @api, CustomEvent with bubbles/composed, or Lightning Message Service — and handle dates and translations with Intl, Custom Labels, and locale-aware formatting. The critical detail is setting composed on events that must cross shadow boundaries.
The Courseiva SF-PD2 question bank contains 39 questions in the User Interface domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the User Interface domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included