YouTube Icon

Interview Questions.

Top 100+ Salesforce Interview Questions And Answers - Jun 01, 2020

fluid

Top 100+ Salesforce Interview Questions And Answers

Question 1. What Is Apex In Salesforce?

Answer :

Apex is a strongly typed item-orientated programming language.
It permits the developer to execute flows and transaction control statements.
Apex allows builders to feature business logic to maximum machine events like button clicks associated document updates and visualforce pages.
Question 2. What Is Apex Programming Language?

Answer :

Integrated: It provides built-in guide for DML Calls
Inline Salesforce Object Query Language
Easy to Use
Easy to Test
Version
Multi Tenant Aware Application
AJAX Interview Questions
Question 3. When Should I Use Apex?

Answer :

To create Email offerings
Create internet services
Perform complicated validation over more than one objects
To create complicated enterprise methods that aren't supported via workflow
Create custom transaction logic
Attach custom good judgment to every other operation
Question 4. How Does Apex Work?

Answer :

All Apex programs runs completely ON-Demand on Force.Com Platform.
First the platform software server compiles the code into summary set of commands that can be understood by Apex runtime interpreter.
The assemble code is stored to metadata.
When the quit users triggers the execution of Apex by clicking button or visualforce page the software servers retrieves the compiled instructions from the metadata and ship them to runtime interpreter before returning the result.
AJAX Tutorial
Question 5. What Is Apex Email Service?

Answer :

Email offerings is an automated procedure that use Apex classes to process the contents, Headers, Attachments of Inbound Email.

Software Engineering Interview Questions
Question 6. What Is Map Class In Apex Salesforce?

Answer :

Map Class Contains strategies for the Map collection kind.
A Map is series of key values pairs wherein every unique key maps to a unmarried fee. 
Map keys and values may be any information kind primitive types, collections, sObjects, users described kinds, and constructed in Apex Types.
Question 7. What Are The Types Of Soql Statements In Sales Force?

Answer :

Salesforce Object Query Language is used to query that information from the database.Com based totally on the requirement.

There are 2 kinds of SOQL Statements:

Static SOQL
Dynamic SOQL
1.Static SOQL:

The oStatic SOQL Statement is written in []  (Array Brackets)
This statements are much like IINQ(Ion Integrated Query)
2.Dynamic SOQL: 

It is used to refer to the introduction of a SOQL string at run time with Apex code.
Dynamic SOQL allows you to create extra bendy application.
To create Dynamic SOQL query at run time use Database.Query() method, in one of the following methods.
Return a single sObjects whilst the question returns a unmarried report. Ex:sObjects s = Database. Query(String_limit_l);
Return a list of sObjects when the question returns more than a single record.
Software Engineering Tutorial Salesforce Admin Interview Questions
Question 8. What Is Batch Apex In Salesforce?

Answer :

Batch Apex:

Batch Apex lets in you to define a unmarried task that may be damaged up into manageable chunks, whereas each chew can be processed one at a time.

Question nine. What Is Apex Scheduler?

Answer :

It will invokes the Apex elegance to run at unique time.

Anybody who need to agenda their magnificence they need to implement schedulable interface.

Schedule Interface:

The class that implements this interface may be scheduled to run at distinct intervals. This interface has several strategies.

They are:

Public void execute(schedulablecontext sc) and many others.

Salesforce Developer Interview Questions
Question 10. What Are The Types Of Apex Triggers In Salesforce?

Answer :

Triggers Are divided into 2 kinds:

 Before Triggers
 After Triggers
1. Before Triggers:

Before Triggers may be used to update or validate values of a file before they're saved to the database.

2. After Triggers: 

After Triggers Before Triggers can be used to get entry to field values of the records which might be the saved within the database and use this values to make changes in other data.

Syntax:

Trigger trigger_name on Object_Name(trigger_events)

Code block

WHERE trigger_events may be comma separated listing of events.

Apex Tutorial
Question 11. What Is Group By?

Answer :

With  ApI version 18.Zero and  later /you may use institution by using with aggregate functions, inclusive of sum() or max() to summarize the statistics and enable you to rollup question effects in preference to having to method the character statistics in your code.

    Syntax : 

          [ GROUP BY field GROUP BY LIST]

Apex Interview Questions
Question 12. What Is The Usage Of Apex Program With Within Visual Force Page?

