Top 25 Salesforce Interview Questions for Deloitte (With Real Answers)


Introduction

If you are preparing for a Salesforce interview at Deloitte, one thing you should know is this — they don’t just ask theory.

They focus a lot on:

In this blog, I am not just listing questions. I am explaining them the way they are expected in an actual interview.


What kind of questions does Deloitte ask?

From experience, Deloitte interviews usually include:

They are more interested in how you explain rather than just giving a definition.

Check Full Youtube video on Salesforce Interview Questions for Deloitte

Apex and Trigger Questions (Salesforce Interview Questions for Deloitte)


What are wrapper classes in Salesforce?

In simple words, wrapper classes are used when you want to combine data from multiple objects and send it together.

For example, in a real project, you might need to show:

in one screen.

In that case, you create a wrapper class and store both together.

public class AccountWrapper {
public Account acc;
public List<Contact> contacts;
}

This is commonly used in LWC and Visualforce.


What does bulkification mean?

Bulkification means writing your code in such a way that it can handle multiple records at once.

In real projects, Salesforce never processes just one record. It can process 100, 200, or even more.

So if your code works only for one record, it will fail.

A simple mistake many beginners make is writing SOQL inside a loop.

That will hit governor limits very quickly.

So always:


What is the difference between with sharing and without sharing?

This is a very common question.

In most cases, you should use with sharing, because security is important.

Only use without sharing when you really need system-level access.


What are governor limits?

Salesforce is a multi-tenant platform. That means many users share the same resources.

Because of that, Salesforce puts limits on how much you can use.

For example:

If you cross these limits, your code will fail.

That’s why writing optimized code is very important.


Write a trigger to count contacts on an account

This is a very common real-time question.

The requirement is simple:
Whenever a contact is added or removed, update the count on Account.

Here is a basic version:

trigger ContactCount on Contact (after insert, after delete) {    Set<Id> accIds = new Set<Id>();    if(Trigger.isInsert){
for(Contact c : Trigger.new){
if(c.AccountId != null){
accIds.add(c.AccountId);
}
}
} if(Trigger.isDelete){
for(Contact c : Trigger.old){
if(c.AccountId != null){
accIds.add(c.AccountId);
}
}
} List<Account> accList = new List<Account>(); for(AggregateResult ar : [
SELECT AccountId, COUNT(Id) cnt
FROM Contact
WHERE AccountId IN :accIds
GROUP BY AccountId
]){
accList.add(new Account(
Id = (Id)ar.get('AccountId'),
Contact_Count__c = (Integer)ar.get('cnt')
));
} update accList;
}

In interviews, they are not expecting perfect syntax.
They want to see your approach and logic.


SOQL Questions (Salesforce Interview Questions for Deloitte)


Write a query to get accounts without contacts

This is a classic question.

SELECT Id, Name
FROM Account
WHERE Id NOT IN (SELECT AccountId FROM Contact)

They may also ask you to optimize it or explain how it works.


What is the difference between SOQL and SOSL?

Simple explanation:

Example:
If you want all accounts with a specific name → SOQL
If you want to search a word across multiple objects → SOSL


Salesforce Interview Questions for Deloitte

Flow and Automation Questions (Salesforce Interview Questions for Deloitte)


What are different types of flows?

There are multiple types, but mainly you should remember:

In real projects, record-triggered flows are used the most.


Can flow be used instead of trigger?

Yes, in many cases.

For example, counting contacts on account can be done using flow:

But there is a problem.

When data volume is high, flow may not perform well.

So:


When should you use flow vs trigger?

This is a decision-making question.

Use flow when:

Use trigger when:


Lightning Web Components (LWC)


What are decorators in LWC?

Decorators are used to control how variables behave.

Main ones:


Difference between @wire and imperative calls

This is very important.

Use @wire when you want automatic updates.
Use imperative when you need control.


How to use LWC in Experience Builder?

Steps are simple:

  1. Create component
  2. Add target in meta file
  3. Deploy
  4. Use in Experience Builder

Scenario-Based Questions


How to convert lookup to master-detail?

You cannot just change it directly.

You need to check:

Also remember:


Best practices for profiles

This is more of an admin question.

Instead of creating too many profiles:


How to call flow from Apex or LWC?

From Apex:

Flow.Interview flow = new Flow.Interview.MyFlow(params);
flow.start();

From LWC:
Use standard flow component.


Performance and Best Practices


How to optimize Apex performance?

In real projects, performance matters a lot.

Some simple rules:


What is bulkification in Salesforce? Explain with example

Bulkification means writing your Apex code in such a way that it can handle multiple records at the same time, instead of working on just one record.

In Salesforce, operations like triggers are not executed for a single record only. They can run for a batch of records (up to 200 records at once). So if your code is written only for one record, it may fail when multiple records are processed.

That’s why bulkification is very important.


Why is bulkification needed?

Salesforce has something called governor limits. For example:

If your code runs a query inside a loop, it may quickly hit these limits when multiple records are processed.


Example of non-bulkified code (bad practice)

for(Contact con : Trigger.new){
Account acc = [SELECT Id, Name FROM Account WHERE Id = :con.AccountId];
}

Problem:


Example of bulkified code (good practice)

Set<Id> accIds = new Set<Id>();for(Contact con : Trigger.new){
if(con.AccountId != null){
accIds.add(con.AccountId);
}
}Map<Id, Account> accMap = new Map<Id, Account>(
[SELECT Id, Name FROM Account WHERE Id IN :accIds]
);

Why this is correct:


Real-time understanding of Bulkification

Let’s say:

If your code is not bulkified → it will fail
If your code is bulkified → it will handle all 200 records smoothly


Key points to mention in interview about the bulkification


What are types of Asynchronous Apex in Salesforce?

Asynchronous Apex is used when you want to run processes in the background, instead of running them immediately.

This helps in:


Types of Asynchronous Apex

There are mainly four types:


1. Future Method

Future methods are used to run code asynchronously in the background.

When to use:

Example:

@future
public static void updateAccount(){
// logic here
}

Key points:


2. Queueable Apex

Queueable Apex is an improved version of future methods.

When to use:

Example:

public class MyQueueable implements Queueable {
public void execute(QueueableContext context){
// logic here
}
}

To call:

System.enqueueJob(new MyQueueable());

Key points:


3. Batch Apex

Batch Apex is used to process large volumes of data (thousands or millions of records).

When to use:

Example:

public class MyBatch implements Database.Batchable<sObject> {    public Database.QueryLocator start(Database.BatchableContext bc){
return Database.getQueryLocator('SELECT Id FROM Account');
} public void execute(Database.BatchableContext bc, List<Account> scope){
// logic here
} public void finish(Database.BatchableContext bc){
// post processing
}
}

Key points:


4. Scheduled Apex

Scheduled Apex is used to run jobs at a specific time.

When to use:

Example:

public class MyScheduler implements Schedulable {
public void execute(SchedulableContext sc){
// logic here
}
}

To schedule:

System.schedule('My Job', '0 0 12 * * ?', new MyScheduler());

Key points:


Simple comparison (very useful in interview)

TypeUse CaseKey Feature
FutureSimple async tasksEasy to use
QueueableAdvanced asyncSupports chaining
BatchLarge data processingHandles millions of records
ScheduledTime-based jobsRuns on schedule

How to explain in interview (simple line)

You can say:

“Asynchronous Apex is used to run processes in the background. Future is for simple tasks, Queueable gives more control, Batch is used for large data, and Scheduled is used for time-based execution.”