Learn LWC
Lightning Data Service, wire adapters, performance, and component communication.
Visual guide for LWC
Concept at a glance
LWC uses Lightning Data Service and wire adapters for reactive, cached record data across components.
- @wire & LDS caching
- Component communication
- Performance & lazy load
- Security & Locker
LWC uses Lightning Data Service and wire adapters for reactive, cached record data across components.
Difficulty Level
Topic Focus
Showing 38 of 168 LWC questions
What is Lightning Web Components (LWC)?
Leadership wants a custom widget on the Account page. You explain why LWC is the modern choice.
What is the difference between @api and @track?
A parent passes a record Id to a child component. You explain public properties and reactivity.
How do parent and child LWCs communicate?
A child picker selects an Account and the parent list must refresh. You explain communication patterns.
What is Lightning Data Service (LDS)?
You need Account Name on a component without writing Apex. You introduce LDS.
What is @wire in LWC?
You load picklist values for an object field without Apex. You explain wire adapters.
How do you call Apex from LWC?
On button click, you submit a form that creates a Case via server logic. You outline the pattern.
What is SLDS and why use lightning-base components?
A developer builds custom HTML buttons that look wrong on Salesforce mobile. You point them to base components.
How do you deploy and test LWCs?
Your component works locally in VS Code but fails in sandbox. You describe LWC dev workflow basics.
What are lifecycle hooks in LWC?
You must load data when a component appears on a tab. You explain connectedCallback.
What is navigation in LWC?
After creating a record, you redirect user to the new record page. You mention NavigationMixin.
How does LWC handle forms and validation?
Users submit incomplete custom forms. You describe client-side validation approach.
What common LWC performance mistakes should beginners avoid?
A datatable component loads thousands of rows and freezes the browser. You list beginner performance tips.
Use lightning-record-picker for lookup replacement
Custom lookup LWC reimplements search poorly; users want recent records and advanced filter.
Compare LWC base components vs custom HTML elements
Developers build custom checkbox inputs inconsistent with Lightning Experience styling.
Load imperative Apex on user action not connectedCallback for record pages
Every record page load fires five imperative Apex calls from connectedCallback even when user never opens tabs.
What are the conditional and loop directives in LWC templates?
Basic template syntax question.
What @salesforce modules can you import in LWC?
Rapid-fire LWC imports question.
How do you show toast messages and navigate after save?
After creating a record, show success and open the new record.
How do you call an @api method on a child component?
A parent needs to reset a child form.
What is the difference between lightning-record-form, record-view-form and record-edit-form?
Choosing a base component for a simple edit page.
How do getters improve LWC templates?
A template needs to show "Overdue" when a due date is in the past.
What is the difference between Aura and LWC, and why migrate?
Client asks why to rebuild working Aura components.
How do you make an LWC configurable in App Builder with design attributes?
Admins want to set a title and number of records on a component.
What files make up an LWC bundle?
First LWC question in a fresher interview.
How do you pass data from a parent to a child component?
A list component must pass each record to a row component.
What is the difference between wire and imperative Apex calls?
A component must load data on load and also save on button click.
How do you show a spinner while data loads?
Users think the component is broken while it loads.
What is the "recordId" property and how does it get populated?
A component on a record page needs the current record.
How do you style an LWC?
A component needs custom styles that match Salesforce.
What are base Lightning components and why use them?
A junior builds custom buttons and inputs from scratch.
How do you validate form inputs in LWC?
A custom form must block submission with invalid email.
What is the difference between connectedCallback and renderedCallback?
Quick lifecycle question.
How do you navigate to a record page from LWC?
A button should open an Account.
What is the difference between @api, @track and @wire decorators?
Classic LWC basics question.
How do you handle events from a child in the parent template?
A child dispatches "rowselect".
What is the purpose of the key attribute in loops?
Quick template question.
How do you debug an LWC in the browser?
A component shows nothing and no errors appear.
How do you import and use a custom label in LWC?
Button text must be translatable.