🔹 Top 100 lwc Interview Questions – For 5 Years’ Experience
By Abhijeet Kurchania
linkedin.com/in/abhijeet-kurchania-pmp-csm-aws-17943b30
LWC Basics (10)
1. What is Lightning Web Component (LWC)?
2. How is LWC different from Aura Components?
3. Explain the LWC lifecycle hooks.
4. What is the role of @api, @track, and @wire?
5. What is Shadow DOM in LWC?
6. How does data binding work in LWC?
7. How do you pass data between parent and child components?
8. What is the difference between get and set in LWC?
9. How do you handle events in LWC?
10.How can you make a component reactive?
🔹
Decorators in Depth (10)
11.When do you use @track vs @api?
12.Explain how @wire works.
13.What are the implications of using @api on methods vs properties?
14.Can you mutate @track properties? How?
15.How do you handle nested object changes?
16.Why was @track deprecated for primitive types?
17.How can you achieve reactive state without @track?
18.Can you use @wire with imperative Apex?
19.What happens if you call an @api method from child to parent?
20.How does @wire behave with caching?
🔹
Data Communication (10)
21.How do you send events from child to parent?
22.What is the difference between custom events and Lightning Message Service
(LMS)?
23.How can components communicate across DOM boundaries?
24.When to use pub-sub model?
25.How do you send complex objects in events?
26.What is the difference between bubbling and composed events?
27.What are the limits of LightningMessageChannel?
28.How do you handle bi-directional communication?
29.What is the role of event.stopPropagation()?
30.How do you handle multiple listeners for the same event?
🔹
Apex Integration (10)
31.How do you call Apex from LWC?
32.What are the different ways to fetch data from Apex?
33.How do you handle errors in wire and imperative calls?
34.Can you use @wire with parameters?
35.How do you use cacheable Apex methods?
36.What are best practices for calling Apex from LWC?
37.How do you handle large data sets (pagination)?
38.How can you pass parameters to an Apex method in @wire?
39.How to refresh Apex data in LWC?
40.What is the difference between wire and imperative call?
🔹
HTML & Styling (10)
41.How do you apply conditional styling?
42.How do you apply SLDS in LWC?
43.What is the difference between Lightning Base Components and Custom HTML?
44.Can you use external CSS in LWC?
45.How do you make components responsive?
46.What is static resource and how to use it?
47.How do you handle dynamic class assignment?
48.What is the use of template directives like if:true, for:each?
49.How do you pass CSS from parent to child?
50.Explain scoped vs global CSS in LWC.
🔹
Component Composition (10)
51.What is composition in LWC?
52.Can a component extend another component in LWC?
53.How do you pass slots in LWC?
54.What are named slots and how do you use them?
55.What is shadow DOM and how it affects component composition?
56.Can parent call child methods directly?
57.Can a child access parent properties?
58.How do you conditionally render child components?
59.How do you dynamically load components in LWC?
60.Difference between renderedCallback and connectedCallback?
🔹
Performance & Best Practices (10)
61.What are the LWC performance optimization tips?
62.How does caching work with @wire?
63.How to reduce re-rendering in LWC?
64.When should you use @wire vs imperative Apex?
65.How do you reduce API calls in large applications?
66.How do you prevent reactivity issues in nested objects?
67.Why avoid JSON.parse(JSON.stringify(...)) in state management?
68.How do you debug performance issues in LWC?
69.What are some common LWC anti-patterns?
70.How do you handle large lists without DOM lag?
🔹
Testing & Debugging (5)
71.How do you debug a failing Apex call?
72.How do you use Jest for testing LWC?
73.How do you mock @wire in unit tests?
74.What tools help inspect and debug LWC in browser?
75.How do you test events fired from child to parent?
🔹
Advanced Scenarios (10)
76.How do you implement infinite scroll in LWC?
77.How do you create dynamic forms?
78.How to work with dynamic imports in LWC?
79.Can you lazy load components?
80.How do you call platform events from LWC?
81.How to render modals in LWC?
82.How to handle file uploads in LWC?
83.How do you integrate LWC with external APIs?
84.Can you use WebSockets in LWC?
85.How do you implement drag-and-drop in LWC?
🔹
Security & Governance (5)
86.How does Locker Service affect LWC?
87.Can you bypass field-level security in Apex?
88.How do you handle XSS in LWC?
89.What is Lightning Locker and how to debug it?
90.Can you use eval() in LWC?
🔹
Miscellaneous (10)
91.What is the difference between Lightning App Page and Record Page?
92.How do you implement navigation in LWC?
93.How do you use LDS in LWC?
94.How do you create reusable LWC components?
95.Can you use LWC outside Salesforce (Open Source)?
96.What is Lightning Out and is it still relevant?
97.What is the role of import statements in LWC?
98.Can you use Lightning Data Service with custom objects?
99.What are the platform limits for LWC?
100. How to deploy LWC using CI/CD?