Courseiva

SALESFORCE-PD1 · domain

User Interface

Practise Salesforce Certified Platform Developer I (SALESFORCE-PD1) User Interface practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

122 questions40 easy43 medium39 hard

Focused practice

Practice User Interface questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about User Interface

User Interface questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common User Interface exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Question index

All User Interface questions (122)

Click any question to see the full explanation, or start a practice session above.

1

A developer is writing a Visualforce page and wants to include standard Salesforce styling and icons. What tag should be added to the top of the Visualforce page?

Easy
2

Which lifecycle hook in a Lightning Web Component is called after every render of the component?

Easy
3

An LWC component uses a wire adapter to fetch account records. The developer needs to update the parameters passed to the wire adapter dynamically based on user input. How should this be implemented?

Medium
4

A developer is building a Lightning Web Component and wants to define a property that can be set by a parent component. Which decorator is required?

Easy
5

Which THREE statements are true regarding the standard Salesforce Lightning Design System (SLDS)? Choose 3 answers.

Easy
6

A developer is writing a Visualforce page and wants to display messages generated by controllers or validation rules. Which component should be used?

Easy
7

Which TWO statements are true regarding the differences between Aura components and Lightning Web Components (LWC)? (Choose TWO)

Easy
8

Which THREE features or capabilities are supported by the Lightning Message Service (LMS)? Choose 3 answers.

Hard
9

A developer is configuring a Lightning Web Component to be used as a Quick Action on a record page. Which target configuration must be added to the component's metadata file?

Hard
10

A developer is building a Visualforce page and wants to execute an action method on the controller when a user clicks a button, without performing a full page reload. Which component should be wrapped around the area to be updated?

Medium
11

A developer is troubleshooting an issue where a Lightning Web Component is not picking up changes to the internal fields of an object property. What is the cause of this behavior in LWC reactivity?

Hard
12

Which TWO tools or features are recommended for styling Lightning Web Components according to best practices? Choose 2 answers.

Easy
13

A developer creates a Visualforce page and wants to include standard Salesforce styling. Which attribute on the <apex:page> tag enables this?

Easy
14

A developer is working with component styling and design tokens in Lightning Web Components. Which TWO practices apply when working with SLDS styling in LWC? (Choose TWO)

Medium
15

A developer is building a Lightning Web Component and wants to iterate over a list of items in the HTML template. Which directive should be used?

Medium
16

Which base Lightning component should be used in an LWC to display a standard button?

Easy
17

A developer needs to create a Lightning Web Component configuration file. What is the required file extension and naming convention?

Easy
18

A developer is using the Lightning Message Service and needs to unsubscribe from a message channel when a component is destroyed. In which lifecycle hook should unsubscribe be called?

Hard
19

A developer is writing an Aura component and needs to handle an event fired by a child component. Which attribute is required in the aura:handler tag on the parent component?

Medium
20

Which base Lightning component is used to show a progress indicator or spinner in LWC?

Easy
21

Which TWO tools or environments are officially supported for developing Lightning Web Components? (Choose TWO)

Easy
22

A developer creates a parent Lightning Web Component containing a child component. The parent needs to call a public method defined inside the child component. How is this accomplished?

Hard
23

A developer is building a Lightning Web Component and wants to style it using Salesforce Lightning Design System (SLDS). Which TWO statements are true regarding SLDS usage in LWC? (Choose TWO)

Easy
24

A developer is utilizing the Lightning Message Service (LMS) to facilitate communication between an Aura component and a Lightning Web Component. Which THREE steps are required to implement LMS successfully? (Choose THREE)

Hard
25

A developer is building an Aura component and needs to include a Lightning Web Component inside it. How does the Aura markup reference the LWC?

Medium
26

Which TWO conditions must be met for an Apex method to be wired using the @wire service in an LWC? Choose 2 answers.

Medium
27

A developer creates a custom LWC that wraps child components. The developer needs to pass styling from the parent component into specific slots of the child component. Which CSS selector should be used inside the child component to style content passed into a slot?

Hard
28

A developer is implementing communication in Lightning Web Components. Which TWO mechanisms are valid for passing data or messages between components? (Choose TWO)

Medium
29

A developer needs to display a toast notification in a Lightning Web Component when a record is successfully saved. Which module should the developer import?

Medium
30

Which tag is used in Visualforce to output field labels and values dynamically based on sObject field definitions?

Easy
31

A developer is troubleshooting lifecycle hooks and rendering behavior in a Lightning Web Component. Which THREE statements are correct regarding LWC lifecycle execution order? (Choose THREE)