Answer :

When you want to call apex magnificence in visualforce page we should claim within the following format.
< Apex : page controller = “class name “ >
Whenever we call  a visualforce page in which controller characteristic is  described it will first create an object for the apex class which is described in controller.
When object is created for the apex magnificence first it includes the constructor.
AJAX Interview Questions
Question 13. What Are Sosl Statements In Salesforce Apex?

Answer :

SOSL declaration examine to a listing of sobjects , wherein every listing incorporates the quest outcomes for a particular sobject kind, The end result lists are usually lower back in the identical order as they had been unique within the question.

If a SOSL query does now not go back any statistics for a distinct sObject type , the search effects include an empty listing for that sObject.

For example, you may return a listing of bills, contacts, opportunities and leds that start with the phase map.

Note : 

The syntax of the classon Apex differs from the syntax of the FIND clause within the SOAP API.

In Apex, the cost of the FIND reason is demarcated with single fees.

Example:1

FIND 'map*' IN ALL FIELDS RETURNING account (Id, Name], Contact, Opportunity, Lead.

In the Force.Com API, the price of the FIND Clause is demarcated with braces.

Example:2

FIND map* IN ALL FIELDS RETURNING account  [Id,name], touch ,opportunity,lead.

From search listing , you could create arrays for every object returned.

Account [ ]  debts = (( listing < accounts > ) seek listing [0] );

Contact [ ]  contacts = [( list ) seek list [0]) ;

Opportunity [ ] opportunities = ((listing < opportunity> ) search listing [2]) ;

Lead [ ] leads = (( listing < lead> ) search listing [3]);

Question 14. What Is Javascript Remoting For Apex Controllers?

Answer :

Use javascript remoting in visualforce to name strategies in apex controllers from javascript.
Javascript remoting has 3 components.
The far flung technique invocation you add to the visualforce web page, written in javascript.
The far flung method definition on your Apex controller class.
This technique definition is written in apex, but there are  few differences from ordinary action strategies.
The response handles callback function you upload to or encompass to your vf page, written in javascript.
Question 15. How To Add Javascript Remoting To A Vf Page?

Answer :

To use javascript remoting in a vf page , upload the request as a java script invocation with the following from.

[namespace.] controller.Method ( 

                           [parameters….,]

                            Call returned Function,

                          [configuration]

                       );

Name area is the namespace of the controller magnificence
Controllers is the call of your apex controller.
Method is the call of your apex controller method you are calling.
Parameters is the comma-separated listing of parameters that your technique takes.
Callback characteristic is the call of the javascript characteristic with a view to manage the reaction from the controller.
Configuration configures the managing of faraway name and response.
Visualforce Interview Questions
Question 16. What Is The Main Difference Between Using Data Table Vs Page Block Table Tags?

Answer :

Page Block:

For default salesforce trendy format.

Data table:

To layout custom codecs.

Question 17. What Is Multi Tenant Architecture?

Answer :

An utility version wherein all customers and apps proportion a single, Common infrastructure and code base.

Salesforce Crm Interview Questions
Question 18. What Is Metadata Driven Development Model?

Answer :

An app improvement model that allows apps to be described as declarative "blueprints”, without a code required. Data Models, gadgets, paperwork, workflows, and extra are defined by using Metadata.

Software Engineering Interview Questions
Question 19. What Are Force Platform Sites?

Answer :

Public web sites and packages that are immediately included along with your salesforce business enterprise with out requiring customers to log in with a username and password.

Question 20. What Is App Exchange Directory?

Answer :

A net directory in which masses of appexchange apps  are  available to salesforce customers to check, demo, remark upon, and /or set up. Developers can post their apps for list on the appexchange listing in the event that they need to proportion them with the community.

Salesforce Lightning Interview Questions
Question 21. What Are Some Apex Classes That Are Commonly Used Within Controller ?

Answer :

 Standard controller, pick out option, pagereference, messages,and so on.

Question 22. What Are The Effects Of Using The Transient Keyword?

Answer :

The transient key-word prevents the records from being stored in to view kingdom. This ought to be used for extremely transient variables.

Question 23. How To Invoke Batch Apex Job (or) How To Execute The Batch Apex Job Programatically?

Answer :

We can use database.Executebatch ( ) approach to programmatically begin the batch job.

