Lightning Interview Questions

1)What is Lightning?
A) Lightning is the collection of tools and technologies behind a significant upgrade to the Salesforce platform.
Lightning includes:
ExperienceA set of modern user interfaces optimized for speed. This includes the Lightning Experience, Salesforce1 Mobile app, and template-based communities.
Lightning Component Framework: 
A JavaScript framework and set of standard components that allow you to build reusable components to customize the Lightning Experience, Salesforce1 Mobile app, and template-based communities and build your own standalone apps.
Visual Building Tools: 
Drag-and-drop technologies for fast and easy app building & customization’s. Use the Lightning App Builder to customize the Lightning Experience and Salesforce1 Mobile app. Use the Community Builder to customize template-based communities.
Lightning Exchange:
 A section of the AppExchange where you can find 70+ partner components to jump-start your development.
Lightning Design System:
 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.

2) What is the Lightning Component?
A)The Lighting components framework is a UI framework for developing dynamic web apps for mobile and desktop devices. As well, its lighting component framework is a component-based framework. Lighting component is client-side centric, marking them more dynamic and mobile friendly. Lighting components is a reusable component framework and those combination use in varies applications.
They use JavaScript at the client-side and Apex at the server-side to provide the data and business logic.

A Lightning component is a compact, configurable, and reusable element that you can drag and drop onto a Lightning Page in the Lightning App Builder.
You can use standard, custom, and third-party components in the Lightning App Builder.

Standard Components: 
Standard components are Lightning components built by Salesforce.
Examples of Standard Components:  aura: iteration iterates over a collection of items and renders the body of the tag for each item.

Custom Components: 
Custom components are Lightning components that you or someone else have created. With some modifications, custom Lightning components can work in the Lightning App Builder.

Third-Party Components of App Exchange: 
The App Exchange provides a marketplace for Lightning components. You can find packages containing components already configured and ready to use in the Lightning App Builder.

3)What is the Component?
A)Components are the self-contained and reusable units of an application. They represent a reusable section of the UI and can range in granularity from a single line of text to an entire application.
The framework includes a set of prebuilt components. You can assemble and configure components to form new components in an application. Components are rendered to produce HTML, DOM elements within the browser.
A component can contain other components, are well as HTML, CSS, JavaScript, or any other web-enabled code. This enable s you to build apps with sophisticated UIs.

4)What are the Types of Events in lightning?
A)There are two types of events in the framework:
1)Application Event (Salesforce Document)
2)Component Event
System Event (Salesforce Document)
Component Event:
Component Event is managed by the component itself.
Application Event:
Application Event is handled by all components that are applying to the event. These events are essentially a traditional publish-subscribe model.

5) What is the difference between Lightning and Classic Salesforce?
A)Salesforce Classic: It's the platform which we are using for a long time as standard, Salesforce just named to classify between the new User Interface/Experience and old User Interface/Experience.

Lightning Experience:
 It's the new, slick user interface and the Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices. Lightning makes it easier to build responsive applications for ANY DEVICE. The initial release of the new user interface is geared towards sales reps with an intuitive interface that allows sales reps to work more efficiently. The dashboard and charts in Lightning Experience behave much like Wave where changes in the chart recalculate in real time. 

6)What is the Locker Sevices?
A)Locker Service is a powerful security architecture for Lightning components. Locker Service enhances security by isolating Lightning components in their own namespace. Locker Service also promotes best practices that improve the supportability of your code by only allowing access to supported APIs and eliminating access to non-published framework internals.

7) What is Aura?
A) Aura is the open source technology that powers Lightning Components. The aura: namespace contains all of the basic building blocks for defining components and applications.The Aura framework enables you to build apps completely independent of your data in Salesforce.

8)How can I use the Lightning component in visual force Page?
A) Yes, using lightning out the functionality of salesforce lightning component.
1)use <apex:includeLightning /> tags at the beginning of VF page This component loads the JavaScript file used by Lightning Components for Visualforce.
2)Lightning App must extend ltng:outApp library/interface.
3)We can use $Lightning.use() many times into VF page but that must reference the same lightning app.
4)We can only call those components that are referenced into the app.

9) What is the List of Tool are availability in Lightning?
A) Lightning Connect
Lightning Component Framework
Lightning Schema Builder
Lightning Process Builder
Lightning App Builder

