Courseiva

SF-PD2 · topic practice

User Interface practice questions

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.

Courseiva uses original exam-style practice questions designed for learning and revision. The goal is to understand the concepts, recognise exam patterns, and improve through explanations — not memorise copied exam dumps.

Editorial oversight:Johnson Ajibi· MSc IT Security, IEEE Senior Member
20 questionsDomain: User Interface

What the exam tests

What to know about User Interface

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.

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

Watch out for

Common User Interface exam traps

  • ▸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.

Practice set

User Interface questions

20 questions · select your answer, then reveal the explanation

A company wants to implement a multi-page form in a Lightning Experience Console app that allows users to navigate between stages while maintaining state. Which TWO features of the Lightning Workspace API should a developer use to enhance the user experience by managing tab behavior? (Choose TWO)

Question 2mediummultiple choice
Read the full User Interface explanation →

Refer to the exhibit. A developer is using the getRecord wire adapter in a Lightning Web Component with the configuration shown. If the current user does not have FLS (Field Level Security) access to the 'Phone' field, what will be the result when the wire service executes?

Exhibit

{
  "apiName": "Account",
  "fields": ["Name", "Industry"],
  "optionalFields": ["Phone"]
}

A developer needs to integrate a third-party JavaScript library that performs complex data visualizations within a Lightning Web Component. The library is stored as a Static Resource. What is the correct pattern for loading this library and ensuring it is initialized only after it is fully loaded?

When migrating an existing Aura component to Lightning Web Components, which THREE factors must the developer consider regarding interoperability and composition? (Choose THREE)

A developer needs to ensure that a Lightning Web Component's CSS styles do not leak out to other components on the page and that global styles do not affect the component's internal structure. Which TWO concepts describe how LWC achieves this? (Choose TWO)

A developer wants to use the Lightning Message Service (LMS) to communicate between a Visualforce page and a Lightning Web Component on the same Lightning Page. Which TWO steps are required to implement this? (Choose TWO)

Question 7mediummultiple choice
Read the full User Interface explanation →

A developer needs to build a custom Lightning Web Component that dynamically loads child components based on user interaction without waiting for the initial page load. Which approach should the developer use to optimize performance and rendering?

A developer is building a Lightning Web Component that is placed on a Lightning record page. A child component nested inside the same template fires a custom event named `recordselected` that bubbles and is composed. The parent template listens for the event. During testing, the parent's handler never runs, and the console shows the event was dispatched. Which change should the developer make so the parent handler receives the event?

A developer is building a Lightning Web Component that needs to communicate with a parent Aura component. The LWC is nested inside the Aura component. The developer wants to send data from the LWC to the Aura component. Which two methods can be used to achieve this? (Choose two.)

Question 10mediummultiple choice
Read the full User Interface explanation →

A developer is creating a Lightning Web Component that must be used as a quick action on the Account object. The component needs to display the account's name and allow the user to update the account's phone number. The developer wants to ensure the component receives the record ID and can access the record data. Which approach should the developer use?

Question 11mediummultiple choice
Read the full User Interface explanation →

A developer is building a Lightning Web Component that must call an Apex method and immediately display the returned Account records. The Apex method is decorated with @AuraEnabled(cacheable=true). The developer wants the component to refresh its data whenever the record page's data changes. Which approach should the developer use?

A developer is building a Lightning Web Component that displays a list of contacts for a given account. The component uses the getRecord wire adapter to retrieve the account's contacts. The developer wants to ensure the component updates automatically when the contact records change on the server. Which two actions should the developer take? (Choose two.)

Question 13mediummultiple choice
Read the full User Interface explanation →

A developer is building a Lightning Web Component that must call an Apex method to retrieve a list of Accounts and display them. The Apex method is annotated with @AuraEnabled(cacheable=true). The developer writes the following import statement: import getAccounts from '@salesforce/apex/AccountController.getAccounts'; and then calls it in a wire adapter. Which wire adapter should the developer use to invoke this Apex method?

A developer is building a Lightning Web Component that must render a list of contacts and allow the user to select multiple contacts to delete. The component uses lightning-datatable with a custom data source. Which TWO actions must the developer take to handle row selection and deletion correctly? (Choose two.)

Question 15hardmultiple choice
Read the full User Interface explanation →

A developer is building a Lightning Web Component that must display a custom UI in a Visualforce page using Lightning Out. The component uses the lightning/navigation module to navigate to a record page. When the component is rendered in the Visualforce page, the navigation fails. What is the most likely cause?

Question 16hardmultiple choice
Read the full User Interface explanation →

A developer is creating a Lightning Web Component that renders a list of contacts fetched imperatively with getRecord or a wire adapter. Each row has a button that opens a custom modal defined in the same component. The developer wants the modal markup to exist in the DOM only while it is open, and wants to avoid a full page navigation. Which approach best satisfies these requirements?

Question 17hardmultiple choice
Read the full User Interface explanation →

A developer is building a Lightning Web Component hosted inside a Visualforce page via lightning:container. The component needs to invoke an Apex method that returns sensitive data. The developer wants the call to run in the user's context and respect Apex sharing rules, without exposing the method to unauthenticated callers. Which approach should be used?

A developer is building a Lightning Web Component for a Lightning Experience record page that must display field values from the current record and re-render automatically whenever the user edits and saves those fields on the page. The component should not make its own Apex callout. Which TWO techniques should the developer use to meet these requirements? (Choose two.)

Question 19mediummultiple choice
Read the full User Interface explanation →

A developer is creating a Lightning Web Component that must be placed on a Lightning record page for the Case object. The component needs to read the record Id from the page context and then perform an imperative Apex call. Which approach correctly obtains the record Id in the component?

A developer is building a Lightning Web Component that displays a list of contacts and must allow the user to navigate to a selected contact's record page. The component is deployed both to Lightning Experience and to a Salesforce mobile app. Which TWO techniques are supported for performing this navigation? (Choose two.)

Free account

Track your progress over time

Create a free account to save your results and see which topics improve across sessions.

Focused User Interface sessions

Start a User Interface only practice session

Every question in these sessions is drawn from the User Interface domain — nothing else.

Related practice questions

Related SF-PD2 topic practice pages

Move into related areas when this topic feels solid.

Frequently asked questions

What does the SF-PD2 exam test about User Interface?
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.
How should I use these practice questions?
Select your answer before revealing the explanation. Then read why each option is right or wrong — this active recall approach builds retention far faster than re-reading notes.
Can I practise just User Interface questions in a focused session?
Yes — the session launcher on this page draws every question from the User Interface domain. Use a 10-question session first to gauge your baseline, then move to 20 or 30 once the weak spots are clear.
Where can I practise other SF-PD2 topics?
Use the topic links above to move to related areas, or go back to the SF-PD2 question bank to see all topics.
Are these real exam questions or dumps?
These are original practice questions written to test the same concepts the SF-PD2 exam covers. They are not copied from any real exam or dump site.