Syntax:

Public static ID execute batch ( sObject magnificence name)

Public static ID execute batch (sObject elegance name, integes scope) 

The above two methods are static strategies of database elegance. We can use anybody of the method to execute the batch job.

Salesforce Report And Dashboard Interview Questions
Question 24. What Is Future Annotation(@destiny)?

Answer :

Use the destiny annotation to specify that those strategies that are accomplished asynchronously.
Methods with destiny annotation must be static methods
Methods with destiny annotation can simplest return a void kind.
Syntax: 

worldwide elegance class_name

@future

Static void methodname(parameters)

  

//body of the method

Salesforce Admin Interview Questions
Question 25. What Is S-manage?

Answer :

S-Controls are the foremost salesforce.Com widgets which might be absolutely based totally on JavaScript. These are hosted by way of salesforce however completed at purchaser side. S-Controls are outdated through VisualForce now.

Question 26. Will Visualforce Still Supports The Merge Fields Usage Like S-manage?

Answer :

Yes. Just like S-Controls. Visualforce pages guide embedded merge fields.

Salesforce Integration Interview Questions
Question 27. What Is Soap?

Answer :

A protocol that defines a uniform manner of passing XML-encoded statistics. SOAP Stands for Simple Object Access Protocol.

Salesforce Developer Interview Questions
Question 28. Difference Between Soql Vs Sosl In Salesforce?

Answer :

SOQL:(Salesforce Object Query Language)

Using SOQL we can Search best on one item one time.
We can question on all fields of any datatype
We can use SOQL within the Triggers and the classes.
We can carry out DML operation on square question results.
SOSL:(Salesforce item Search Language)

Using SOSL we can seek on many objects at one time.
We can query only on fields whose records kind is textual content,smartphone and Email.
We can't use in Triggers but can in training.
We can't perform DML operation on search results.
Question 29. What Is Wrapper Class?

Answer :

A Wrapper magnificence is a class whose times are series of different objects.
It is used to display one-of-a-kind objects on a VF (Visual Force) page in same table.
Question 30. What Is The Difference Between Trigger And Workflow?

Answer :

Trigger:

Trigger is a piece of code that executes earlier than or after a report is inserted or updated.
We can access the trigger across the object and associated with that items.
We can use 20 DML operations in a single cause.
We can use 20 SOQL from information base in one cause.
Workflow:

Workflow is automated system that fired an motion primarily based on Evaluation standards and rule standards.
We can access a workflow across the item.
We can't perform DML operation on workflow.
We can not query from database.
Question 31. Does User Can Create Insert Their Own Custom Logo, While Creating Their Own Custom Applications?

Answer :

Yes,person can upload their custom brand in files and then they pick that logo for organisation.

Question 32. List Things That Can Be Customized On Page Layouts?

Answer :

We can customize various things on page format like, Fields, Buttons, Custom Links and Related Lists. We can also create sections.

Question 33. What Is A Time Trigger?

Answer :

A setting that defines when time-structured workflow actions ought to fireplace.

Apex Interview Questions
Question 34. What Is Sharing Rule?

Answer :

If we need to give get admission to to different users we use sharing regulations.

Question 35. How Many Ways We Can Share A Record?

Answer :

Role Hierarchy:

If we add a consumer to a role, the consumer is above inside the function hierarchy can have examine get admission to.
Setup --> manipulate customers --> roles --> setup roles --> click on on ‘add function’ --> offer name and store.
OWD:

Defines the base line setting for the organization.
Defines the extent of access to the consumer can see the other user’s report
OWD can be Private, Public Read Only, Public Read and Write.
Setup -> Security Controls -> sharing settings -> Click on ‘Edit’
Manual Sharing:

Manual Sharing is sharing a unmarried document to single user or institution of users.
We can see this button element web page of the report and this is visible most effective when OWD setting is private.
Criteria Based Sharing rules:

If we want to percentage data based on condition like proportion facts to a collection of users
Whose criteria are united states is India.
Setup -> safety controls -> sharing settings -> pick the item and provide call and Conditions and shop
Apex sharing:

Share object is to be had for each item(For Account object percentage object is AccountShare ). If we need to proportion the statistics the use of apex we ought to create a file to the share object.

Question 36. How To Unit Test Code Which Has Logic Around The Created Date?

Answer :