10) What is the different between Visualforce component and Lightning components?
A)Visualforce components are page-centric and most of the work is done on the server. Lightning is designed from the component up, rather than having the concept of a page as its fundamental unit. Lightning Components are client-side centric, which makes them more dynamic and mobile-friendly.

11)How can we use Lightning Components with the Salesforce1 Mobile App?
A) By Create a custom Lightning tab that points to our component and includes that tab in our Salesforce1 Mobile navigation.

12)Can we make a Lightning Component that shows up in both the mobile and the desktop user interfaces?
A) We can use Lightning Components directly in Lightning Experience, the Salesforce1 Mobile app, template-based communities, and custom standalone apps. Additionally, we can include Lightning components in a Visualforce page, that allowing us to use them in Salesforce Classic, Console, and Visualforce-based communities.

13) Is Lightning an MVC framework?
A) No, it’s a component-based framework.

14)Which parts of Lightning Components are server-side and which are client-side?
A) Lightning Components are used JavaScript on the client side and Apex on the server side.

15)Can we make one component inherit styles/CSS from a parent component, or must we always define it in the component?
A) Yes, we can inherit styles from the parent. there is no need to always defined in the component.

16)What is the use of the aura: method tag in Lightning?
A) we can Use < aura: method > to define a method as part of a component’s API. This enables us to directly call a method in a component’s client-side controller instead of firing and handling a component event. Using simplifies the code needed for a parent component to call a method on a child component that it contains.

17)Can we Include One component to another?
A) Yes, we can Include one lightning component to another lightning component.

18)Is there any limit on how many components to having in one Application?
A) there is no limit.

19)Is Lightning Components replacing Visualforce? 
A) No.

20) Do we need a namespace to develop Lightning Components?
A) No. Lightning Components used to require a namespace, but that is no longer a requirement.

21)What are the tools included in lightning?
 A) Lightning Component Framework – Components and extensions that allow you to build reusable components, customize the Salesforce1 Mobile App, and build standalone apps.
Lightning App Builder – A new UI tool that lets you build apps lightning fast, using components provided by Salesforce and platform developers.
Lightning Connect – An integration tool that makes it easier for your Force.com app to consume data from any external source that conforms to the OData spec.
Lightning Process Builder – A UI tool for visualizing and creating automated business processes.
Lightning Schema Builder – A UI tool for viewing and creating objects, fields, and relationships.

22)Are there any CSS (styles) provided by salesforce.com as part of the supported Lightning Components?
A) Yes. Salesforce Lightning Design System.

23)What is SLDS?
A)The Salesforce Lightning Design System includes the resources to create user interfaces consistent with the Salesforce Lightning principles, design language, and best practices. 
It helps to create an intuitive UI with less number of clicks which is modern and beautiful.

24)Are Lightning Components intended only for mobile apps?
A) Components have been built to be mobile first, but with responsive design in mind. With Lightning, we can build responsive apps fast for desktop, mobile and tablets.

25)What is the use of lightning components?
A) The benefits include an out-of-the-box set of components, event-driven architecture, and a framework optimized for performance.
Out-of-the-Box Component Set -: Comes with an out-of-the-box set of components to kick-start building apps. You don’t have to spend your time optimizing your apps for different devices as the components take care of that for you.
 Rich component ecosystem-: Create business-ready components and make them available in Salesforce1, Lightning Experience, and Communities.
Performance–: Uses a stateful client and stateless server architecture that relies on JavaScript on the client side to manage UI, It intelligently utilizes your server, browser, devices, and network so you can focus on the logic and interactions of your apps.
Event-driven architecture -: an event-driven architecture for better decoupling between components
Faster development–: Empowers teams to work faster with out-of-the-box components that function seamlessly with desktop and mobile devices.
Device-aware and cross-browser compatibility–: responsive design supports the latest in browser technology such as HTML5, CSS3, and touch events.

26) Can we integrate Lightning components with another framework, such as Angular?
A) Yes. we can include the working 3rd party code inside a Visualforce Page, embed the Visualforce Page inside a Lightning Component. This Lightning Component can be used as any other Lightning Component in various environments.

