Salesforce Interview Questions on LWC -
1. Expand LWC.
Ans - Lightning Web Component.
2. Is LWC and Aura the Same? Difference Between LWC and Aura?
Ans - LWC are created using web stack tools and aura are created using HTML5 and JavaScript.
3. What do you mean by salesforce Lighting?
Ans - Salesforce lightning is a component-based framework that means we can divide applications into a number of components.
4. Expand LCF
Ans - Lightning component framework.
5. What is the use of an LCF?
Ans - LCF is used to develop dynamic web applications.
6. How many ways we can create lightning components?
Ans - There are 2 ways to create a lightning component.
a. LWC
b. Aura component
7. Tell me the types of the event of Salesforce Lightning components?
Ans - a. Application Event
b. System Event and
c. Component Event
8. What is LWC?
Ans - LWC is used to develop salesforce lightning components.
9. What does a component bundle contain?
Ans - a. Style
b. Renderer
c. Documentation
d. Helper and
e. Controller
10. What are the different Lightning page types?
Ans - a. Home Page
b. App Page and
c. Record Page
d. Embedded Service Page
11. Describe the file structure of Lightning Web Components.
Ans - a. html file
b. js file
c. xml file
d. css file
e. svg file
12. How we can iterate list in LWC?
Ans - a. using for : each
b. Iterator
13. What is the use of Visual Building tools?
Ans - Visual Building tools provide drag-and-drop features. using these we can easily develop app.
14. Expand SLDS.
Ans - Salesforce Lightning Design System.
15. What is the use of the Salesforce Lightning Design System?
Ans - Salesforce Lightning Design System is used to develop web applications.
16. Is there any possibility of having multiple wire methods in the Lightning Web Component?
Ans - Yes
17. What is the use of @wire in LWC?
Ans - @wire method is used to specify the apex method and to retrieve the data.
18. List out the tools present in Salesforce Lightning.
Ans - a. Lightning Component Framework
b. Lightning Connect
c. Lightning App Builder
d. Lightning Schema Builder and
e. Lightning Process Builder
19. What is Lightning Process Builder?
Ans - Lightning Process Builder is a user-interface tool and it is used to create visualizations and automate processes.
20. Expand SFDX.
Ans - Salesforce Developer Experience.
21. Which method is called when every component is connected or when the reactive properties have changed?
Ans - @wire method
22. What are Lifecycle Hooks in LWC?
Ans -
a. Constructor
b. Connected Callback
c. Render
d. Render Callback
e. Error Callback
f. Disconnected Callback
23. Can we call the @AuraEnabled function in the apex class using wire?
Ans - yes
24. Are Quick Actions supported for LWC components.
Ans - only supported on the Record page.
25. Can I use multiple decorators on one property?
Ans - No
26. How to send data from parent to child in LWC?
Ans - using @api
27. What are the differences between Promise and Promise.all?
Ans - Promise returns a single promise object and Promise.all returns a block of promise object.
28. What is LMS?
Ans - LMS is a publish-subscribe library and is used to communicate with DOM.
29. What is the Difference between == and ===?
Ans - == is used to compare the value and === is used to compare the value & its datatype.
30. What is String Interpolation?
Ans - String Interpolation is used to display dynamic data. we can specify dynamic data in { }.
31. What is Template Literals?
Ans - String Interpolation is performed using template literals. and template literals created using backtick ( ` ).
32. How can you display components HTML Conditionally?
Ans - by using if : true | false.
33. How we can pass data from HTML to JS controller?
Ans - by using the onchange attribute
34. What is Lightning Out?
Ans - Lightning Out means the Component is used for External Sites.
35. What are the component bundles of the Lightning components?
Ans - a. controller
b. documentation
c. style
d. renderer
e. helper