You can create sObjects in memory with arbitrary CreatedDate values by means of the usage of JSON.Deserialize. This doesn’t put in force the normal study-only subject attributes that prevent you from putting a createdDate fee. However, you could’t dedicate arbitrary CreatedDate values to the database (or else it'd be a extreme safety difficulty).
Detecting governor limits thru apex
First of all, the exception thrown through hitting a restriction, System.LimitException is uncatchable and manner that your script will be killed, even supposing it takes place inside a try/trap block. There is a category, Limits, that contains some of static techniques that allow you to check your governor limit intake.
Visualforce Interview Questions
Question 37. Is There A Defector third Party Utilities Library For Apex Such As Apache Commons Is For Java?

Answer :

Apex-lang is set as close to a Java-style library as you could get. Contains numerous string, database, and collection utilities that mimmick Java capability. Be aware even though, a few stuff along with Comparing and Sorting collections is obsolete with the appearance of the Comparable interface in Apex.In addition to apex-lang, and like you propose, I usually create or reuse static helper strategies throughout my initiatives. Static helper methods are very convenient for reusing code in Chatter capability, DML dealing with, Exception dealing with, Unit checking out, and so on.

Question 38. Is There A Way To Setup Continuous Integration For Apex Tests?

Answer :

There are multiple respectable Dreamforce presentations here:

Team Development:

Possible, Probable, and Painless and Continuous Integration within the Cloud.

We bumped into a few problems with this in practice and there was no manner to get actual automation (i.E., set it and forget about it). We had been also set it up with Selenium.

Here had been the problems that I recollect:

Some capabilities aren’t supported inside the metadata API and can not be moved thru the ant migration. If you've got any unit checks that work with those capabilities, you have to manually work on your CI org.
Deletions are harder to keep. You should manually update and practice a destructiveChanges.Xml document or replicate the deletion in the CI org.
We bumped into a situation in which some metadata XML documents had ‘invalid’ statistics in them. The counseled solution changed into to build a submit checkout script that manipulates the offending XMLs into valid XMLs. Not perfect.
On tasks, we wanted to music just our changes and push out simply our adjustments in supply manipulate. In concept, this will permit much less difficult rebase lining. This might have required extra manual upkeep of XML files (e.G., 2 new fields introduced on Account and best want to push those 2 fields not all (*) fields).
My conclusion is that it is really worth doing if you may get it set up, but if you are running on shorter-time period projects and don’t have a first rate amount of time budgeted in for it, it probably isn’t really worth setting up.
Question 39. Why Use Batch Apex?

Answer :

A Batch class lets in you to define a single process that may be damaged up into practicable chunks in an effort to be processed one at a time.

One instance is in case you want to make a subject update to each Account on your enterprise. If you've got 10,001 Account information for your org, that is not possible with out a few way of breaking it up. So within the start() method, you outline the question you’re going to apply in this batch context: ‘pick Id from Account’. Then the execute() approach runs, however handiest receives a extraordinarily short listing of records (default 200). Within the execute(), everything runs in its own transactional context, this means that almost all of the governor limits most effective observe to that block. Thus whenever execute() is administered, you're allowed 150 queries and 50,000 DML rows and so on. When that execute() is complete, a brand new one is instantiated with the next institution of two hundred Accounts, with a present day set of governor limits. Finally the finish() method wraps up any loose ends as essential, like sending a standing email.

So your batch that runs against 10,000 Accounts will sincerely be run in 50 separate execute() transactions, every of which most effective has to cope with 2 hundred Accounts. Governor limits nonetheless practice, but handiest to every transaction, along side a separate set of limits for the batch as an entire.

Disadvantages of batch processing:

It runs asynchronously, which can make it difficult to troubleshoot with out some coded debugging, logging, and continual stateful reporting. It additionally way that it’s queued to run, which may also purpose delays in beginning.
There’s a restrict of 5 batches in play at any time, which makes it tricky to begin batches from triggers unless you're checking limits.
If you want get admission to within execute() to a few big part of the whole dataset being iterated, this isn't to be had. Each execution simplest has get entry to to some thing is passed to it, despite the fact that you can persist class variables by means of imposing Database.Stateful.
There continues to be a (fairly huge) restriction on total Heap length for the complete batch run, which means that some very complex logic may run over, and want to be damaged into separate batches.
Question forty. Can Call Apex Class Method On The Fly (dynamically)?

Answer :

While you may instantiate a class primarily based on its name the use of the Type system class, you can’t dynamically discover a technique and execute it. The fine that you can do is to dynamically create an instance of a category that implements an interface and executes one of the methods on the interface.

Salesforce Crm Interview Questions
Question forty one. What Is App In Salesforce?

Answer :

An app is a set of tabs that work as a unit to provide capability. Users can switch between apps the usage of the Force.Com app drop-down menu at the pinnacle-right corner of every web page.
You can customize present apps to in shape the manner you work or build new apps by way of grouping trendy and custom tabs.
Navigation to create an app in Salesforce: Setup ->Build ->Create->App-> Click on new and create your application according to your necessities.
Question forty two. What Is The Object In Salesforce.Com?

Answer :

Objects are database tables that allow you to keep data particular on your employer in salesforce. You can use custom items to extend salesforce.Com capability or to build new software capability.
When you create a custom object, we are able to create a custom tab, customized associated lists, reports, and dashboards for customers to have interaction with the object statistics. You can also access custom object statistics thru the Force.Com API.
Navigation to create an object in income pressure: Setup-->Build-->Create-->Object--> Click on new object and create object consistent with your requirement.
Salesforce Lightning Interview Questions
Question forty three. How Many Relationships Included In Sfdc & What Are They?

Answer :

We are having two kinds of relationships, they're:

Lookup Relationship
Master-Detail Relationship
Question forty four. What Are Report Types?

Answer :

There are four varieties of reviews in Salesforce:

Tabular Reports
Summary Reports
Matrix Reports
Joined Reports
Question forty five. What Are Record Types?

Answer :

Record Types are restriction the choose list values and assign to the one of a kind page layouts for specific Record Types.

Question 46. What Is Roll-up Summary?

Answer :

Roll-up displays the count of infant information and calculate the sum, min and max of fields of the child statistics.

Question forty seven. Is The Check Box Performs Like Controlling Field?

Answer :

Yes feasible. Controlling subject have to be Check container or choose list.

Question forty eight. What Is Field Dependency?

Answer :

According to the field selection on one discipline clear out the select listing values on other area.

Question forty nine. Explain The Uses Of “transfer Record” In Profile?

Answer :

If person have best Read get right of entry to on unique report however he wants to trade the proprietor call of that document, then in profile level Transfer Record permits he can capable of exchange the proprietor.

Question 50. How Many Ways We Can Call The Apex Class?

Answer :

Visual force page
Web Service
Triggers
Email services
Question 51. What Is The Difference Between Action Support And Action Function?

Answer :

Action function: 

Invoke the controller technique from java script using AJAX and we will use motion characteristic from one-of-a-kind places on visual pressure page.

Action aid:

Invoke the controller technique the use of AJAX while even occurs on page like onMouseOver, onClick, ect… and we can use motion help for precise unmarried apex thing.

Question fifty two. What Is Tab In Salesforce?

Answer :

Tab is a person interface element to user creates to display custom item information.

There are three sort of tabs:

Custom Tabs
Visual force Tabs
Web Tabs
Question 53. Can We Create Master-element Relationship In This Case?

Answer :

No, immediately we cannot create master-info dating if a custom item incorporates existing statistics.
Following are the steps to create to create a grasp-element relationship when facts are available in a custom item.
First create subject with lookup dating.
And then accomplice look subject with discern file for each record next trade the statistics form of the field from look as much as Master detail.
Question fifty four. How Can I Create Many – To – Many Relationships?

Answer :

Lookup and Master-element relationships are one too many relationships. We can create many – to – Many relationships by the usage of a junction item. Junction object is a custom object with two master-detail relationships.

Question 55. What Is “grasp-element Relationship”?

Answer :

Master-Detail relationship is the Parent-infant relationship. In which Master represents Parent and element represents Child. If Parent is deleted then Child additionally receives deleted. Roll-up precis fields can best be created on Master facts a good way to calculate the SUM, AVG, MIN of the Child information.

Up to two allowed to item.
Parent field on baby is needed.
Access to parent determines get admission to to youngsters.
Deleting determine routinely deletes child.
A toddler of 1 master detail relationship cannot be the parent of every other.
Lookup subject on web page layout is needed.




CFG