27)Can we include external JavaScript/CSS libraries in components?
A) Yes! we can use multiple libraries in our lightning component like JQuery, Bootstrap, custom CSS and custom Javascript libraries from a local resource (static resource).<ltng: require> enables you to load external CSS and JavaScript libraries after you upload them as static resources.

28) What happens with existing Visualforce Pages in Lightning Experience?
A) They’ll continue to be supported in the current UI and Lightning Experience.
29) Where we can display lightning component?
A) There are a number of possibilities for display lightning component.
 Lightning Experience: We can display component in the Lightning Experience using the App Builder.we can edit the home page, edit a record detail page or create/edit a new app page to include it.
 Salesforce1 Mobile app: We can display component in the Salesforce1 Mobile app by creating a custom Lightning tab that references it and adding that tab in the mobile navigation.
Template-based community: we can display component in template-based (e.g. Napili) community using the Community Builder.
Standalone Lightning app: By create a standalone Lightning app (e.g. myapp.app) and include the component in this app. Access Lightning app by URL.
30) Do I always create an app bundle first when developing lightning component?
A) Not necessarily, We can start with a Component bundle.

31) How can we deploy components to production org?
A) we can deploy component by using managed packages, Force.com IDE, Force.com Migration Tool or Change Sets.

32)What makes up a component Bundle?
A) The following makes component Bundle:
Component / Application
Controller (Client – Side JavaScript)
Helper (JavaScript Functions)
Style (CSS)
Documentation (For further Reference)
Design
SVG

33)What are the  Quick Actions?
A) Quick Actions: Quick Actions offer a fast way for mobile users to launch a specific workflow in the Salesforce mobile app, like creating records, logging calls, or sharing files etc.
BY using Quick Action, You can create custom actions fitted to your own business processes and use cases.
Each action has its own unique page layout so you can limit the fields to just the ones mobile users truly need.
You can pre-populate fields on the page layout to save mobile users some time.
Types of Quick Actions:
1. Global Quick Action
2. Object Specific Quick Action

Global Action:
Global actions let users create records, but the new record has no relationship with other records. And they’re called global actions because they can be put anywhere. actions are supported—on record detail pages, the home page, and the Chatter tab.

Object Specific quick Actions:
Object-specific actions let users create or update records in the context of a particular object. In the Salesforce app, object-specific actions show up on record detail pages.
example: An action associated with the Opportunity Object is only available when a user a user is looking for an opportunity.

Object-specific actions can update records.
Object-specific actions can create records that are automatically associated with related information. For example, a user could initiate an action that simultaneously creates a contact and associates it with an account.

The Big difference between Object specific Action and Global Action is, To expose object-specific actions in the mobile app, you don’t add them to the global publisher layout like we did in the last unit. Rather, you make them available to users by editing the object’s page layout.
To Create Object Specific Action , Go to Object -> Buttons, Links & Actions -> New Action
You will get the Below screen, and select the Type of action you are creating. and Select Target Object, Label, Name and Description.

34) What are the prerequisites for sales force Lightning?
A) The following are prerequisites for Salesforce lightning,
Access to any Sales Force Sand Box or developer Free Edition
 Enable My Domain
 Enable Lightning Mode
Enable Debug Mode
35) Is it necessary to create the domain to use lightning experience?
A) Yes. My Domain is a feature that allows you to add a personalized fourth-level domain to the actual URL of your Org.
If you want to use Lightning components in Lightning tabs, Lightning Pages, or as standalone apps. Salesforce requires My Domain as a security measure to help prevent malicious attacks—just in case a security hole lies hidden deep within a third-party or custom component.

36)Can we access one lightning component on another lightning component in salesforce?
 A) Yes, We can able to access by using
1
 &lt;c:componentname&gt;.

37) Can we access one JavaScript controller method on another controller method in salesforce lightning component?
 A) No, we can’t able to access

38)  Can we access one JavaScript helper method on another helper method in lightning Component?
A) Yes, We can able to access

39) Can we use external libraries in components?
A) Yes, Lightning component supports various libraries such as Bootstrap, Gruntjs,angularJS ….

40) By which interface helps us to show component in lightning Tabs?
A) by adding implements=”force:appHostable”.It helps us to a component display in lightning Tabs.

41) By which interface helps us to show component in lightning Record home page?
A)Byadding implements=”flexipage:availableForRecordHome,force:hasRecordId” and access=”global” we can use record homepage in Lightning Experience.

