Lightning interview questions LEARNOVITA

Browse [LATEST] Salesforce Lightning Interview Questions

Last updated on 22nd Sep 2022, Blog, Interview Question

About author

Sanjay (Sr Big Data DevOps Engineer )

Highly Expertise in Respective Industry Domain with 7+ Years of Experience Also, He is a Technical Blog Writer for Past 4 Years to Renders A Kind Of Informative Knowledge for JOB Seeker

(5.0) | 13265 Ratings 1479

1. What are the various programming models available for the Lightning components?

Ans:

There are two different programming models available for the Lightning components. The first is utilising the Aura framework to built out Aura components, the second is utilising the newer Lightning Web Components (LWC) framework.

2. Why would choose one programming model over the other?

Ans:

Lightning Web Components should be the go-to approach for the development due its improved performance, simple of development and alignment with modern web standards. So there are few scenarios where Aura components are still needed, as of Summer ’21, these included building community templates and URL accessible components, although LWC is fastly reaching feature parity.

3. How can develop these components/what tools must use?

Ans:

Aura components can be developed directly in the Salesforce using the developer console, although the third party IDEs highly improve developer efficiency.

LWCs can only be developed by using third party tools, which are Salesforce recommends VSCode and their extension pack.

4. How do 2 programming models are coexist?

Ans:

Aura components can contained and utilise LWCs, including communicating with them by events and component methods. the opposite is not true, an LWC cannot be a composed of Aura components, and they can only ever be its parent.

Code can be shared between the Aura and LWC components using an ES Module.

5. Where can use Lightning components?

Ans:

Lightning components can be used in the myriad of places, from drag and drop components making up Lightning App Builder pages, to fast actions launched by buttons on record detail pages. Components can also be exposed as tabs or an URL addressable for an extra customisation.

Alongside the most general places mentioned above, there are some more niche places are Lightning components can find themselves, including:

  • The Utility Bar
  • Outlook and Gmail integrations
  • Flows
  • Visualforce pages
  • External web pages
  • Pre-chat snap-ins

6. What data types can that use within Lightning components?

Ans:

Within Aura components can use any of the basic data types, e.g. String, Boolean, Date, Object etc and arrays of datatypes. can also explain Aura attributes to hold SObjects and moved advanced datatypes such as functions, Apex explained datatypes and we can explain an attribute which can save other components.

7. What does “this” keyword signify?

Ans:

The “this” keyword can be found in the both Aura and LWC, and their uses are same. Within LWC, the keyword can be used to accessed any component property or method – since “this” points to calling the context of the current code – which in most cases will be from within a LWC.

8. How can express data into the HTML markup?

Ans:

If wish to express the data within our HTML markup ., need to use bind expressions. The syntax varies between LWC, as do the capabilities.

9. How can we make the components admin configurable?

Ans:

Both Aura components and LWCs can exposed component properties into a Lightning App Builder and Experience builder screens for the further customisation by admins as they see fit. And can also further limit where the components appear, preventing record-based components from appearing on the incorrect object pages.

10. How can reuse the code between the components?

Ans:

To share code between the Aura components, generate a service component. This is an Aura component which used “aura:method” to expose the pieces of code which are to be shared. This component can then be included in the other components and can be shared pieces of code called.

11. How can respond to an user interactions?

Ans:

Regardless of the framework used an answer remains the same, events. However, how explain how to handle these events varies slightly by framework, but both are needed to define event handlers.

In Aura, explain handler code within the component’s controller. can then tell the component to listen to and then run our code when the events are fired in several various ways. The simplest is to add an inline event handler on to a component that fires it. The second way is to add an “aura:handler” tag. Both expect to be a pointed towards an action in the controller which handles the event.

Handling events in LWC is a much easier affair than within Aura components since the events are standard JavaScript events. can either use inline event handlers on an elements which fire it or add event handlers to our component dynamically through JavaScript.

12.What are the various phases of events?

Ans:

Events have 2 phases, Bubbling and Capture. The bubbling phase is where the event travels up the DOM to the most top, notifying event listeners on the way. This meantthe first event handlers to run is those on the innermost elements With capturing, the inverse is true, an event travels down from the top of the DOM, calling the outermost event handlers first. By default, events fired by the Lightning components bubble up and are only handled by its parent component, regardless of a phase.

