Top 45+ Most Asked Salesforce Lightning Interview Questions and Answers
1) What is Salesforce Lightning?
Salesforce Lightning is a component-based framework developed by Salesforce.com to provide app development. It is designed to simplify business users who are not aware of this technology and typically do not have programming experience.
Salesforce Lightning consists of a set of tools and technologies behind an important upgrade to the Salesforce1 Platform (now known as App Cloud), the company's mobile app development platform.
2) What are the most important features of Salesforce Lightning? / What are the most important components that Salesforce Lightning contains?
Salesforce Lightning contains the following important components:
Experience: It is a set of modern user interfaces optimized for speed. This includes the Lightning Experience, Salesforce1 Mobile App, and template-based communities.
Lightning Exchange: It specifies a section of the AppExchange where we can find 70+ partner components to start our development.
Lightning Design System: It specifies the best practices and style guides and modern enterprise UX best practices to build pixel-perfect apps that match the look and feel of the Lightning Experience and Salesforce1 Mobile app.
Visual Building Tools: It specifies the drag-and-drop technologies for fast and easy app building & customizations. We can use the Lightning App Builder to customize the Lightning Experience and Salesforce1 Mobile app. We can also use the Community Builder to customize template-based communities.
3) How can we develop Salesforce Lightning components?
We can develop the Salesforce Lightning components by using the following two programming models:
4) Is Salesforce Lightning an MVC framework?
No, Salesforce Lightning is not an MVC framework. Instead, it is a component-based framework.
5) What do you understand by Lightning experience?
Lightning experience is the latest Salesforce desktop application, which has the latest features. Lightning experience is developed with an advanced User Interface (UI) and provides a lightning-fast optimized speed.
6) What are the important tools included in Lightning?
Following is the list of main tools included in Lightning:
Lightning Component Framework: The set of components and extensions facilitates us to build reusable components, customize the Salesforce1 Mobile App, and build standalone apps.
Lightning App Builder: It is a new UI tool that facilitates us to build extremely fast apps using components provided by Salesforce and platform developers.
Lightning Process Builder: This is a UI tool for visualizing and creating automated business processes.
Lightning Schema Builder: This is also a UI tool used for viewing and creating objects, fields, and relationships.
Lightning Connect: This is an integration tool that makes the Force.com app easily consume data from any external source that conforms to the OData spec.
7) What is Aura? What is the use of aura: namespace?
Aura is an open-source freeware technology that powers Lightning Components. The aura: namespace consists of all basic building blocks to define applications and components.
8) What do you understand about the Aura application bundle?
The Aura application bundle consists of definitions and their associated resources. The aura definition can be defined as an application, interface, component, and event. The Aura definition bundle element is a folder consisting of definition files opposite the other metadata components. On the other hand, the aura definition bundle component is not a single file. Instead, it is a group of files.
9) What is the difference between Visualforce Components and Lightning Components?
The Visualforce components are page-centric, and they complete most of the work on the server. On the other hand, Lightning Components are client-side centric, making them more dynamic and mobile-friendly.
10) How do the two programming models, the Native Aura Components model, and Lightning web components model, coexist?
The Native Aura Components model and Lightning, web components model, can be coexisted in the following way:
11) What are the different types of events of Salesforce lightning components?
Following are the main three different types of events of Salesforce lightning components:
12) What are the different component bundles of the lightning components?
Following is the list of the different component bundles of the lightning components:
13) What is the use of Lightning Data Service?
Following are the main usages of Lightning Data Service:
14) What do you understand about the Lightning Design System?
The Lightning Design System provides style guides and modern enterprise UX best practices to build pixel-perfect apps that look great and provide a look and feel of the Lightning Experience and Salesforce1 Mobile app.
15) What are the different events used in the Salesforce Lightning component?
Following are the different types of events used in the Salesforce Lightning component:
Application Event: The scope of the application event is throughout the lightning App. It sends a notification if any component is registered for this event.
Component Event: The scope of this event is within itself or the parent component of this event. It sends a notification for all the components declared within the parent component.
System Event: This type of event is fired by Salesforce's system during the lifecycle of the lightning app.
16) What do you understand by aura definition bundle?
An aura definition bundle is a specific type of bundle that contains an Aura definition and its related resources. This may be a component, application, event, interface, or a tokens collection. The AuraDefinitionBundle component is a folder that contains definition files. This is not a single file like most other metadata components. Instead, it is a collection of files. Each file represents a resource in a bundle, such as a markup, applications, code files (including controllers and helpers), events, documentation, and interfaces.
An aura definition bundle does not have a suffix. The definition files can have one of the following suffixes:
17) What is Lightning out?
Lightning out is a process that is used when we want to use our component on the external site. The biggest advantage of lightning out is utilizing lightning components in a visual force page.
18) What are the key differences between Component Event and Application Event?
Following is the list of key differences between Component Event and Application Event:
19) What are the different types of Lightning Record pages, and how can we build them?
There are mainly three types of Lightning Record pages:
We can create or build Lightning Record pages by using Lightning App Builder.
20) What is the use of implements in the lightning component? What are the different interfaces implemented in the lightning component?
Implements are used to refer to platform interfaces that make components able to be used in different contexts or to grant access to extra context data. A component can implement more than one interface.
Following is the list of all interfaces that can be implemented in lightning component:
21) What is the difference between Lightning components and Visualforce components?
Lightning components are client-side-centric and known for their dynamic, mobile-friendly nature. On the other hand, Visualforce components are page-centric and mainly work on server-based.
22) What are the attributes, and what are the required parameters in the attribute definition?
Attributes are the variables that are used for storing the values. We should define the Default, Type, Name, Access, and Description in the attribute definition, although; only Name and Type are the required parameters.
23) What is Locker service in Salesforce lightning?
In Salesforce lightning, the Locker service is robust security architecture for the lightning components. This service is used to improve and enhance security by isolating the lightning components which belong to the namespace from the components in the distinct namespace. Locker service follows some practices that enhance the code's maintainability by providing access to the supported APIs.
24) How can we use a lightning component in the VisualForce Page?
We can embed the lightning component on the VisualForce page by using Lightning out. We should follow the following three steps to add the lightning component to the VisualForce page:
25) What is FlexiPage in Salesforce Lightning?
FlexiPage is the metadata related to a lightning page. The lightning page specifies an adaptive screen that has several lightning components. It contains 25 components. FlexiPages are stored as XML files and deployed through a deployment tool or metadata API. These lightning pages are referred to as Flexipages in the API.
26) Are Lightning Components only directed towards mobile apps?
The Lightning Components are mainly designed with a mobile-first approach, but they have a responsive design that allows them to give the same experience even over the desktop without writing any separate lines of code.
27) What do you understand by Lightning:navigation?
It facilitates us to navigate to the following supported features:
28) Which Lightning components parts are server-side and which are client-side?
29) What are the different types of attributes that can be used for storing the values?
Following are the different types of attributes that can be used for storing the values:
30) Can we integrate Lightning components with another framework like Angular?
Yes, we can integrate Lightning components with any third-party framework like Angular.
31) What are the different phases in the application events propagation?
There are mainly three phases in the application events propagation:
32) What is the use of Lightning:recordEditForm?
In the Lightning:recordEditForm, the Lightning:inputField is used for creating the editable fields. Using the Lightning:output field, we can display the read-only information.
The Lightning:recordEditForm contains the following features:
33) Can we make a Lightning Component that can be used in the mobile and desktop user interfaces?
Yes, we can make a Lightning Component that can be used in the mobile and desktop user interfaces. The Lightning Component specifies an extremely fast experience that is responsive and ready by default and has compatibility in Salesforce1 App. Its responsive nature makes it adjust as per the resolution of the screen size. So, we can use it easily on the desktop without any separate code.
34) How can we add Aura components to our Visualforce page?
There are the following three ways that a developer can choose to add the Aura components to the Visualforce page:
35) What is the difference between <ui:input> and <lightning:input>?
The main difference between <ui:input> and <lightning:input>:
36) What is the usage of Aura: method Tag in Lightning?
The Aura: method tag is mainly used to define component API. After using this tag, we don't need to fire and handle a component event, and it allows us to directly invoke the method in the component's controller on the client-side. It simplifies the code required for a parent component to call a method on a child component that forms a part of the parent component.
37) Is it possible to create one component for inheriting style/CSS from the parent component, or do we always need to define it in the Salesforce component?
It is completely possible to create one component for inheriting style/CSS from the parent component. We can inherit styles from parents, and it is not necessary to always define them in the Salesforce component.
38) What do you understand by an Action provider and a Value provider?
40) How can we get the current record id in the lightning component?
To get the current record id in the lightning component, we have to add the force:hasRecordId interface to a Lightning component. It makes the component able to assign the ID of the current record. The current record ID is useful if the component is used on a Lightning record page as an object-specific custom action or action override in Lightning Experience or the Salesforce app. This interface doesn't show any effect except when used within Lightning Experience, the Salesforce mobile app, and template-based communities.
41) What do you understand by Scratch org?
The Scratch org is an expandable Salesforce org used for testing and development. The Scratch org can be created for 30 days, after which we deactivate the Scratch org. The by default duration of Scratch org is seven days.
42) What is the use of popup in the lightning component?
Popup or Modals Boxes display content in a layer above the app. This paradigm is mainly used in cases such as creating or editing a record and various types of messaging and wizards.
43) What is the purpose of the force:appHostable interface in the Salesforce lightning component?
The force:appHostable interface is used as a custom tab in the Salesforce lightning component or mobile app.
44) How can we define the field-level security in the Salesforce lightning components?
We can use the Lightning:recordEditForm, force: record data, and Lightning: record form to define the field level security.
45) What are the different global value providers in Salesforce lightning?
Following are the different global value providers in Salesforce lightning:
46) How can we display the loading spinner in the lightning component?
Loading spinners are the CSS indicators we can display while retrieving the data or performing slow calculations. We can use Lightning:spinner that shows the animated spinner image indicating that a request is loading.
47: How do the capture phase and bubble phase propagate?
The capture phase propagates from top to bottom while the bubble phase propagates from bottom to top.