42)  How to make the Quick lightning action?
A)with embedding script into our code 
  implements=”force:lightningQuickAction”

43) What are component Naming Rules in Salesforce Lightning?
A) These are Naming Rules in Salesforce Lightning
• Must begin with a letter
• Must contain only alphanumeric or underscore characters
• Must be unique in the namespace
• Can’t include whitespace
• Can’t end with an underscore
• Can’t contain two consecutive underscores
44) How to use static resources in Lightning Application?
A) we need show name which is stored in our static resource.

 &lt;ltng:require styles="{!$Resource.MyName +      '/assets/styles/MyName.css'}"/&gt;
45) What are value providers in Salesforce Lightning ?
A) Value providers help users to access data in Lightning Application.They are two value providers as v(View) and c(controller)
v is component attribute set which helps to access component attribute values in markup
c is component controller helps us to link with event handlers and action for the component.

46)  List of Global value providers?
 A) globalID
$Browser
$Label
$Locale
$Resource

57)  what is Custom Label?
A) Custom Label helps to create multilingual applications by user language
Syntax : $A.get(“$Label.namespace.labelName”)

58) How to add a button in Salesforce Lightning?
A) lightning: button

59)  How to make the button to work on click in Salesforce Lightning?
A) ui:button

60)What is @Aura Enabled?
A) @AuraEnabled is helping to access methods in Lightning.
Use for:
The AuraEnabled annotation provides support for Apex methods and properties to be used with the Lightning Component framework.
The AuraEnabled annotation is overloaded and is used for two separate and distinct purposes.
1. Use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.

2. Use @AuraEnabled on Apex instance methods and properties to make them serializable when an instance of the class is returned as data from a server-side action.

61) what is Lightning Data Service in Salesforce Lightning?
A) Lightning Data Service helps to create, edit, delete and loads in a component without the help of apex and it shares filed level security and sharing rules to us.
Lightning Data Services already ensures Field Level Security and we can also use the Apex using isAccessible, isCreateable, isDeleteable, isCreateable and etc methods of Schema class.
It is data Layer for Lightning can be equated to Standard Controllers in Visualforce They are similar to a standard controller in Apex coding, advantages of using lightning Data service are mentioned below
1.Use Lightning Data Service to load, create, edit, or delete a  record in your component without requiring Apex code.
2. Lightning Data Service handles sharing rules and field-level security for you.

3. In addition to not needing Apex, Lightning Data Service improves performance and user interface consistency.

62) What is Lightning Container in Salesforce Lightning?
A) By Lightning Container, we can access third-party framework such as angularJS, reactJs. To access those developed apps need to store in a static resource.
Upload an app developed with a third-party framework as a static resource, and host the content in a Lightning component using lightning: container. Use lightning: container to use third-party frameworks like AngularJS or React within your Lightning pages.

The lightning: container component hosts content in an iframe. You can implement communication to and from the framed application, allowing it to interact with the Lightning component. lightning: container provides the message() method, which you can use the JavaScript controller to send messages to the application. In the component, specify a method for handling messages with the message attribute.

63) Which chrome extension helps us to debug lightning applications?
A) Salesforce Lightning Inspector
Lightning component javascript can be debugged in the following manner-
·       Use Chrome + built-in Dev Tools + Lightning Component Inspector.
·       Make sure that debug mode is enabled in your org (Setup: Lightning Components).
·       Make sure that caching is disabled in your org (Setup: Session Settings -> uncheck “Enable secure and persistent browser caching to improve performance”
64) What is the use of Document and Renderer in the lightning component?
A) Document: – A description, sample code, and one or multiple references to the example components Client-side renderer to override the default rendering for a component.

65) What are Lightning Extensions?
A) They’re a mechanism for using custom-built components to replace existing components in the Salesforce1 Mobile App. This functionality is currently in Pilot.

 66)  Where Lightning components can be displayed? 
A) In Lightning App (. app URL)
In Salesforce1 app as a Tab
As a lightning extension

67) How to include external JavaScript file in the lightning component?
A) Use JavaScript for client-side code. The $A namespace is the entry point for using the framework in JavaScript code. For all the methods available in $A, see the JavaScript API at https://.lightning.force.com/auradocs/reference.app, where is the name of your custom Salesforce domain. A component bundle can contain JavaScript code in a client-side controller, helper, or renderer. Client-side controllers are the most commonly used of these JavaScript resources.