Aura Application events have a third phase, called the Default phase. In this phase an event handlers are called non-deterministically.

13. How can configure an event propagation?

Ans:

When declaring events in LWC, offer additional parameters in the constructor of the CustomEvent to customise its behaviour. There are 2 parameters explained which change the behaviour of the event, these are “bubbles” and “composed”. bubbles allows the event to followed the standard bubbling behaviour and travel up through DOM, by default in LWC this value is false. Composed, on the other hand, states that the event may pass through the shadow boundary and traverse the full DOM tree up to the root, by default this is also false and only has effect if bubbles is also set to true.

14. How can manage the events to improved the User Experience?

Ans:

In situations where an event can be frequently fired based on the user interaction, it’s important to handle those events in a specific way so as to not cause a detrimental impact to the user’s experience. A good example for this is a search bar which filters the list when a user types into it, if were handling the ‘onchange’ event, would end up filtering after the every keypress and this would cause the search to an appear sluggish to the user. Instead what want to do is set a timeout after the every keypress, if the user continues to type within the small time frame easily cancel the previous timeout and start a new one. Now only take the performance hit when we know the user has done something valid and also filtering appears smooth. This technique is called the debouncing.

15. What is a Salesforce Lightning?

Ans:

Salesforce Lightning is a group of technologies and tools that are behind the important upgrade to a Salesforce platform. Salesforce lightning contains the below components:

    1. 1. Lightning Component Framework: It is a javascript framework and a gathering of general components that allow us to developed the recyclable components for personalizing a Salesforce1 Mobile App, and Lightning Experience.
    2. 2. Experience: It related to a set of advanced user interfaces that are optimize for speed.
    3. 3. Lightning Exchange: It related to a part of AppExchange where found more than 70 partner components to start the development.
    4. 4. Lightning Design System: It related to the best practices and style rules of advanced enterprise UX to build pixel-perfect apps.
    5. 5. Visual Building tools: It related to drag-and-drop technologies for simple and quick customization and app building.

16. How do develop Lightning components?

Ans:

    1. 1. Native Aura Components model
    2. 2. Lightning web components model.

17. What is Aura, and what is the use of aura: namespace?

Ans:

Aura is a freeware technology that powers a lightning components. Aura: namespace comprises all the major building blocks to explain applications and components.

18. Explain the Lightning experience?

Ans:

Lightning experience is the name for the latest salesforce desktop application, with a latest features, developed with an advanced User Interface(UI) and also speed optimization.

19. Explain various types of events of Salesforce lightning components?

Ans:

    1. 1. System Events: During the lightning app lifecycle, salesforce fires a system events.
    2. 2. Application Event: The application event extent is across a lightning application, and any element that has enrolled for the event will be get an alert.
    3. 3. Component Event: The component an event scope is within itself, or within the parent component of this event, all the parent components will be get an alert.

20. Explain an Aura application bundle?

Ans:

A bundle included Aura definitions and their associated resources. The aura explanation can be an application, interface, component, and event. Aura explanation Bundle element is a folder that included definition files, contrary to other metadata components, the aura definition bundle component is not a single file; it is a combining of files.

21. Explain a Lightning design system?

Ans:

The lightning design system offers a style rules and advanced UX best practices for the building pixel-perfect applications that match the feel and look of a salesforce1 mobile app and the lightning experience.

22. What is the Lightning Data Service?

Ans:

Use lightning data service for generating , deleting, editing, or loading a record in the component without Apex code. It handles a field-level security and sharing rules. Lightning data service enhanced the user interface and performance consistency. The lightning data service’s main advantage is can carry out a basic tasks without an Apex code.

23. What are the component bundles of a lightning components?

Ans:

    1. 1. Controller: Controller tackles a client-side events.
    2. 2. Style: It included a component style.
    3. 3. Documentation: use this component bundle for a recording the component’s use.
    4. 4. Renderer: The renderer component bundle contains the component default rendering behavior.
    5. 5. Helper: can write the common logic in the helper that is used by differ controller methods to avoid repetition.

24. How can use Lightning the components with Salesforce1 Mobile App?

Ans:

Can use Lightning Components with the Salesforce1 mobile app by creating the traditional lightning tab that referred to the component, and can add that tab to a Salesforce1 mobile navigation.

25. Explain a Lightning out?

Ans:

If need to use a component on the external site, have to use lightning out. The advantage of lightning out is that can utilize lightning components in a visual force page.

26. Explain Attributes, and what are the required parameters in a attribute definition?

Ans:

Attributes are variables that use for saving the values. must explain the Default, Type, Name, Access, and Description in the attribute definition. In the attribute definition, only Name and Type are the needed parameters.

27. How can be utilize a lightning component in a VisualForce Page?

Ans:

By using Lightning out, can embed the lightning component on a VisualForce page. And can add the lightning component to the VisualForce page in three steps:

    1. 1. First, must insert the lightning components for a javascript library of visual force to the intent visual force page through the tag.
    2. 2. After that, can generate and point out a lightning app that use for the component dependencies.
    3. 3. Finally, have to write a javascript function that made the component over the page through $Lightning.createComponent().

28. What are the various types of Lightning Record pages, and how can built them?

Ans:

    1. 1. Record page
    2. 2. App page
    3. 3. Home page

29. Differentiate a Component Event and Application Event?

Ans:

Use the component event for an interaction between the parent and child. And can communicate the change in a child component to the parent component through a component event. Use the Application events to send any of modification in the component to a wide audience.

30.. Explain @AuraEnabled Annotation?

Ans:

The AuraEnabled annotation allowed the lightning components for the accessing the Apex properties and methods. AuraEnabled annotation is overloaded, and use it for a distinct purposes.

    1. 1. Use AuraEnabled on the Apex class static methods for making them to accessible like remote controller actions in the lightning components.
    2. 2. Use @AuraEnabled on the Apex Instance methods and the properties for making them serializable when return the class instance like a data from the server-side action.

31. What is the importance of an aura: method tag in a Salesforce Lightning?

Ans:

Use the aura: a method for explaining the method within the API of the component. This allowed us to call a method directly in a client-side controller of a component rather than a handling or dismissing an event. Through , can simplify a code which the parent component need for calling a method on a child component.

32. Explain a force: record data?

Ans:

The force: record data is the conventional controller of the lightning component. And can finish the operations like deleting, creating, and editing a record through a force: record data. If need to use force: record data, it removed and recognizes the replicate request passing to the server if request for the same record data.

33. Explain an unbound and bound expressions?

Ans:

Use an unbound and bound expressions for performing a data binding. When call a child component from a parent component, that can send the value to the child component attribute from a attribute of a parent component.

34. Explain a Lightning: navigation?

Ans:

Use lightning: navigation for navigating to the page reference or creating a URL from the given page Reference. For navigating, have to explain the page reference object. page Reference is a javascript object which references a page, offering a explained a structure that explains the type of page and its respective values.

can navigate to below supported features:

    1. 1. Lightning Component
    2. 2. Named Page
    3. 3. Knowledge Article
    4. 4. Record Page
    5. 5. Object Page
    6. 6. Navigation Item Page
    7. 7. Web Page
    8. 8. Record Relationship Page.

35. Explain a FlexiPage?

Ans:

FlexiPage portrays the metadata related to the lightning page. The lightning page portrays a adaptive screen for composed of regions comprising the lightning components. The lightning page contains a 25 components. Save the Flexi page as an XML file, and can deploy it through a deployment tool or metadata API. refer to a lightning pages as Flexipages in an API.

36. Explain Locker service in a Salesforce lightning?

Ans:

Locker service is a robust security architecture for a lightning components. The locker service increase security by isolating the lightning components which belong to a namespace from the components in the distinct namespace. Locker service encourage the practices which enhance the maintainability of the code by enabling access to a supported APIs.

37. What is the importance of a implements in a lightning component?

Ans:

Use an implements for referring to the platform interfaces that allowed us to use the components in different contexts, or grant access to additional context data, and by using implements, a component can to implement a multiple interfaces.

38. What are the various types of attributes which we can use for storing the values?

Ans:

    1. 1. Integer
    2. 2. String
    3. 3. Datetime
    4. 4. Date
    5. 5. Decimal
    6. 6. Map
    7. 7. Set