Hard
32

What is the correct syntax to reference a custom label in a Lightning Web Component JavaScript file?

Easy
33

A developer needs to pass data from a child Lightning Web Component to a parent Lightning Web Component up the component hierarchy. What is the standard mechanism to achieve this?

Hard
34

A developer is configuring a Lightning Web Component to accept design attributes in the Lightning App Builder. Which THREE files make up a complete LWC bundle that supports App Builder configuration properties? (Choose THREE)

Medium
35

A developer needs to include a third-party style sheet in a Lightning Web Component. What is the standard way to load CSS styles that are stored as a static resource?

Medium
36

Which CSS methodology forms the foundation of the styling architecture in Salesforce Lightning Design System (SLDS)?

Easy
37

A developer is working with the Lightning Data Service (LDS) via the @wire decorator to get record data. The record is updated elsewhere in the app, and the developer wants to imperatively refresh the wire data cache. Which function should be called?

Hard
38

A developer is building a Lightning Web Component and needs to dispatch a custom event. Which constructor should be used to create the event?

Medium
39

A developer is working with a Visualforce page and wants to display a list of Account records using standard styling that matches the Salesforce Classic UI. Which component should the developer include?

Medium
40

Which TWO methods can be used to navigate to a standard Salesforce object's home page from a Lightning Web Component? Choose 2 answers.

Medium
41

A Lightning Web Component needs to communicate an event up to a grandparent component that is nested two levels above. What is the best practice to achieve this in LWC?

Hard
42

A developer needs to navigate to a record detail page from a Lightning Web Component. Which service should be used?

Medium
43

A developer wants to conditionally display an HTML element in a Lightning Web Component template based on a boolean property named 'isVisible'. Which directive should be used?

Medium
44

A developer is designing a Lightning Web Component that needs to communicate with another component located anywhere in the application hierarchy, including unrelated components. Which TWO mechanisms are valid and appropriate for this requirement? Choose 2 answers.

Medium
45

A developer needs to configure a Lightning Web Component to be available for use on Lightning Record Pages. Which configuration entry must be present in the component's metadata file (.js-meta.xml)?

Medium
46

Which tag is used in Visualforce to include custom CSS stylesheets?

Easy
47

A developer needs to format a currency value according to the user's locale in a Lightning Web Component HTML template. Which base component should be used?

Medium
48

A developer needs to create a custom tab for a Lightning Web Component so it can be navigated to from the App Launcher. What type of custom tab must be created?

Easy
49

A developer is working with a Lightning Web Component and needs to access a child component's public method from the parent component. How is this achieved?

Hard
50

A developer is styling a Lightning Web Component using the Salesforce Lightning Design System (SLDS). To ensure the component adheres to the standard styling guidelines for spacing, what should the developer use?

Easy
51

A developer has created a custom Aura component that needs to be embedded within a Lightning Web Component. What is the correct rule regarding component composition between Aura and LWC?

Medium
52

Which lifecycle hook in a Lightning Web Component runs after every render of the component?

Easy
53

A developer is configuring a Lightning Web Component metadata file to allow the component to be placed on a FlexPage. Which tag defines the configuration regions or design properties?

Medium
54

A developer is creating a Lightning Web Component that needs to display a list of Accounts. The developer wants to fetch the data imperatively when a user clicks a button rather than automatically via a wire adapter. What is the correct approach?

Medium
55

A developer wants to style a Lightning Web Component using the Salesforce Lightning Design System (SLDS). What is the recommended way to include SLDS styling?

Easy
56

Which TWO features are provided out-of-the-box by Visualforce when building standard user interfaces? (Choose TWO)

Easy
57

A developer wants to prevent sensitive fields from being included in the Visualforce view state to reduce size. Which keyword should be added to the field declaration in the controller?

Medium
58

Which TWO configuration files or metadata elements are required when creating a Lightning Web Component? Choose 2 answers.

Medium
59

Which TWO actions can a developer perform using standard Visualforce controllers? Choose 2 answers.

Easy
60

Which SLDS utility class should a developer use to add a standard margin around a container?

Easy
61

A developer is creating a Lightning Web Component that needs to interact with Salesforce data using Lightning Data Service. Which TWO wire adapters are natively available in the @salesforce/apex or lightning/ui* modules for basic record operations? (Choose TWO)

Easy
62

A developer is creating a Visualforce page that overrides the standard Account View action. Which attribute must be included in the <apex:page> tag to ensure standard controller functionality?

Easy
63