68) To design lightning components, do you need to create a custom domain?
A) Yes, we need to custom domain to the built lightning component. By using custom domain help us to make our organization more secure while authentication.

69) How can extend any component?
A) Lighting component can be extended using extensible=” true” attribute in aura: component 

70)  How can we subscribe to an event in the lightning component?
A) Use <aura:handler> in the markup of the handler component.

71) what is the Aura: Register event in the lightning component?
A) A component registers that it may fire an event by using <aura:registerevent>
 aura: register event is the notifier component and it declares that it may fire a particular event, it includes ‘name’ attribute which is relevant only to the component event and is not used for application event. Another attribute is the ‘type’ which lets the component know which event would be fired.

72) What is the Salesforce Lightning Connect?
A)Salesforce Connect is a framework that enables you to view, search, and modify data that’s stored outside your Salesforce Org.  Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts.

 Salesforce Connect lets your Salesforce org access data from a wide variety of external systems. You can integrate tables from SAP® NetWeaver Gateway, Microsoft Dynamics® NAV, and many other data sources in real time without writing a single line of code. 

 Previously, the only way to integrate external data with Salesforce was to use extract, transform, and load (ETL) tools. That process is time-consuming and requires you to copy data into your org that you might never use or quickly becomes stale. In contrast, Salesforce Connect maps data tables in external systems to external objects in your Org.

  External objects are similar to custom objects, except that they map to data located outside your Salesforce Org. External object data is always up to date. Salesforce Connect provides a live connection to external data rather than a copy that consumes storage and must be regularly synced. Accessing an external object fetches the data from the external system in real time.

 We recommend that you use Salesforce Connect if most of these conditions apply.
 You have a large amount of data that you don’t want to copy into your Salesforce Org.
 You need small amounts of data at any one time.
 You need real-time access to the latest data.
 You store your data in the cloud or in a back-office system, but want to display or process that data in your Salesforce Org.


73) What is FlexiPage? 
A) FlexiPage Represents the metadata associated with a Lightning page. A Lightning page represents a customizable screen made up of regions containing Lightning components.

74) What are Local and Global Ids with respect to lightning?
A)Component IDs
A component has two types of IDs: a local ID and a global ID. You can retrieve a component using its local ID in your JavaScript code. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.

Local IDs
A local ID is an ID that is only scoped to the component. A local ID is often unique but it’s not required to be unique.
Create a local ID by using the aura: id attribute. For example:
Find the button component by calling cmp.find(“button1”) in your client-side controller, where cmp is a reference to the component containing the button.

Global IDs
Every component has a unique globalId, which is the generated runtime-unique ID of the component instance. A global ID (1) is not guaranteed to be the same beyond the lifetime of a component, so it should never be relied on. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.

75) What is the use of Access="Globel"?
A) The framework enables you to control access to your applications, attributes, components, events, interfaces, and methods via the access system attribute. The access system attribute indicates whether the resource can be used outside of its own namespace.
You can specify these values for the access system attribute.

Private: Available within the component, app, interface, event, or method and can’t be referenced outside the resource. This value can only be used for or.Marking an attribute as private makes it easier to refactor the attribute in the future as the attribute can only be used within the resource.
Accessing a private attribute returns undefined unless you reference it from the component in which it’s declared. You can’t access a private attribute from a sub-component that extends the component containing the private attribute.

Public: Available within your org only. This is the default access value.

Global: Available in all orgs.

76) How can we communicate between the two components?
A)In Lightning Component Framework, the communication between two component is accomplished supported in several ways.
1. Attributes or Methods to pass data down the component hierarchy
2. Lightning Events to pass data up and around in the component hierarchy.

77)How to improve the performance of Lightning?
A)The list of performance best practices discussed in this document includes:
78) What is the Lightning App?
A)Lightning Apps are made of Lightning components.Lightning App is a special top-level component whose markup is in a .app resource.You can Access app using URL of this pattern https://.lightning.force.com//.app Mark upstarts with Types Standalone – can be hosted outside SF1 and LE, like lightning out and VF pagesLightning Experience and SF1 – Can take advantage of record create and edit pages, among other benefits


No comments:

Post a Comment