39. What are the Component events?

Ans:

Components events are the events that child components dismiss, and parent to components handle. Use a component events when need to send a value from a child component to a parent component.

40. What is a action provider and a value provider?

Ans:

Action provider allowed the management of the actions, events, and handlers for a component.

The value provider allows to the usage of the component attribute’s value in a component Javascript and markup controller.

41. What are the Application events?

Ans:

Any component can dismissed and handle the application events. Application events do not require any type of relationship among the components, and these components should be a part of a one application.

42. What are the various phases in the application events propagation?

Ans:

    1. 1. Capture Phase
    2. 2. Default Phase
    3. 3. Bubble Phase.

43. Explain a Lightning App Builder?

Ans:

Use lightning app builder for creating the lightning pages for the mobile applications and salesforce lightning an experience. A lightning app builder is a click-and-point tool, and build the lightning pages through a lightning components, which are be configurable, reusable, and compact. Through lightning app builder, that can build various types of pages:

    1. 1. Home page
    2. 2. App Page
    3. 3. Record Page

44. Explain Namespace in a salesforce lightning components?

Ans:

Use a Namespace for grouping the components together. The lightning components that use are a part of a Namespace. C is the default namespace, and can create a namespace through an organization. If create the namespace for the organization, then can use that namespace for the lightning components.

45. What is the different between and

Ans:

does not contained a lightning design system styling while contains lightning a design system styling.

46. What is the use of a Lightning:recordEditForm?

Ans:

In the lightning:recordEditForm, use the lightning:inputField for making the editable fields. By using the lightning:

output field, that can display the read-only information. lightning:recordEditForm contains the follow features:

It displays a record edit layout to edit the particular record.

It displays a record to create a layout to create a particular record.

47. What is an Action provider and the Value provider?

Ans:

Action provider allowed us to manage the events, actions, and handlers for the component. The value provider allowed us to use the component attribute’s value in the component of javascript and markup controller.

48. Explain a Scratch org?

Ans:

Scratch org is an expandable salesforce org that used for testing and development. That can create the scratch org for 30 days after a which deactivate the Scratch org. Scratch org is a default duration is seven days.

49. What is the use of a meta configuration file in a Lightning Web Component(LWC)?

Ans:

The meta configuration file denote the metadata values to the components. If do not have a configuration file for the component, will get an error when push to changes.

50. How do the capture phase and the bubble phase propagate?

Ans:

    1. 1. Capture phase: This phase propagates are from top to bottom
    2. 2. Bubble phase: This phase propagates are from bottom to top.

51. How can explain the field-level security in a salesforce lightning components?

Ans:

To explain the field level security, should use Lightning:recordEditForm, force: record data, and Lightning: record form.

52. What are the options for a lightning record page assignment?

Ans:

Can assign the lightning pages at 3 distinct levels:

    1. 1. Org default
    2. 2. App default: This assignment revokes an assignment done at the org level.
    3. 3. App, profile, record type: This assignment revokes an assignment done at App and org level.

53. How can access the value from a attribute?

Ans:

By using “ValueProvide”, can accessed the value from a attribute.

54. What are the different Global value providers in lightning?

Ans:

Following are the diffrenet Global value providers:

    1. 1. $globalID
    2. 2. $Label
    3. 3. $Resource
    4. 4. $Locale
    5. 5. $Browser

55. Can integrate the Lightning components with the other frameworks like Angular?

Ans:

Yes, can integrate the lightning components with the other frameworks.

56. Can add the external CSS or Javascript libraries like bootstrap, jquery to a components?

Ans:

Yes, can add the Javascript and CSS libraries to a lightning components.

57. How do assure FLS when working with a Lightning components?

Ans:

In the APEX controller, must enforce a CRUD and FLS manually. Also, while using the Lightning data service, it takes care of CRUD and FLS.

58. How can display the loading spinner in a lightning component?

Ans:

Spinners are the CSS indicators that should display a while retrieving the data or performing slow calculations.

Lightning: spinner display the animated spinner image for indicating that are request is loading.

Can use aura:donewaiting and aura: waiting to a control the loading spinner.

59.What are the Naming Convention Rule for Salesforce Lightning?

