LWC Coading Related Interview Questions By Swhizz Technologies

 

                                LWC Coding Related Questions

1. Can we call the @AuraEnabled function in the apex class using wire ?

2. What do you mean by  cacheable = true annotations ?

3. @wire(getBoats,{boatTypeId : this.boatTypeId})

         getBoats(error,data){}

Will the above code deploy? (Assuming all variables and apex class function exists).

4. Why do we use $ when passing property in wire function, what does it mean? [Latest Salesforce

5. See the below code and answer the following question: [Scenario based Salesforce       Lightning Interview question with relevant answer]

If I want to refresh the wired data in the above function, can I call refreshApex(this.someVar) ?

@wire(getBoats,{boatTypeId : ‘$boatTypeId’})

getBoats({error,data}){

if(data){

this.someVar = data;

this.error = undefined;

}

else if(error){

this.error = error;

this.someVar = undefined ;

}

}

6. Can we call a wire function inside a javascript function like below :

searchBoats(event){

@wire(getBoats,{boatTypeId: ‘$boatTypeId’}

getBoats(data,error){

}

}

Assume searchBoats is being called on click of button? Will I be able to deploy the code ?

7. When is the wire method/property called in the lifecycle of a component ?

8. What are lifecycle hooks in LWC ?

9. Is wire method called multiple times during lifecycle of component ? (True / False)

10. What is the difference between event.StopPropogation() and Event.preventDefault()?

11. If we add required attribute in lightning-input , will I get an error on leaving the field empty ?

12. Are quick actions supported for LWC components ?

13. How can i reference record ID of page in my component which is fired from quick action.

14. What is a promise in async transactions? What are it different stages

15.What is the difference between Promise and Promise.all

16.What are web components, Is LWC based on web components ?

17.Why do we extend  LightningElement ?

18.When we create new component why does it say export default ComponentName ?

19. How do I retrieve elements on the basis of ID?

20. How to send data from Parent to Child in LWC ?

21. If we parent component A and there are two component B and C as child components. How can we communicate between B and C ?

23. What does composed = true does in an event ?

24. When you fire an event, can i capture it in same template/ component ?

25. When you fire an event, can i capture it in same template/ component ?

26.What are callback functions in LWC ?

27.Are callback functions synchronous or asynchronous ?

28. What are decorators in LWC (Lightning web components) in Salesforce?

29.When do I use @track on a property ? Do I still need it considering all properties are by default reactive now?

30.Can I use multiple decorators on one property ?

31. Can I deploy component with empty css file ?

32. What is difference between var and let in JS ?

33. Is there any difference in how we add LWC component inside another LWC component and inside AURA component ?

34.What is LMS ?

35.Do we have application events in LWC?

36. How can we navigate user from LWC component to record detail page?

37. Do we have force:createRecord equivalent in LWC?

38. What is render() , is it part of lifecycle hook? Why do we use it ?

39. Can I get current user ID in LWC without apex?

40.When do we face error of “Cant assign to Read only property” in LWC?

41.How can I evaluate expression in situation like <template if:true = {someVariable % 7==0}?

42.Why do we put constants outside of class in LWC?

43.How to query all lightning-input , combobox, radio buttons using one querySelector or do I have to use multiple ?

44.What is reduce method in JS ?

45.What is the use of a Lightning Component Framework?

46.In how many ways can lightning components be made?

47. Mention some of the components of Salesforce Lightning?

48.Mention some of the types of events of Salesforce Lightning components?

49.Do you think Aura Web Components and Lightning Web Components can coexist together?

 50.What does a component bundle contain?

51.What is the use of Visual Building tools?

52.What are the different Lightning page types?

 53.What are the advantages of using Lightning Component Framework?

54.List out the sequence of Application event propagation?

55.Describe the file structure of Lightning Web Components?

 56.What are the rules to be followed while naming files?

57.How to iterate through the list in LWC?

58.Expand SLDS

59.What is the use of the Salesforce Lightning Design System?

 60.Is there any possibility of having multiple wire methods in Lightning Web Component?

61.What is renderedCallback() in Lightning Web Components?

 62.What is the use of @wire in LWC?

63.List out the tools present in Salesforce Lightning?

64.What is Lightning Process Builder?

65.Expand SFDX

66.Which method is called when every component is connected or when the reactive properties                have changed?

67.Why does LWC work faster than Aura components?

68.How do Lightning Web components communicate with Aura components?

69.Mention some disadvantages of Lighting Web Components.

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

71.Explain Namespace in the Salesforce Lightning Components.

72.Where can the Lightning components be used?

73.What are Component events?

 74.What are Application events?

75.What are bound and Unbound Expressions?

76.What function does Javascript serve in the LWC?

77.What does Salesforce Lightning's Lightning Locker do?

78.Describe navigation in Lightning.

79.What kinds of characteristics are there that can be utilized to store values?

80. What are the various stages of the transmission of application events?

81.What distinguishes an application event from a component event?

82.How we can bind data in LWC?

83.How we can pass data from HTML to JS controller?

84.How we can iterate list in Lightning Web Component (LWC)?

85.Can we display multiple templates?

86.How we can access elements in controller?

87.How we can load third party JavaScript (JS) library in Lightning Web Components (LWC)?

88.How to access static resource?

89.How we can make changes in components body after it rendered?

90.How to call Apex in Lightning Web Components?

91.How we can use Lightning Web Components in Visualforce?

92.How to we can use Lightning Web Components outside Salesforce?

93.Is it possible to iterate map in Lightning Web Components?

94.How to iterate sObject list in Lightning Web Components?

95.How to access labels in Lightning web components?

96. What is the Lightning Message Service?

97. How to access events in Lightning Web Components?

98. Where you can use/access Lightning Web components in Salesforce?

99. Explain Flow of lightning Web Components (LWC)?

100.Explain Styling Hooks for Lightning Web Components?

101. What is Aura Tokens?

102.How you can use Aura Tokens and SLDS Design Token in LWC?

103.Describe Scratch org?

104.How do you handle user input in LWC?

105.How can you conditionally render a part of the template in LWC?

106.What is the role of the wire service in LWC?

107.How do you handle errors and exceptions in LWC?

108.How do you import and export JavaScript modules in LWC?

109.How do you use CSS modules in LWC?

110.What are some best practices for testing LWC components?

111.How do you create and dispatch custom events in LWC?

112What is component composition in LWC?

113How do you access Salesforce data within LWC components?

114.How do you call Apex methods from LWC components?

115.How do you integrate LWC with external services?

116.What are some performance optimization techniques for LWC?

117.How do you handle errors and debugging in LWC?

118.How does component inheritance work in LWC?

 119.What are some best practices for styling LWC components?

120.How do you create dynamic components in LWC?

121.What are the LWC security best practices?

122.How do you implement internationalization and localization in LWC?

123.How do you manage LWC component versioning and upgrades?

124. What are some strategies for LWC adoption and migration?

125.How can you implement pagination in LWC components?

 126.How would you build a custom search component using LWC?

127.How would you create a reusable LWC component library?

128.How do you handle complex data structures in LWC components?

129.How do you integrate LWC components with Lightning Flows?

130.How can you build responsive LWC components?

131.How do you troubleshoot performance issues in LWC components?

132.What is the role of the meta configuration file?

133.What does it mean by Lighting Out?

134.What is the loading spinner in LWC?

135.Explain the difference between a getter and a setter in LWC.

Comments

Popular posts from this blog

Common Interview Questions and Role Based Interview Questions

LWC Interview Questions for Freshers and Experienced