117 Salesforce Development Interview Q&As

Download as pdf or txt
Download as pdf or txt
You are on page 1of 118

Salesforce Development (Q&A)

Lightning Flow
117
&
Apex, Trigger,
Trigger
Test Class,
AsyncScenarios
Apex, APIs, Integration
Q&As
Sanjay Gupta Tech School
https://StudySalesforce.com
Salesforce

Q : What is Apex? Interview


Preparation

A:
● Apex is Object Oriented Programming Language used in
Salesforce.
● Strongly typed as it validates references to objects at compile time.
● Integrated with the database
● Enable developers to add business logics.
● We can call apex through web service requests and triggers on
objects.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Data Types in Apex? Interview


Preparation

A:
● Primitive
○ Integer, Double, String, Long, Date, ID, Boolean, and more.
● sObject
○ either as a generic sObject or as a specific sObject eg. Account...
● Collection
○ list, set, map
● Types list of values, also known as enum.
● User - defined Apex Classes
● System supplied Apex Classes

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Collections in Apex? Interview


Preparation

A:
● We have three types of collection in apex:
○ List
○ Set
○ Map

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : List in Apex? Interview


Preparation

A:
● An Ordered collection of elements.
● Each element of list has an index for identification.
● Index position of first element is always 0.
● List can be nested and even multidimensional.
● Elements can be of any data type:
○ Primitive types, collections, sObjects,
○ User-Defined Types, Built-in Types

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : List Examples in Apex? Interview


Preparation

A:
● List<String> myList = new List<String>();
● List<Account> accList = new List<Account>();
● List<Integer> myList = new List<Integer>();
myList.add(20);
Integer i = myList.get(0);
myList.add(1, 30);
● List<Account> accList = [SELECT ID, Name FROM Account];

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Set in Apex? Interview


Preparation

A:
● An Unordered collection of elements.
● It doesn’t contain duplicate elements.
● Sets can contain collections that can be nested within one another.
● Elements can be of any data type:
○ Primitive types, collections, sObjects,
○ User-Defined Types, Built-in Types

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Set Examples in Apex? Interview


Preparation

A:
● Set<String> stringSet = new Set<String>();
● Set<Id> accIdSet= new Set<Id>();
● Set<Integer> intSet = new Set<Integer>();
intSet.add(20);
intSet.add(30);
intSet.remove(20);
Boolean b = intSet.contains(30);
Integer s = intSet.size( );
Boolean b = intSet.isEmpty( );

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Map in Apex? Interview


Preparation

A:
● A Map is a collection of key - value pairs.
● Keys are always unique having a value associated.
● Values can be duplicate.
● Adding a map entry with an existing key overrides the existing entry with new.
● Map key and values can contain any collection and can contain nested collections.
● Keys and values can be of any data type:
○ Primitive types, collections, sObjects, User-Defined Types, Built-in Types

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Map Examples in Apex? Interview


Preparation

A:
1. Map<String, String> strToStrMap = new Map<String, String> ();
2. Map<Integer, String> intToStrMap = new Map<Integer, String>();
i. intToStrMap.put(1, ‘First’);
ii. intToStrMap.put(2, ‘Second’);
iii. Boolean b = intToStrMap.containsKey(1);
iv. String value = intToStrMap.get(2);
v. Set<Integer> s = intToStrMap.keySet();
3. Map <ID, Account> IdToAccountMap = New Map<ID, Account>();
4. List<Account> accList = [SELECT ID, Name FROM Account];
5. Map <ID, Account> IdToAccountMap = New Map<ID, Account>(accList);
6. Map<Account, List<Contact>> accToConMap = new Map<Account, List<Contact>>( );

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : for loop and for each loop? Interview


Preparation