Ans:

  • Must start with a letter
  • Must contain only alphanumeric or an underscore characters
  • Must be unique in a namespace
  • Can’t included whitespace
  • Can’t end with a underscore
  • Can’t contain a two consecutive underscores

60.What is a Lightning Container?

Ans:

  • Upload an app developed with the third-party framework as a static resource, and host the content in an Aura component using lightning:container. Use a lightning:container to use third-party frameworks like AngularJS or React within the Lightning pages.
  • The lightning:container component hostsa content in an iframe can implement communication to and from the framed application, allowing it to an interact with the Lightning component. lightning:container provides a message()method, which can used in the JavaScript controller to send messages to the application. In the component, specify the method for handling the messages with the onmessage attribute.

61.What is a Lightning Locker?

Ans:

Lightning Locker is a powerful security architecture for a Lightning components. Lightning Locker enhanced a security by an isolating Lightning components that belongs to one namespace from the components in a various namespace. Lightning Locker are promotes best practices that increase the supportability of a code by only allowing access to supported APIs and eliminating the access to non-published framework internals.

62.Differentiate between a Salesforce Classic and Salesforce Lightning.

Ans:

Salesforce Lightning offered an enhanced for user interface.

Need to hire a Salesforce Developer to an operate Salesforce Classic, Salesforce Lightning is more simpler to work with.

With Lightning, don’t need a Visualforce for each task.

Salesforce Lightning has high advanced for a security features than Salesforce Classic.

63.What is Visualforce?

Ans:

Visualforce is the framework that allowed a developers to create difficult, creative user interfaces that run natively on a Lightning platform.

64. What exactly is a FlexiPage in the context of Salesforce Lightning?

Ans:

FlexiPage represents the metadata associated with the lightning page that are depicted an adaptive screen made up of areas included a lightning components. The Flexi page is stored as an XML file and deployed through the metadata API and deployment tool

65.Which interface are supposed to implement so that a lightning component can be used as a Tab?

Ans:

Need to implement the “force:appHostable” so that can used a component as a Tab.

66.Which interface are supposed to implement so that a lightning component can be used as a quick action?

Need to implement a “force: lightningQuickAction” so that can use the component as a Quick Action.

67. How can debug our components?

Ans:

There are various ways to an approached component debugging, the fastest way is to just provided a console logging statements to log variables through a code execution. Other step is to an enabled Lightning Debug Mode to removed a minification and provide better error messages.

68. Which interface are supposed to implement so that a lightning component can be used in the Community builder?

Ans:

Need to implement a “forceCommunity:availableForAllPageTypes” so that can use a component in community builder.

69. How to find data changes by using data handlers?

Ans:

Can easily Configured a component for invoked a change handler when the value of the attributes in one of a components to be changes.

70. What is a Lightning Design System?

Ans:

Style rules and the modern enterprise UX are best practices to built a pixel for perfect apps that match the look and feel of a Lightning Experience and Salesforce1 Mobile app.

71. Is Lightning a MVC framework?

Ans:

No, it’s the component-based framework.

72.Can Include One Lightning component to the another ?

Ans:

Yes can include one Lightning component inside the another Lightning component

73. What are the propagation phases of Component Events?

Ans:

There are 2 phases for component event propagation after the event fires- capture phase and the bubble phase.

74.What are the benefits of a Lightning Web Component Method?

Ans:

It is an innovative and a lightweight stack designed to an align with the newer standards.

It madeworking with a components faster.

LWC has proved better component performance as well.

75. What Salesforce limitations are there for a allowed maximum number of a components per app?

Ans:

There is no limit regarding how many components that are allowed in an app.

76.What are the types of record pages in the Salesforce Lightning?

Ans:

There are 3 record page types in Lightning: 1. Home Page 2. Record Page 3. App Page.

77. What is a Lightning Data Services?

Ans:

LDS is used for a caching purposes. It allows to uploading, adding, modifying or deleting a component’s records by using Apex code from the server-side.

78. Which parts of the Lightning Components are the server-side and which are on the client-side?

Ans:

Lightning components made use of JavaScript on a client-side and Apex on a server-side.

79. What are the different types of Lightning Record pages, and how are they built?