A developer is implementing error handling for an imperative Apex call in a Lightning Web Component. Which THREE properties or techniques are standard for catching and inspecting errors returned from Apex promises? (Choose THREE)

Hard
64

A developer is reviewing a Lightning Web Component that makes calls to an Apex controller. Which THREE best practices should be followed when designing the Apex methods for LWC consumption? (Choose THREE)

Hard
65

A developer is building a Lightning Web Component and needs to navigate to a URL that is external to Salesforce. Which PageReference type should be used with NavigationMixin?

Medium
66

Which TWO lifecycle hooks are available in Lightning Web Components? Choose 2 answers.

Easy
67

A developer is building a Lightning Web Component and needs to perform validation on an input field before submission. Which method on a lighting-input element checks validity?

Medium
68

Which THREE statements are true regarding Lightning Web Component shadow DOM encapsulation? Choose 3 answers.

Hard
69

A developer is writing a Lightning Web Component and needs to load a third-party JavaScript library (such as D3.js) stored as a static resource. Which lifecycle hook is most appropriate for initiating the load using loadScript?

Hard
70

Which tag is used in Visualforce to iterate over a collection of records and display them in a table?

Easy
71

Which base component should be used in LWC to display a tabular grid of data with sorting and row selection?

Easy
72

Which tool or feature should a developer use to test Lightning Web Components locally on their workstation without deploying to Salesforce every time?

Easy
73

A developer needs to execute initialization logic as soon as a Lightning Web Component is inserted into the DOM. Which lifecycle hook should be used?

Medium
74

A developer is building a Lightning Web Component and needs to listen to a custom event dispatched by a child component. How is the event listener attached in the parent HTML template?

Hard
75

A developer is building a Lightning Web Component that includes a custom wire adapter to fetch custom metadata. The wire adapter needs to react whenever a tracked property changes value. How should the developer wire the property?

Hard
76

A developer needs to retrieve Salesforce data in a Lightning Web Component without writing imperative Apex. Which module should be imported to use the wire service for standard record data?

Medium
77

A developer creates a Lightning Web Component that includes a third-party JavaScript library loaded via a Static Resource. In which lifecycle hook should the third-party library be initialized?

Hard
78

A developer is building a Visualforce page that uses a custom controller and needs to display a message to the user when an error occurs. Which class and method should be used?

Medium
79

Which annotation must be used on an Apex method to make it available for use with the @wire service in a Lightning Web Component?

Easy
80

A developer is implementing a Lightning Web Component with a custom CSS file. How does the component load its associated stylesheet?

Medium
81

A developer is troubleshooting a Lightning Web Component where data retrieved via the @wire service needs to be formatted before being rendered in the template. Which THREE approaches are valid ways to handle or transform wired data? Choose 3 answers.

Hard
82

Which TWO ways can a developer trigger a server-side Apex method imperatively from a Lightning Web Component? Choose 2 answers.

Medium
83

A developer is creating a Lightning Web Component and needs to style a child component from a parent component across the shadow DOM boundary. What feature enables custom styling hooks?

Hard
84

A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should the developer use?

Easy
85

A developer is implementing navigation in a Lightning Experience app using the NavigationMixin service in a Lightning Web Component. The developer wants to navigate to a standard ListView for the Account object. What is the correct type to specify?

Hard
86

A developer is troubleshooting a Lightning Web Component where data returned from an Apex wire adapter needs to be mutated before being rendered. What is the correct pattern to handle this?

Hard
87

What is the correct file extension for a Lightning Web Component HTML template file?

Easy
88

A developer is configuring a Lightning Web Component that uses the Lightning Message Service (LMS). Which module must be imported to publish a message on a message channel?

Hard
89

Which THREE actions should a developer take to optimize Visualforce view state performance? Choose 3 answers.

Hard
90

A developer is writing a Visualforce page with custom controller logic and needs to ensure that database operations are executed transactionally. What happens by default when an unhandled exception occurs during a controller action method?

Medium
91

A developer is building a Lightning Web Component that needs to fetch records imperatively based on a user interaction. Which Lightning module should the developer import to access Salesforce data imperatively in JavaScript?

Medium
92

A developer has a Lightning Web Component with a reactive property 'recordId'. How should the property be decorated to ensure it receives the current record ID when placed on a record page?

Medium
93

A developer wants to include a custom styling hook to override a standard Lightning Design System component token in a Lightning Web Component. Where should this CSS custom property be defined?

Easy
94

Which SLDS grid class should be used to create a flexible container where items wrap automatically onto multiple rows?

Easy
95

