Ad Code

Salesforce lightning interview questions - Part 2

Salesforce lightning interview questions

In our previous article we have seen first part of important interview questions on the salesforce lightning framework. In this post, we will discuss some more frequently asked interview questions. 


1. How do you get the record id in the lightning component?

Ans: By using the interface Force:hasRecordId, which enables the component to be assigned with the Id of the current context record. 


2. What is the difference between the client-side and server-side controller in salesforce lightning experience?

Ans: Client-side controller - It is a JavaScript controller or helper bundle in the lightning component where we write a logic to get data from the server and render the user interface.

Server-side controller - It is an Apex code which is at the server-side. By using @AuraEnabled annotations at the apex class methods, actions from the client-side get the response. 


3. What is the use of SLDS or salesforce lightning design system?

Ans: SLDS enables developers to build rich user interfaces with prebuilt classes. It eliminates writing custom styles to the HTML elements.

No need for referencing it in the component as it is already included in the framework and users just need to write a specific class name to the HTML elements.


4. How do we refer SLDS to the lightning component?

Ans: SLDS or salesforce lightning design system is already embedded in the salesforce applications. As a developer, we just need to mention the classes while developing lightning components.


5. What is one way/two-way binding in the lightning?

Ans: One-way binding, {# expression} which is an unbound expression, whenever there is a change in a child attribute it doesn’t affect the parent attribute.

Two-way binding, {! expression} which is a bound expression, whenever there is a change in child attribute it affects the parent attribute.


6. What is the use of “!” symbol in the salesforce lightning data binding?

Ans: It is an expression syntax which is resolved at the runtime to show the attribute values 


7. What are the return types of SOQL?

Ans: sObject         - gets a single object from the query [use limit 1 in the query]
       List<sObject> - to get multiple sObject records
       Integer          - to get the count [Ex: Integer sCount = select count (Id) from Account]


8. What are the return types in SOSL?

Ans: List<List<sObject>> and List<sObject> 


9. Which Data types do SOSL supports on its query?

Ans: We can run SOSL query on Text fields, Phone fields, and Email fields


10. What is the difference between list, set and map? 

Ans: List - an ordered collection which allows duplicates
       Set  - unordered collection which doesn’t allow duplicates
       Map - Key value pair


If you have any questions, feel free to post it in the comments section below. Thanks for using our services. All the best. 

Post a Comment

0 Comments