Ans:

Record page, App page, and Homepage are the various types of Lightning record pages and they can be built using Lightning App Builder.

80.Do think Lightning Components are only directed towards a mobile apps?

Ans:

Lightning Components are designed with a mobile-first approach, but the responsive design allowed it to give the same experience an even over the desktop without the need for a writing any separate lines of the code.

81. How can we utilize a Lightning component in the VisualForce Page?

Ans:

    1. 1. The Lightning components for the javascript library of visual force must be first inserted into an intended visual force page through a tag.
    2. 2. A Lightning app that is used for a component dependencies is then generated and pointed.
    3. 3. Finally, a javascript function require to be written that creates the component over the page through $Lightning.createComponent().

82. How can components be deployed to a production org?

Ans:

Lightning components can be deployed to a production by change sets, force.com, IDE, and Managed Package.

83. What is the difference between a component event and an application event?

Ans:

Component event is used for the interaction between the parent and child. The change in a child component can be communicated to a parent component through the component event.

84.What is the use of an implements in a lightning component?

Ans:

Implements are basically used for a referring to different interfaces of the platform which enable a component for use in various contexts or granting access to extra context data. A component can often to implement multiple interfaces.

85. How can subscribe to an event in a Lightning component?

Ans:

For subscribing to any event in a Lightning component, tags have to be included in a containment hierarchy. Subscription of this event is dependent on the type of an event, i.e. component event or application event.

86. How can communicate between 2 different components?

Ans:

In a Lightning Component Framework, the communication between 2 components can be finished in the following ways: Attributes which passed data down the component hierarchy Lightning Events which passed data up and around the hierarchy of a components

87. Are there any CSS styles are provided by the Salesforce.com which support a Lightning components?

Ans:

Salesforce has given a lightning design system as a default CSS which can be used with a Lightning component.

88. Do create an App Bundle first to create a Lightning component?

Ans:

Not really, however, a component bundle can be created a first.

89. Mention any advantages of a lightning?

Ans:

Lightning has more advantages like an extraordinary component set which lets fast creation of new apps, and simple decoupling between the components can be enabled by a event-driven architecture. Also, it is an endowed with device awareness, cross-browser compatibility, and an optimized framework for the performance.

90. Is it possible to integrate a Lightning components with the another framework like Angular?

Ans:

Yes, Lightning components can be an integrated with any third-party of framework like Angular.

91. Which interface to use if want component to be available for all pages?

Ans:

can use the flexipage:availableForAllPageTypes interface.

92. Which interface can be used to get the id of the record from a record Detail page?

Ans:

The force:hasRecordId interface can be used for getting a rid of the record from record Detail page.

93. Which interface should be used to override the standard action?

Ans:

Can make use of a Lightning:actionOverride interface.

94. What are the core principles of a Salesforce Lightning UI?

Ans:

  • Clarity
  • Efficiency
  • Consistency
  • Beauty

95. Which interface to used a component in a record home page?

Ans:

The interface used flexipage:availableForRecordHome.

96. How do create a Many-to-Many Relationship in a Salesforce?

Ans:

In Salesforce, a Many-to-Many Relationship is also known as the Junction object. The steps to make it are as below

  • Create every object that has to be linked together.
  • Create one custom object, also known as the Junction object, that should have Associate in a Nursing automotive vehicle number as a unique identifier.
  • For every item, create a pair of Master relationships.
  • Made this a connected list on every object.

97. Why Lightning:isUrlAddressable interface are used?

Ans:

The lightning:isUrlAddressable interface is used when navigating to a component and also when the component to be a navigated implements this interface.

98. How to find a data changes using data handlers?

Ans:

can configure a component for invoking the change handler when the value of an attributes in one of the many components changes.

99. What are the LWC lifecycle hook methods? What is an order in which they are called?

Ans:

Follow are the methods and the sequence in which they get invoked:

    1. 1. constructor()
    2. 2. connectedCallback()
    3. 3. renderedCallback()
    4. 4. render()
    5. 5. disconnectedCallback()
    6. 6. errorCallback(error, stack)

100. What are decorators in LWC?

Ans:

@api, @track, @wire.

Are you looking training with Right Jobs?

Contact Us

Popular Courses