Salesforce Interview Questions with Answers Part 73

Salesforce Interview Questions with Answers Part 73

1. Algorithms vs Data Structure

Algorithm:

Algorithm is a set of rules or steps that can be used to solve a problem.

Data Structure:

Data Structure is a particular way of organising data.

2. static and static final keywords in programming

3. Disable Salesforce Experience Cloud Site from Search Index

4. Safe Navigation Operator

? in Salesforce Apex used for Safe Navigation Operator.

The safe navigation operator (?.) can be used for checking null references.

Sample Code:

Account objAcc;

if ( String.isNotBlank( objAcc.Name ) ) {
    
    System.debug(
        'Account name is ' +
        objAcc.Name
    );
    
}

“Attempt to de-reference a null object” Exception will be thrown for the above code since objAcc is null.

So, the safe navigation operator (?.) can be used in this case to avoid the null pointer exception.

Sample Code with Safe Navigation operator (?.):

Account objAcc;

if ( String.isNotBlank( objAcc?.Name ) ) {
    
    System.debug(
        'Account name is ' +
        objAcc.Name
    );
    
}

Blog Post:

5. Database Index

A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and storage space to maintain the index data structure. Indexes are used to quickly locate data without having to search every row in a database table every time said table is accessed. 

An index is a copy of selected columns of data, from a table, that is designed to enable very efficient search. An index normally includes a “key” or direct link to the original row of data from which it was copied, 

6. Salesforce Lightning Web Component notifyRecordUpdateAvailable

notifyRecordUpdateAvailable in Salesforce Lightning Web Component is used to notify the Lightning Data Service that the record data has modified/changed on the server so that the Lightning Data Service can take the appropriate actions to keep wire adapters updated with the latest record data.

7. What Profile Permission is needed to update Opportunities on the Forecasting?

“Override Forecasts” Permission is required to update or modify or override Forecasting.

8. How to track Successful and Failure Salesforce Platform Events?

EventBus.EventPublishSuccessCallback and EventBus.EventPublishFailureCallback interfaces can be used in an Apex Class to track Successful and Failure Salesforce Platform Events.

9. SELECT Name, Company, Email, 

CreatedDate, Status, LeadSource 

FROM Lead ORDER BY CreatedDate DESC LIMIT 10

The above SOQL fetches top 10 Lead records based on the created date. What should be done to the SOQL to ignore the first 5 and fetch the rest.

In SOQL, OFFSET can be used to point on a particular row. So, we have to set the OFFSET value as 5.

Note:

The OFFSET value can be set from 1 to 2000.

Maximum OFFSET value that we can set is 2000.

10. How to find number of Contacts with Email field not blank?

SELECT COUNT( Email )
FROM Contact

11. What does SAML assertion contains?
SAML assertion contains the following:
Issuer: Name of the Identify Provider.
Entity Id: Name of the Service Provider.
User Identifier: Identifier for identifying the user like Username, Email, Federation Identifier, etc.
Digital Signature: Signed version of the assertion that is used to identify that the assertion was generated by the Identity Provider.

12. errorCallback in Salesforce Lightning Web Component
errorCallback will not handle the error of the same component. But, it will handle the error of the child components added to the component.

13. Configurable Self-Reg Page for Easy Sign-Up in Salesforce Experience Cloud Site

To give Experience Cloud visitors a simpler, mobile-centric self-registration experience in Salesforce, use the Configurable Self-Reg Page. With this self-registration page in the Experience Cloud Site configuration, external users can sign up with only an email address or phone number, instead of having to create a username and password. With this lightweight sign-up process, you can limit the amount of information that you collect from the users when they sign up. On subsequent logins, you can get more information, building a member’s profile through progressive profiling powered by the login flow.

14. Data Lake

A data lake is used for storing pool of raw data. But, the purpose for which is not yet defined. 

15. Data Warehouse

A data warehouse is used as a repository for structured, filtered data that has already been processed for a specific purpose.

Leave a Reply