What is the maximum number of view state bytes allowed in a Visualforce page before Salesforce throws an error?

Easy
96

Which TWO techniques can be used to pass data from a parent component to a child Lightning Web Component? Choose 2 answers.

Medium
97

A developer creates a Lightning Web Component that consumes data from a wire adapter. The wire adapter returns an object with 'data' and 'error' properties. What is this pattern called in LWC?

Hard
98

A developer is building a Lightning Web Component that must be made available for use on Lightning Record Pages. Which configuration tag must be included in the component's metadata file?

Easy
99

A developer is writing a Lightning Web Component and needs to conditionally render a block of HTML markup based on a boolean property named 'isVisible'. What is the correct syntax in the HTML template?

Hard
100

A developer needs to catch unhandled JavaScript errors in a Lightning Web Component hierarchy so the entire app doesn't crash. Which lifecycle hook handles errors thrown by descendant components?

Hard
101

Which THREE requirements must be met when implementing a custom Lightning Web Component pagination control? Choose 3 answers.

Hard
102

Which TWO actions should a developer take when handling errors returned by an imperative Apex call in a Lightning Web Component? Choose 2 answers.

Medium
103

A developer is creating a reusable LWC utility and needs to invoke an Apex method imperatively. The method accepts a record ID parameter. What is the correct way to pass this parameter in JavaScript?

Medium
104

Which tag is used in Visualforce to embed JavaScript code directly inside the page?

Easy
105

A developer is writing a custom wire adapter or working with custom data in LWC and needs to manually provision data or force a refresh of wire data. Which function should be imported from lightning/uiRecordApi or related wire modules?

Hard
106

A developer is designing a Lightning Web Component that needs to be conditionally displayed in different Salesforce containers. Which TWO targets are valid entries in the component's js-meta.xml configuration file? (Choose TWO)

Medium
107

A developer is creating a Lightning Web Component and needs to iterate over a list of items in the HTML template. Which directive should be used?

Medium
108

Which THREE strategies are recommended for improving the performance of Lightning Web Components rendering large lists of data? Choose 3 answers.

Hard
109

A developer is working with a Lightning Web Component and needs to ensure reactive updates occur when an object property or array element changes inside a tracked property. What is the correct approach in modern LWC?

Hard
110

A developer is implementing a Lightning Web Component that handles drag-and-drop functionality. Which native DOM event is typically intercepted to allow a drop action on an element?

Hard
111

A developer is implementing a Visualforce page that displays a list of accounts and needs to ensure that it adheres to Salesforce security best practices by preventing cross-site scripting (XSS) attacks. Which tag or attribute combination should be used to securely output user-supplied data?

Hard
112

A developer is writing an Aura component and needs to dynamically create a component at runtime. Which JavaScript method should be used?

Hard
113

A developer needs to access a specific HTML element in a Lightning Web Component template imperatively. Which method should be called?

Hard
114

A developer is writing a Visualforce page that uses a custom controller. The page needs to execute an action method as soon as the page loads, without requiring user interaction. Which attribute on <apex:page> should be used?

Medium
115

A developer is working with a Lightning Web Component that uses the @wire decorator to provision data from an Apex method. The Apex method depends on a property that changes dynamically. How should the property be prefixed to signal reactivity to the wire service?

Medium
116

A developer is implementing a custom pagination mechanism in a Lightning Web Component. The component uses an Apex controller method that returns a list of records. Which technique prevents excessive heap size and improves performance when dealing with large datasets?

Hard
117

Which THREE practices are considered security best practices when developing custom Visualforce pages to prevent Cross-Site Scripting (XSS)? Choose 3 answers.

Hard
118

A developer needs to ensure that a Lightning Web Component can be placed on a Record Page for an Account in the Lightning App Builder. What must be configured in the component's metadata configuration file?

Easy
119

A developer has an Aura component that needs to communicate with an unrelated Lightning Web Component located on the same Lightning page. Which feature should the developer implement?

Hard
120

A developer is building a Lightning Web Component that includes user input fields. To adhere to best practices for accessibility and SLDS form styling, how should form inputs be structured?

Medium
121

A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should be used?

Easy
122

A developer is creating an Aura component that interacts with Salesforce data. Which TWO tags or features are valid in the Aura framework? (Choose TWO)

Medium

Frequently asked questions

What does the User Interface domain cover on the SALESFORCE-PD1 exam?
User Interface questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 122 User Interface questions in the SALESFORCE-PD1 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only User Interface questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Salesforce Certified Platform Developer I (SALESFORCE-PD1) User Interface Practice Questions