0% found this document useful (0 votes)
495 views13 pages

LWC Interview Questions v1.0 SC

Lwc interview questions and answers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
495 views13 pages

LWC Interview Questions v1.0 SC

Lwc interview questions and answers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 13
Salesforce Lightning Web Component (LWC) Interview Questions Rupom Chakraborty Sr.Solution Architect Shyamla Plaza, Behind Mythrivanam, Ameerpet , Hyderabad, Telangana State, India RELL) Capital Info Solutions ‘Shyamala Plaza, Behind Mythrivanam, Amerpet, Hyderabad, Telangana State, INDIA. Ph: 8686864286 1. What is Aura Framework? Aura is an open source framework developed by Salesforce. It is a component-based framework to develop Ul components. 2. What is Lightning Framework? Lightning Framework is based on Aura Framework to design and develop Salesforce Aura components. Lightning framework is also developed by Salesforce, but unlike Aura Framework, it is not open source. 3. In which Salesforce release, Lightning Components were introduced? Lightning was introduced in Salesforce Winter 15 release. 4. How to create a Lightning Web Component? you cannot create LWC directly from your developer console. You need to SFDX or MS Visual Code to create your lightning component. 5. Is it Work Together with Lightning Web Components and Aura Components? Yes, Lightning web components and aure components work together without any issues. Aura components can contain Lightning web components, but Lightning web components can't contain aura components. 6. What is a @track decorator in js file? It will keep track of the property's value changes. This decorator is used to make a property private and which helps to re-render the component when the property value is changed. 7. What is a @api decorator in js file? Itis used to expose the public property of a web component. this property can use in it's parent component. 8. What is a @wire decorator in js file? To access Salesforce data (calling an apex method), Lightning web components use a reactive wire service. RUPOM CHAKRABORTY Capital Info Solutions ‘Shyamala Plaza, Behind Mythrivanam, Amerpet, Hyderabad, Telangana State, INDIA. Ph: 8686864286 9.What is Web Stack? Collection of software applications needed for the Web Development can be called as Web Stack. It includes - * Operation System * Database * Business Logic * Web Server 10. What is rendering? The process of converting HTML tags to meaningful readable web page with the browser rendering engine. 11. What are the Standard Elements? The elements provided in HTML library. We can also create custom element as per the requirement which won't be part of standard HTML library. 12. What is event? When the page load completes or user perform mouse or keyboard operation events will trigger which can used to execute the javaScript. 13. What is Module? A module is a javaScript file. Ina module we define variables and functions which can be exposed to other module by using export” directive. To use the variables and functions of the other module we need to import other module by using "import" directive. The reason of using module is to decompose the logic. Instead of making all the functions available within the same file, if they maintain the functions in different files, based on the need we can import the corresponding module. 14. What is Directive? It is a token which is having specific behavior. Example: export, import It modifies the behavior of an existing element by assigning value and responding to change events RUPOM CHAKRABORTY Capital Info Solutions ‘Shyamala Plaza, Behind Mythrivanam, Amerpet, Hyderabad, Telangana State, INDIA. Ph: 8686864286 15. What is Decorator? It is a function which is having predefined functionality. Syntax: @DecoratorName Similar to annotations in apex class. 16. What is Shadow DOM? It is just a normal DOM except the separate behavior in relation to the rest of the page.It won't be having conflicts with the styles which applied to the rest of the page. It maintains in a separate DOM tree. (Alternative to iframe) 17. What are the Custom Elements? Custom elements can be created to extend HTML and define our own tags. 18. What is template? Itis a reusable structure in the HTML page but it won't be rendered until we refer it in the javaScript. 19. What is Slot? Itis a place holder in template and the content can be replaced based on the need 20. What are the Web Components? It holds collection of web platform APIs and allows you to create custom functionality which can be used in Web Pages. 21. What are the Lightning Web Components? Lightning Web Components uses core Web Components standards. Lightning web components are custom HTML elements built using HTML and modern JavaScript. 22. What is Classiin javaScript? A class is a type of function, but instead of using the keyword function to initiate it, we use the keyword class, and the properties is assigned inside a constructor() method. 23. What is Scratch org? Scratch org is a disposable Salesforce org used for development and testing. Scratch org can be created for a maximum of 30 days after which scratch org gets deactivated, The default duration for Scratch org is 7 days 24. Explain the Lightning Web Component Bundle? RUPOM CHAKRABORTY Capital Info Solutions ‘Shyamala Plaza, Behind Mythrivanam, Amerpet, Hyderabad, Telangana State, INDIA. Ph: 8686864286 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. 25. Explain CSS in Lightning Web Component Bundle? We can also create a .css file for styling purpose and We can also create SVG file for the purpose of displaying icon. 26. How to render the HTML file conditionally? If we want to render HTML conditionally we can make use of if:true=(propertyName) if:false=(propertyName} in nested template tag. 27. How to iterate over an array in HTML file? We can make use of foreach directive and iterator directive. foreach directive: foreach directive is used to render an array. To render an array add the for:each directive to a nested template tag, for:item Is used to access the current item, for:index is used to access the current index. Iterator directive: If you have the requirement to access the first and the last element in the list use the iterator directive. 28. What are the types of decorators in lightning web components? We have 3 Decorators in Lightning Web Components. 1) @api 2) @track 3) @wire 29. Explain all threedeeerators in lightning web components? ‘See course material for answers 30%\What is the file structure of Lightning Web Components myComponent folder myComponent. html myComponent.js myComponent.js-meta.xml myComponent.css myComponent.svg The folder and its files must follow these naming rules. RUPOM CHAKRABORTY Capital Info Solutions ‘Shyamala Plaza, Behind Mythrivanam, Amerpet, Hyderabad, Telangana State, INDIA. Ph: 8686864286 + Can‘t contain a hyphen (dash) + Must begin with a lowercase letter + Can‘t include whitespace + contain only alphanumeric or underscore characters + Can‘t end with an underscore * Must be unique in the namespace + Can‘t contain two consecutive underscores 31. How can you display components HTML conditionally To render HTML conditionally, add the if:true |false directive to a nested