A:
● for
for(Integer i = 0; i<5; i++){
//write some code here
}
● for each
List<Account> accList = [SELECT Id FROM Account LIMIT 5];
for(Account acc : accList){
//write some code here
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is SOQL? Interview


Preparation

A:
● Salesforce Object Query Language
● Read records from Salesforce.
● Similar to the standard SQL but is customized for the Lightning Platform.
● SOQL can be embedded in Apex code.
● Example
○ List<Account> accList = [SELECT Id FROM Account LIMIT 5];

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is SOSL? Interview


Preparation

A:
● Salesforce Object Search Language (SOSL)
● Used to perform text search in records.
● Use SOSL to search fields across multiple sObjects records.
● Use SOQL to retrieve records for a single object whereas use SOSL to search
fields across multiple objects.
● Syntax
Find ‘SearchQuery’ [IN SearchGroup] [RETURNING ObjectsAndFields];

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Developer Console? Interview


Preparation

A:
● Developer Console is an integrated development environment (IDE).
● Here you can create and edit Apex classes, Tiggers, Aura Components, VF
Pages etc.
● Generate logs for debugging and analyze them.
● Test apex code to ensure that it is error free.
● Write and execute SOQL and SOSL queries to find, create and update the
records in the org.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Query Editor in Developer Console? Interview


Preparation

A:
● Helps to execute SOQL and SOSL.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Execute Anonymous Window? Interview


Preparation

A:
● Helps to execute apex code without creating any class.
● You can execute all lines of code all together or select particular
lines for execution as well.
● You also get an option to open logs just after completion of
execution.
● You cannot save code through Anonymous Window.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is System.debug( )? Interview


Preparation

A:
● Display results in the logs.
● Use System.debug() in the code for debugging purpose.
● Once your code is tested and error free then remove all the
System.debug( ) as part of best practice.
● Example
○ System.debug(‘Test Debug’);

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is DML? Interview


Preparation

A:
● DML is used to insert, update, delete & undelete records.
● Use upsert to either insert or update a record.
● Use merge when duplicate leads, contacts and accounts are there into one
record, others are deleted and related records are reparented.
● Always perform DML in Bulk.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Governor Limit? Interview


Preparation

A:
● As apex runs in a multitenant environment so Apex runtime engine strictly
enforces limits.
● This is because runaway Apex code or processes don’t monopolize shared
resources.
● If some apex code exceeds a limit then associated governor issues a runtime
exception that cannot be handled.
● These limits count for each Apex transaction.
● For Batch Apex, these limits are reset for each execution of a batch of records
in the execute method.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Some Governor Limit? Interview


Preparation

A: Description Synchronous Limit Asynchronous Limit


Total number of SOQL queries issued 100 200
Total number of records retrieved by SOQL queries 50,000 50,000
Total number of SOSL queries issued 20 20
Total number of records retrieved by a single SOSL 2,000 2,000
query
Total number of DML statements issued 150 150
Total stack depth for any Apex invocation that recursively 16 16
fires triggers due to insert, update or delete statements
Total number of callouts (HTTP requests or web services 100 100
calls) in a transaction

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Some Governor Limit? Interview


Preparation

A: Description Synchronous Limit Asynchronous Limit


Maximum cumulative timeout for all callouts (HTTP 120 seconds 120 seconds
requests or Web services calls) in a transaction

Maximum number of methods with the future 50 0 in batch and future contexts;
annotation allowed per Apex invocation 1 in queueable context

Maximum number of Apex jobs added to the queue 50 1


with System.enqueueJob

Total heap size 6 MB 12 MB

Maximum CPU time on the Salesforce servers 10,000 milliseconds 60,000 milliseconds

Maximum execution time for each Apex transaction 10 minutes 10 minutes

Total number of sendEmail methods allowed 10 10

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Database Class? Interview


Preparation

A:
● Apex contains the build-in Database class.
● Database Class provides methods which can perform DML operations.
● Database class methods are static and called through name of class.
○ Database.insert( );
○ Database.update( );
○ Database.upsert( );
○ Database.delete( );
○ Database.undelete( );
○ Database.merge( );

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : More on Database Class: Interview


Preparation

A:
● Database class methods have an optional allOrNone parameter.
● This parameter allows you to specify whether the operation should partially succeed.
● When this parameter is set to false, if error occurs on a partial set of records, then the successful records
will be committed and errors will be returned for the failed records.
● No exceptions are thrown with the partial success option.
● This feature is not available with DML statements.
● The Database methods return result objects containing success or failure information of each record.

● Example : Database.SaveResult results [ ] = Database.insert(recordList, false);

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : DML Vs Database Class? Interview


Preparation

A:
● Use DML statements if you want to throw error through apex exceptions and handle
them with try & catch block.
● Use Database methods if you want to allow partial success of a bulk operation. In
this way, successful records will be committed and errors will be returned for the
failed records.
● Database methods can also throw exception similar to DML statements.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Exception? Interview


Preparation

A:
● Exception is runtime error.
● Example : DML Statement Exceptions
○ If a DML operation fails, it returns an exception of type DmlException.
○ We can catch exceptions in our code to handle error condition
try{
//This causes an exception as Name field (required) is not provided
Account acc = new Account();
insert acc;
}
catch(DmlException e){
System.debug(‘A DML exception has occurred: ‘ + e.getMessage( ));
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Parent - Child SOQL? Interview


Preparation

A:
● Query is applied on parent record which queries related child records as well.

● Example:
○ SELECT Id, Name, (SELECT Id, FirstName FROM Contacts) FROM
Account LIMIT 5

● Here, Contacts is a Child Relationship Name.


● If relationship field is custom field with which two objects are linked, then we
have to append __r as well with child relationship name.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Child - Parent SOQL? Interview


Preparation

A:
● Query is applied on child object which queries parent details as well.
● Example
○ SELECT Id, FirstName, Account.Name, Employee__r.Salary__c
FROM Contact LIMIT 5

● Here, Account is representing standard relationship where as


Employee is representing custom relationship. So in custom
relationship append __r.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Debug Log? Interview


Preparation

A:
● A debug log can record operations, system processes, and errors
that occur when executing a transaction or running unit tests. Debug
logs can contain information about:
○ Database Changes
○ HTTP callouts
○ Apex errors
○ Resources used by apex
○ Automated workflow processes

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is a Trigger? Interview


Preparation

A:
● Triggers are initiated when a record is inserted, updated, deleted and undeleted.
● We can perform custom operations before or after events to records.
● Use triggers to do operations that cannot be done by point and click tools provided in
Salesforce.
● We can do things using triggers that we can do through Apex, including execution
SOQL and DML or calling custom methods.
● Triggers can be created for both Standard and Custom objects.
● By default triggers are active as you create them.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Trigger Syntax? Interview


Preparation

A:
trigger TriggerName on ObjectApiName (trigger_events){
//write some code here or call apex class methods
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Types of Trigger? Interview


Preparation

A:
● Before Triggers
○ It is used to update or validate record values before saved to database.
● After Triggers
○ It is used to access field values that are set by the system such as Ids, and
to make changes in the related/other records. The records that fire the after
trigger are read-only.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger Events? Interview


Preparation

A:
● before insert
● before update
● before delete
● after insert
● after update
● after delete
● after undelete

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger Context Variables? Interview


Preparation

A:
All triggers define implicit variables that allow developer to access run-time context. These variables are
contained in the System.Trigger class.
● isExecuting
○ Returns true if the current context of Apex code is a trigger, not a VF page, a web service, or
an executeanonymous( ) API call.
● isInsert
○ Returns true if trigger was fired due to an insert operation, from the Salesforce UI, Apex or API.
● isUpdate
○ Returns true if trigger was fired due to an update operation, from the Salesforce UI, Apex or
API.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger Context Variables? Interview


Preparation

A:
○ isDelete
■ Returns true if trigger was fired due to a delete operation, from the Salesforce UI, Apex or
API.
○ isBefore
■ Returns true if the trigger was fired before any record was saved.
○ isAfter
■ Returns true if the trigger was fired after all records were saved.
○ isUndelete
■ Returns true if the trigger was fired after a record is recovered from Recycle Bin.
○ size
■ The total number of records in a trigger invocation, both old and new.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger.new Vs Trigger.newMap? Interview


Preparation

A:
● new
○ Returns a list of new versions of sObject records.
○ This sObject list is available in Insert, Update and Undelete triggers, and the
records can only be modified in before trigger.
● newMap
○ A Map of ids to the new versions of sObject records.
○ Available in after insert, before update, after update, after undelete triggers.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger.old Vs Trigger.oldMap? Interview


Preparation

A:
● old
○ Returns a list of old versions of sObject records.
○ Available in before update, after update, before delete, after delete triggers.
● oldMap
○ A map of ids to the old versions of sObject records.
○ Available in before update, after update, before delete, after delete triggers.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Can we call a apex class through trigger? Interview


Preparation

A:
● Yes, we can.
Example
trigger AccountTrigger on Account ( before insert ) {
AccountTriggerHandler.beforeInsert(Trigger.New);
}

public class AccountTriggerHandler{


public void beforeInsert(List<Account> newList){
for(Account acc : Trigger.New){
acc.Description = ‘Test Description’;
}
}
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger Best Practices? Interview


Preparation

A:
● One Trigger per object
● bulkify your code
● Logicless trigger
● Avoid using SOQL or DML inside for loop to avoid hitting governor
limits
● Avoid nested loops, try to use map instead.
● Use Static boolean variable to avoid recursive trigger

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Recursive Trigger? Interview


Preparation

A:
● In some scenarios it can happen that the result of the trigger can end up calling
the same trigger again and again. This situation is known as recursive trigger.
● To avoid this scenario we should create a static variable and check the value of
this variable before we execute anything in the trigger.
● Example: When you update a record from UI then trigger will be called. Now in
trigger as well you applied update DML so it will call same trigger again and
ends up as recursion.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Can we apply validation through trigger? Interview


Preparation

A:
● Yes, we can use addError( ) to apply validation through trigger.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Can a trigger call a batch class? Interview


Preparation

A:
● Yes, we can call a batch class in the trigger as we do in the normal
apex code.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Can a trigger make a call Apex callout method? Interview


Preparation

A:
● Yes, we can call a callout method in Apex Trigger but the only
condition is that it has to be an asynchronous callout because the
trigger flow cannot wait on the response received by the callout
method.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is trigger bulkification? Interview


Preparation

A:
● Trigger should be able to handle single records and bulk records.
● You should write triggers that operate on collections of sObjects.
● Trigger should perform efficient SOQL and DML operations.

Sanjay Gupta Tech School http://StudySalesforce.com


Q : Is there any limit on number of triggers defined Salesforce
Interview
Preparation
on an object?
A:
● We can define as many triggers on an object but it is recommended
to have one trigger per object as the order of execution of different
trigger is not guaranteed and any trigger can start execution first.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger and Order of execution: Interview


Preparation

A:
When you save a record with an insert, update or upsert statement, Salesforce performs
the following events in order:
1. Loads the original record from the database or initialized the record for an upsert
statement.
2. Loads the new record field values from the request and overwrites the old values.
3. Executes record-triggered flows those are configured to run before the record is
saved.
4. Executes all before triggers.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger and Order of execution: Interview


Preparation

A:
5. Runs most system validation steps again and runs custom validation rules. The only
system validation that Salesforce doesn’t run a second time (when the request
comes from a standard UI edit page) is the enforcement of layout-specific rules.
6. Executes duplicate rules.
7. Saves the record to the database, but does not commit yet.
8. Executes all after triggers.
9. Executes assignment rules.
10. Executes auto-response rules.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger and Order of execution: Interview


Preparation

A:
11. Executes workflow rules.
12. Executes escalation rules.
13. Executes Processes, Flows launched by processes (order is not guaranteed)
14. Executes entitlement rules.
15. Executes record-triggered flows those are configured to run after the record is
saved.
16. If the record contains a roll-up summary field or is part of a cross-object workflow,
performs calculations and updates the roll-up summary field in the parent record.
Then parent record goes through save procedure.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Trigger and Order of execution: Interview


Preparation

A:
17. If the parent record is updated, and a grandparent record contains a roll-up
summary field or is part of a cross-object workflow, performs calculations and
updates the roll-up summary field in the grandparent record. Grandparent record
goes through save procedure.
18. Executes Criteria based Sharing evaluation.
19. Commits all DML operations to the database.
20. After the changes are committed to the database, executes post-commit logic such
as sending email and executing enqueued asynchronous Apex jobs, including
queueable jobs and future methods.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Apex Test Class? Interview


Preparation

A:
● The Apex testing framework enables you to write and execute tests for your Apex classes
and triggers on the Lightning Platform.
● Apex unit tests ensure high quality for your Apex code and let you meet requirements for
deploying Apex.
● Apex code can only be written in a sandbox environment or a Developer org, not in
production.
● Apex unit tests are required for deploying and distributing Apex.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Benefits of Apex Unit Tests? Interview


Preparation

A:
● Ensuring that your Apex classes and triggers work as expected.
● Having a suite of regression tests that can be rerun every time classes and triggers
are updated to ensure that future updates you make to your app don’t break existing
functionality.
● Meeting the code coverage requirements for deploying Apex to production or
distributing Apex to customers via packages.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Code Coverage requirement for Deployment? Interview


Preparation

A:
● To deploy code or package it for the Lightning Platform AppExchange, at least 75% of
Apex code must be covered by tests, and all those tests must pass.
● In addition, each trigger must have some coverage. Even though code coverage is a
requirement for deployment, don’t write tests only to meet this requirement.
● Make sure to test the common use cases in your app, including positive and negative
test cases, and bulk and single-record processing.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Important about Test Class? Interview


Preparation

A:
● Calls to System.debug are not counted as part of Apex code coverage.
● Test methods and test classes are not counted as part of Apex code limit. So, no
worries about writing long test class with more methods just to make sure that all your
code branches are covered.
● Class can be deployed on 0% coverage as well, but that overall coverage of your
production org after getting your code deployed should be 75%, otherwise Salesforce
won’t let you deploy your code.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Test class syntax? Interview


Preparation

A:
@isTest
private class MyTestClass {
@isTest
static void myTestMethod() {
// code_block
}
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : @isTest and testMethod? Interview


Preparation

A:
@isTest
static void testName() {
// code_block
}
OR
static testMethod void testName() {
// code_block
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Test.startTest( ) and Test.stopTest? Interview


Preparation

A:
● The startTest( ) method marks the point in your test code when your test actually
begins.
● Each test method is allowed to call this method only once.
● Any code that executes after the call to startTest( ) and before stopTest( ) is assigned
a new set of governor limits.
● The startTest( ) method does not refresh the context of the test, it adds a context to
your test.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Test.startTest( ) and Test.stopTest? Interview


Preparation

A:
● For Example: if your class makes 98 SOQL queries before it calls startTest( ), and the
first significant statement after startTest is a DML statement, the program can now
make an additional 100 queries. Once stopTest( ) is called, however, the program
goes back into the original context, and can only make 2 additional SOQL queries
before reaching the limit of 100.
● All asynchronous calls made after the startTest method are collected by the system.
When stopTest is executed, all asynchronous processes are run synchronously.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : @testSetup? Interview
Preparation

A:
● Use test setup methods (methods that are annotated with @testSetup) to create test
records once and then access them in every test method in the test class.
● Test setup methods can be time-saving when you need to create reference or
prerequisite data for all test methods, or a common set of records that all test
methods operate on.
● If a test class contains a test setup method, the testing framework executes the test
setup method first, before any test method in the class.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : @testSetup? Interview
Preparation

A:
● Records that are created in a test setup method are available to all test methods in
the test class and are rolled back at the end of test class execution.
● If a test method changes those records, such as record field updates or record
deletions, those changes are rolled back after each test method finishes execution.
The next executing test method gets access to the original unmodified state of those
records.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Common Test Utility or Data Factory Class? Interview


Preparation

A:
● Create TestUtility or DataFactory class to create test records once and then access
them in test methods of any of the test class.
● This class can be time-saving because when you need to write code for prerequisite
data creation once for test methods those are available in different test classes.
● You can call methods defined in TestUtility or DataFactory class in Test class as and
when required.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Assert in Test Class? Interview


Preparation

A:
● While implementing test class, in each test method we can validate the results.
● To do so we can use asserts in the code.
● We need to make sure all asserts should pass, if any of the assert fails it means
either assert is not written correctly or there is some errors in the Apex Code for that
you are write test method.
● Example:
○ System.assert(boolean condition, msg);
○ System.assertEquals(expected, actual, msg);

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Apex Test Class Best Practices? Interview


Preparation

A:
● Start test class with @isTest annotation and start test methods with @isTest
annotation.
● Methods of test class must be static and void.
● Name you test class as your OriginalClass + Test or TriggerName + Test
● Prepare your test data which needs to be used for test runs.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Apex Test Class Best Practices? Interview


Preparation

A:
● Always write test methods with bulkify data. (either use @testSetup or Util Class)
● Use Test.startTest( ) and Test.stopTest( ) to make sure that the actual testing of your
code happens with the fresh set of governor limits. These methods help you to reset
your governor limits just before your actual code of testing gets executed.
● Use assert statement to test whether the actual code is executing correctly and giving
the results as expected.
● Always try to test both positive and negatives scenarios.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : @isTest(SeeAllData=True) Annotation? Interview


Preparation

A:
● Annotate your test class or test method with @isTest(seeAllData=true) to open up data access to
records in your organization.
● The @isTest(SeeAllData=true) annotation applies to data queries but doesn’t apply to record creation
or changes, including deletions.
● New and changed records are still rolled back in Apex tests even when using the annotation.
● If a test class is defined with the @isTest(SeeAllData=true) annotation, the annotation applies to all its
test methods. The annotation applies if the test methods are defined with the @isTest annotation.
● If a test class is not defined with the @isTest(SeeAllData=true) annotation and any specific method is
defined with @isTest(SeeAllData=true) annotation then that specific method can access all data of the
org, other methods cannot.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Using the runAs Method? Interview


Preparation

A:
● Usually, all Apex code runs in system mode, where the permissions and record sharing of the current
user aren’t taken into account.
● The system method runAs enables you to write test methods that change the user context to an
existing user or a new user so that the user’s record sharing is enforced.
● The runAs method doesn’t enforce user permissions or field-level permissions, only record sharing.
● You can use runAs only in the test methods. The original system context is started again after all runAs
test methods complete.
● The runAs method ignores user license limits. You can create new users with runAs even if your
organization has not additional user licenses.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Using the runAs Method? Interview


Preparation

A:
● Example:
Profile p = [SELECT Id FROM Profile WHERE Name=’Standard User’];
User u = new User( initialize all required fields here);
System.runAs(u){
//some code
}

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Asynchronous Apex? Interview


Preparation

A:
● An asynchronous process executes a task in the background.
● User doesn’t have to wait for the task to finish.
● Use Asynchronous Apex for:
○ Callouts to external systems
○ Operations that require higher limits
○ Code that needs to run at a certain time.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Benefits of Asynchronous Processing? Interview


Preparation

A:
● Use efficiency
● Scalability
● Higher Limits

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Types of Asynchronous Processing? Interview


Preparation

A: Type Overview Common Scenarios


Future Methods Run in their own thread, and do Web service callout.
not start until resources are
available

Batch Apex Run large jobs that would exceed Data cleansing or archiving of
normal processing limits records

Queueable Apex Similar to future methods, but Performing sequential processing


provide additional job chaining operations with external Web
and allow more complex data Services.
types to be used.

Scheduled Apex Schedule Apex to run at a Daily or weekly tasks.


specified time.

Sanjay Gupta Tech School http://StudySalesforce.com


Q : Governor & Execution Limits in Asynchronous Salesforce
Interview
Preparation
Processing?
A:
● Asynchronous apex provides higher governor and execution limits.
● Number of SOQL is doubled from 100 to 200.
● Total heap size and maximum CPU time are similarly larger for asynchronous calls.
● As you get higher limits with async, also those governor limits are independent of the
limits in the synchronous request that queued the async request initially.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Challenges of Asynchronous Processing? Interview


Preparation

A:
● Ensure fairness of processing
● Ensure fault tolerance

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Future Apex/Method? Interview


Preparation

A:
● Future Apex runs process in a separate thread, at a later time when system
resources become available.
● Use @future annotation to create future methods.
● In Synchronous processing, all method calls are made from the same thread and no
additional processing can occur until the process is complete.
● Whereas in future method, methods runs asynchronously in its own thread.
● This unblocks users from performing other operations.
● Provides higher governor & execution limits for processing.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Future Methods? Interview


Preparation

A:
● Callouts to external Web services. To make callouts from a trigger use a future or
queueable method.
● Process that needs to executed in a separate or their own thread.
● Isolating DML operations on different sObject types to prevent the mixed DML error.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Best Practices : Future Method Interview


Preparation

A:
● Ensure future methods execute as fast as possible.
● In case of Web service callouts, try to bundle all callouts together from the same
future method, rather that using a separate future method for each callout.
● Test that a trigger enqueuing the @future calls is able to handle a trigger collection of
200 records.
● To process large number of records asynchronously, use Batch Apex instead of future
methods.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Things to Remember while using Future Method: Interview


Preparation

A:
● @future annotation method must be static.
● Future method can only return a void type.
● Future method can take primitive data types, array of primitive data types, or collections of
primitive data types as arguments.
● Future methods cannot take objects as arguments.
● It can happen that future methods are running in different order as they are called.
● You can’t call a future method from a future method. Nor can you invoke a trigger that calls a
future method while running a future method.
● There is a limit of 50 future calls per Apex invocation.
● There is an additional limit on the number of calls in a 24-hour period.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Batch Apex? Interview


Preparation

A:
● Batch Apex runs large jobs. It can process thousands or millions of records.
● It processes records asynchronously in batches.
● For Data cleansing or archiving, Batch Apex is probably best solution.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : How Batch Apex works? Interview


Preparation

A:
● The execution logic of the batch class is called once for each batch of records that is
being processed.
● Each time when a batch class is invoked, the job is placed on the Apex job queue and
is executed as a discrete transaction.
● Advantages are:
○ Every transaction starts with a new set of governor limits.
○ If one batch fails to process successfully, all other successful batch transactions
aren’t rolled back.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Which methods are used in Batch Apex ? Interview


Preparation

A:
● Batch Apex class must implement the Database.Batchable interface and include the
following three methods:
○ start
○ execute
○ finish

Sanjay Gupta Tech School http://StudySalesforce.com


Q : What is the use of start( ) method in Batch Salesforce
Interview
Preparation
Apex?
A:
● Collects the records or objects to be passed to the execute( ) method for processing.
● start( ) is called once at the beginning of a Batch Apex Job.
● It returns a Database.QueryLocator object or an Iterable that contains the records or
objects passed to the job.
● When QueryLocator object is used, the governor limit for the total number of records
retrieved by SOQL queries is bypassed and upto 50 million records can be queried.
● Whereas with an Iterable, governor limit by SOQL queries is enforced.

Sanjay Gupta Tech School http://StudySalesforce.com


Q : What is the use of execute( ) method in Batch Salesforce
Interview
Preparation
Apex?
A:
● Perform actual processing for each batch of data passed.
● Default batch size is 200 records.
● Batches of records can execute in any order, it doesn’t depends on which order they
are received from the start method.
● It take a reference to the Database.BatchableContext object and A List<sObject> or a
list of parameterized types.
● When using Database.QueryLocator use the returned list.

Sanjay Gupta Tech School http://StudySalesforce.com


Q : What is the use of finish( ) method in Batch Salesforce
Interview
Preparation
Apex?
A:
● Executes post-processing operations.
● Calls once after all batches are processed.
● For example, sending an email process can be implemented in finish method.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Batch Practices: Batch Apex Interview


Preparation

A:
● To ensure fast execution of batch jobs, minimize web service callout times.
● Tune any SOQL query to gather the records to execute as quickly as possible.
● The longer the batch job executes, the more likely other queued jobs are delayed when
many jobs are in the queue.
● Use Batch Apex when more than one batch of records are there, in case of one batch,
you can prefer Queueable Apex.
● Minimize the number of asynchronous requests.
● If you are planning to invoke a batch job from a trigger then you must be able to
guarantee that the trigger won’t add more batch jobs than the limit.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Queueable Apex? Interview


Preparation

A:
● Superset of future methods with extra features.
● Combination of future methods and Batch Apex.
● Works beyond primitive arguments.
● Called by a simple System.enqueueJob( ) method.
● enqueueJob( ) return a job ID that can be monitored.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What are the benefits of Queueable Apex? Interview


Preparation

A:
● Non-primitive types
● Monitoring
● Chaining Jobs

Sanjay Gupta Tech School http://StudySalesforce.com


Q : Important to Remember while using Queueable Salesforce
Interview
Preparation
Apex:
A:
● The execution of a queued job counts once against the shared limit for asynchronous
Apex method executions.
● You can add up to 50 jobs to the queue with System.enqueueJob( ) in a single
transaction.
● When chaining jobs, you can add only one job from an executing job with
System.enqueueJob( ).
● No limit is enforced on the depth of chained jobs. Note, for Developer Edition and Trial
orgs, the maximum stack depth for chained jobs is 5 (including the initial parent
queueable job).

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Scheduled Apex? Interview


Preparation

A:
● You can run Apex classes at a specified time.
● Run Maintenance tasks on Daily or Weekly basis.
● Implements Schedulable interface in Apex class.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : How many ways are there to Schedule Apex? Interview


Preparation

A:
● Using the System.Schedule( ) Method through CRON expression.
○ System.schedule(JobName, CronExpression, SchedulableClassInstance);
● Scheduling a Job from the UI
○ Setup > Apex Classes > Schedule Apex

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is CRON Expression? Interview


Preparation

A:
● A CRON expression is basically a string of five or six fields that represents a set of times, normally as a
schedule to execute some routine.
● Example:
○ String sch = ‘20 30 8 10 2 6 2022’ ;
● 20 = Seconds
● 30 = Minutes
● 8 = Hours
● 10 = Day of Month
● 2 = Month (1 for Jan and 12 for Dec)
● 6 = Day of Week (1 for Sun and 7 for Sat)
● 2022 = Year (Optional - null or 1970 - 2099)

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : Things to Remember while Scheduling Apex: Interview


Preparation

A:
● You can only have 100 scheduled jobs at one time.
● While scheduling a class from a trigger then you must guarantee that the trigger won’t
add more scheduled jobs than the limit.
● Synchronous web service callouts are not supported from scheduled Apex.
● Make an Asynchronous callout by placing the callout in a method annotated with
@future(callout=true) and call this method from scheduled Apex.
● If scheduled apex executes a batch job then callouts are supported from the batch class.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is an API? Interview


Preparation

A:
● An API is equivalent to a user interface, except it is designed for software instead of
humans.
● APIs allows applications to talk to one another.
● The client sends a request for specific information to another system.
● Other system returns the data in response.
● To send or receive data, there is an expectation that it will be in a specific format that
both sides can understand.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Integration? Interview


Preparation

A:
● Integration is a process of connecting two applications.
● A typical enterprise uses many applications, most of which are not designed to work
with one another.
● Integrating separate but related apps helps organizations to achieve greater levels of
operational consistency, efficiency and quality.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What are Salesforce Data APIs? Interview


Preparation

A:
● REST API
● SOAP API
● Bulk API
● Streaming API

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : About REST API Interview


Preparation

A:
● Simple and powerful web service based on RESTful principles.
● Exposes functionality via REST resources and HTTP methods.
● CRUD Operations
● Search or Query Data
● Retrieve Object Metadata
● Access Information about limits in org
● Supports both XML and JSON
● Has lightweight request and response framework so useful for writing mobile and web apps.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : About SOAP API Interview


Preparation

A:
● Robust and Powerful web service based on the industry standard protocol.
● Uses Web Services Description Language (WSDL) file to define the parameters for
accessing data.
● Supports XML only.
● Most of SOAP API functionality is also available through REST API.
● Great for writing server to server integrations.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : About Bulk API? Interview


Preparation

A:
● Specialized RESTful API for loading and querying lots of data at once.
● 50000 records or more.
● Bulk API is asynchronous.
● Two versions are available 1.0 and 2.0
● Both versions can handle larger amount of data.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : About Streaming API Interview


Preparation

A:
● Used for setting up notifications that trigger when changes are made to data.
● Uses a publish-subscribe, or pub/sub model in which users can subscribe to channels
that broadcast certain types of data changes.
● It is great for writing apps that would need to frequently poll for changes.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : API Details Interview


Preparation

A:
API Name Protocol Data Format Communication
REST API REST JSON, XML Synchronous
SOAP API SOAP (WSDL) XML Synchronous
Chatter REST API REST JSON, XML Synchronous
User Interface API REST JSON Synchronous
Analytics REST API REST JSON, XML Synchronous
Bulk API REST CSV, JSON, XML Asynchronous

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : API Details Interview


Preparation

A:
API Name Protocol Data Format Communication
Metadata API SOAP (WSDL) XML Asynchronous
Streaming API Bayeux JSON Asynchronous
Apex REST API REST JSON, XML, Custom Synchronous
Apex SOAP API SOAP (WSDL) XML Synchronous
Tooling API RESt or SOAP JSON, XML, Custom Synchronous
(WSDL)

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to Use REST API? Interview


Preparation

A:
● Great for use with mobile apps and web projects.
● Web service interface for interacting with Salesforce.
● CRUD Operations
● Search or Query Data
● Retrieve Object Metadata
● Access Information about limits in org

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use SOAP API? Interview


Preparation

A:
● Web service interface for interacting with Salesforce.
● CRUD Operations
● Can be used in any language that supports web services

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Chatter REST API? Interview


Preparation

A:
● To display Chatter feeds, users, groups and followers.
● Especially in mobile apps.
● Provides programmatic access to files, recommendations, topics, notifications,
Data.com purchasing and more.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use User Interface API? Interview


Preparation

A:
● Build Salesforce UI for native mobile apps and custom web apps.
● Build user interfaces that let users work with records, list views, actions, favorites and
more.
● You don’t have to worry about layouts, picklists, field-level security or sharing.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Analytics REST API? Interview


Preparation

A:
● Access Analytics assets such as datasets, lenses and dashboards.
● Send queries directly to the analytics platform.
● Retrieve a list of dataset versions.
● Create and retrieve analytics applications.
● Create and retrieve lenses.
● Create, update and retrieve Analytics Dashboards.
● Manipulate replicated datasets.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Bulk API? Interview


Preparation

A:
● Based on REST principles
● Optimized for loading or deleting large sets of data.
● Query, queryall, insert, update, upsert, or delete many records asynchronously by
submitting batches.
● Batches are processed by Salesforce in background.
● Easiest way to use Bulk API is to enable it for processing records in Data Loader
using CSV files.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Metadata API? Interview


Preparation

A:
● Used to retrieve, deploy, create , update or delete customizations of org.
● Common use is to deploy metadata from sandbox to production org.
● To access the functionality use Salesforce Extensions for Visual Studio Code or the
Ant migration tool.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Streaming API? Interview


Preparation

A:
● Used to receive near-real-time streams of data that are based on changes in
Salesforce records or custom payloads.
● Subscribers can receive notifications using CometD-an implementation of Bayeux
protocol that simulates push technology.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Apex REST API? Interview


Preparation

A:
● Use it when there is requirement to expose Apex classes and method.
● So that external applications can access code through REST architecture.
● It supports both OAuth 2.0 and Session ID for authorization.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to Use Apex SOAP API? Interview


Preparation

A:
● Use it when there is requirement to expose Apex methods to external application.
● Through SOAP external application can access code.
● It supports both OAuth 2.0 and Session ID for authorization.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : When to use Tooling API? Interview


Preparation

A:
● It integrates Salesforce metadata with other system.
● Metadata types are exposed as sObjects, so complex type components can be
accessed.
● To manage and deploy working copies of apex classes, trigger and VF Pages and
components Tooling API can be used.
● REST and SOAP both are supported.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What do you understand with callout? Interview


Preparation

A:
● Callout enables you to tightly integrate Apex with an external service.
● We need to make a call to external Web service or sending a HTTP request from
Apex code and then receiving the response.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What do you understand with web services? Interview


Preparation

A:
● Web services is a functionality or code which helps us to do integration.
● Web service are open standard (XML, SOAP, HTTP, etc.) based web applications that
interact with other web applications for the purpose of exchanging data.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is WSDL? Interview


Preparation

A:
● WSDL stands for Web Services Description Language.
● It is an XML document that describes a web service.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : How SOAP can be accessed? Interview


Preparation

A:
● SOAP can be communicated through WSDL file.
● Without WSDL file we can’t do integration.
● Message format of SOAP is in XML.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : How to use external WSDL file? Interview


Preparation

A:
● Setup > enter Apex Classes > select Apex Classes
● Click Generate from WSDL
● Click browse to navigate to a WSDL document on your local drive or network. This
WSDL document is the basis for the Apex class you are creating.
● Click Parse WSDL to verify the WSDL document contents.
● Click Generate Apex Code. This final page of the wizard shows the generated
classes, along with any errors. The page also provides a link to view successfully
generated code.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is Remote site settings? Interview


Preparation

A:
● Remote site setting is used to authorize the endpoint.
● It allows us to integrate with endpoint.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : How SOAP and REST communicates? Interview


Preparation

A:
● SOAP communicates through WSDL file.
● REST communicates through HTTP protocol.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What are the methods in REST? Interview


Preparation

A:
● HTTPGET : Retrieve data identified by a URL.
● HTTPPOST : Create a resource or post data to the server.
● HTTPDELETE: Delete a resource identified by a URL.
● HTTPPUT: Create or replace the resource sent in the request body.

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : A REST request consists which four components? Interview


Preparation

A:
● A resource URI
● An HTTP Method
● Request Headers
● A Request Body

Sanjay Gupta Tech School http://StudySalesforce.com


Salesforce

Q : What is JSON? Interview


Preparation

A:
● JSON stands for JavaScript Object Notation.
● JSON is lightweight than XML.
● While exchanging data between a browser and a server, the data can only be in text
format.
● JSON is text, hence we can convert any JavaScript object into JSON and can send
JSON to the server.

Sanjay Gupta Tech School http://StudySalesforce.com

You might also like