Professional Documents
Culture Documents
Lightning and LWC Interview Questions
Lightning and LWC Interview Questions
method1:function(component)
{
var name='sfdcscenarios';
this.method2(name);
},
method2:function(name)
{
//reusability
console.log('name from method1 is'+name);
}
16.what is exends="force:slds"?
It will acquire the properties of lightning design system?
18.what is v in attribute?
It's a value provider. If you want to access the value from the attribute then we will
use {!v.attrname} or{#v.attributename}
component
controller
helper
design
svg
Documentation
style
renderer
22.what is renderer?
If you want to override the standard rendering mechanism in salesforce lightning
then we should go with renderer
component event
application event
system events
24..Which interface should you use if you want to get the id of the record from the record Detail
page?
force:hasRecordId
<aura:dependency resource="c:FlipCard"/>
</aura:application>
*Add the <apex:includeLightning /> component to your Visualforce page.
*Reference a Lightning app that declares your component dependencies with $Lightning.use().
*Write a function that creates the component on the Visualforce page with
$Lightning.createComponent().
action.setParams
"e.force:navigateToComponent"
29. How to go from one lightning page to another lightning page through a click?
Make the use of Salesforce lightning design system for consistent ui design.
Make the use of Lightning data services to avoid server calls for Dml operations.
Use unbounded expressions if the data across components are not required to be in synch.
Before you decide to use a third-party library in a Lightning component, you should reevaluate if
you really need that library. DOM manipulation libraries (like jQuery) and UI libraries (like
Bootstrap or jQuery UI) in particular may no longer be needed when working with the Lightning
Component Framework.
When possible, use the (sprite-based) Lightning Design System icons (using <lightning:icon>
and <lightning:buttonIcon>) instead of custom icons.
Salesforce is slower for users who have debug mode enabled. So, do not enable in Production.
When making a call to the server limit the columns and rows of the result set. Only select the
columns you need.
Set a limit on the query and provide paging mechanisum if needed. Don’t return huge number of
rows at once.
Caching the data at the client side can significantly reduce the number of server round trips and
improve the performance tips. A storable action is a server action whose response is stored in
the in the client cache so that subsequent requests for the same server method with the same
set of arguments can be accessed from that cache.
Try to limit number of event handlers in your Lightning component. As you can guess, multiple
event handler means your component would be busy in listening event changes resulting in
performance overload.
Always try to use a component event instead of an application event, if possible. Component
events can only be handled by components above them in the containment hierarchy so their
usage is more localized to the components that need to know about them. Application events
are best used for something that should be handled at the application level, such as navigating
to a specific record. Application events allow communication between components that are in
separate parts of the application and have no direct containment relationship.
32. Which interface should you use if you want to override a standard action?
33.Which interface should you use if you want your component to be available only on the
record home page?
34.Which interface should you use if you want your component to be used a tab?
35.Which interface should you use if you want your component to be used a quick action?
36.How can you call the controller method based on a component load?
Component events are events which are fired by child components and handled by the parent
component. We can make use of this event when we need to pass a value from a child
component to parent component.
Application events can be fired from any component and can be handled by any component.
They do not require any kind of relationship between the components, but these components
must be a part of a single application.
Bubble Phase
Capture Phase
Bubble Phase
Capture Phase
Default Phase
we can directly call a child component controller method from the parent component controller
method using Aura:method. This method is used to pass value from parent component
controller to the child component controller.
LWC bundle contains an HTML file, a JavaScript file, and a metadata configuration file and
these files are created once we create a Lightning web component.We can also create a .css
file for styling purpose and We can also create SVG file for the purpose of displaying icon.
1) @api
2) @track
3) @wire
47. Is there any limit on how many component to have in one Application ?
there is no limit.
No.
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.
Faster development – : Empowers teams to work faster with out-of-the-box components that
function seamlessly with desktop and mobile devices.
we can deploy component by using managed packages, Force.com IDE, Force.com Migration
Tool or Change Sets.