Salesforce Developer Interview Questions

Planning to become a Salesforce Developer or trying to change your jobs? What questions does the interviewer ask in the Salesforce Developer interview? In this post, we will cover top Salesforce Developer Interview Questions and Answers for 2024.

If you are new, then please check out our FREE Salesforce Developer Training. Let’s start with top Salesforce Developer interview questions in 2024.

Table of contents

Top Salesforce Developer Interview Questions

Here is a list of some Top 35 questions for the Developer interview in Salesforce:

  1. What is Sandbox, and what is the type of Sandbox in Salesforce?
  2. What is Cloud Computing?
  3. What is Iaas?
  4. What is PaaS?
  5. What is Saas?
  6. Type of Object Relationship in Salesforce?
  7. What is Junction Object in Salesforce?
  8. What is the difference between Role and Profiles?
  9. How many way we have in Salesforce for Sharing?
  10. What are Sharing Rules?
  11. What is Manual Sharing?
  12. What is Apex Sharing?
  13. Type of Flow in Salesforce?
  14. When to use Flow vs Apex?
  15. Best practices for Salesforce Flow?
  16. What is Apex? and when to use Apex over Flow?
  17. What are Apex Best practices in Salesforce?
  18. What is Apex Trigger? and When we should use Apex Trigger?
  19. What is Apex Trigger Handler pattern?
  20. What is Apex Trigger Framework? What are different Trigger Framework are available in Salesforce?
  21. What is Async Apex in Salesforce? How many way we have for Async processing?
  22. What is Batch job in Salesforce?
  23. What is the difference between the Stateful and Stateless batch job?
  24. What is mixed DML?
  25. What is Lightning Data Service?
  26. How do you communicate between Lightning web components?
  27. How to call Apex class in Lightning web component and how many way we have and when to use which option?
  28. What are the basic difference between Application Event and Component Event in Aura component?
  29. What is lightning messaging service?
  30. What is lazy loading in LWC and how do lazy loading in LWC?
  31. What are Design Attributes in Lightning Web Components?
  32. What is web services?
  33. What is the difference between SOAP and REST?
  34. What is the difference between Enterprise WSDL and Partner WSDL?
  35. Explain Integration Patterns.

Format of Salesforce Developer Interview

Salesforce Developer Interview is mostly divided into 5 to 6 parts:

  1. Salesforce platform interview questions
  2. Salesforce configuration interview questions
  3. Apex interview questions
  4. Lightning platform interview questions
  5. Integration-related interview questions
  6. Scenario-based Salesforce developer interview questions

Salesforce Platform Interview Questions and Answers

Let’s see the Salesforce platform-related interview questions and answers:

1. What is Sandbox and the Type of Sandbox in Salesforce?

A Salesforce sandbox is an isolated copy of your organization’s production environment that is used for development and testing purposes. Your production environment has your live data and active users logging in. A Salesforce sandbox will always include a copy of your production organization’s metadata

Types of Sandbox in Salesforce

There are 4 types of Salesforce sandbox environments.

  1. Developer Sandbox
  2. Developer Pro Sandbox
  3. Partial Copy
  4. Full Sandbox

2. What is Cloud Computing?

Cloud computing is a way to access information and applications online instead of having to build, manage, and maintain them on your own hard drive or servers. It’s fast, efficient, and secure.

Simply put, cloud computing is a way of accessing services on the internet instead of on your computer. You can use the cloud to access applications, data, and development tools from virtually anywhere. Whether you’re working on your phone from a crowded train in Chicago or on your laptop at a hotel in Hong Kong, you can access the same information because it all lives online.

3. What is Iaas?

IaaS stands for Infrastructure as a service: A cloud service provider owns and manages the hardware upon which your software stack runs. That includes servers, networking, and storage. This can be a great cost-reduction strategy if you’d like to avoid purchasing and maintaining infrastructure.
In this type of service, you will get the Virtual System that can be connected using the internet. Where you can install any Software even in some service providers you can install the operating system.

4. What is PaaS?

PaaS stands for Platform as a service: In this type of service, you get a development platform bundled with all the types of software preinstalled. You will then have to write and execute all your codes in a remote server by some mechanism.

5. What is Saas?

SaaS stands for Software as a service: It offers the most support and is the simplest of all delivery models for the end user. Chances are that you already use it in your organization. This is the highest level of service in which everything is provided from hardware to software to already build applications.

Salesforce Developer Configuration Interview Question and Answers

Let’s see the Salesforce platform configuration-related interview questions and answers:

6. What is the type of object relationship in Salesforce?

There are six types of object relationships in Salesforce.

  1. Lookup Relationships
  2. Master-Detail Relationship
  3. Many-to-Many Relationships (Junction Object)
  4. Self Relationship
  5. External Relationships
  6. Hierarchical Relationships

7. What is Junction Object in Salesforce?

A junction object is a custom object with two master-detail relationships, and it is the key to making a many-to-many relationship.

8. What is the difference between Roles and Profiles?

Profiles help to control object privileges such as CRED (Create, Read, Edit, Delete). They also contain system permissions that a user can carry out such as exporting data. Profile used for object level and Field level access. It is mandatory for all Users.

Roles on the other hand help with sharing records across an organization. They work in a hierarchical fashion, giving users access to records that are owned by people lower down in the hierarchy. Roles used for Record level access. It is not mandatory for all Users.

9. How many ways we have in Salesforce for Sharing?

There are 20+ ways to share record access in Salesforce.

  1. Profile/ Permission set Object level CRED access
  2. View All and Modify All permission on the profile or permission set
  3. Profile level System Permission.
  4. Organization-Wide Default (OWD)
  5. Record Ownership
  6. Role Hierarchy
  7. Case Team, Account Team, and Opportunity Team.
  8. Queues
  9. Sharing Rules
  10. Groups
  11. Territory Management
  12. Sharing Sets
  13. Sharing Groups
  14. Super User Access
  15. Manual Sharing
  16. Apex Sharing
  17. Visualforce with Apex
  18. Implicit Sharing
  19. Master-Detail Relationship
  20. External Account Hierarchy

10. What are Sharing Rules?

Sharing rules in Salesforce are used to create automatic exceptions to the Organization-Wide Default settings for the users who do not own the record.

They should be applied to the objects whose org-wide defaults are set to Public Read-only or Private because sharing rules can only extend the access they cannot restrict the access provided by Organization-wide defaults.

There are 2 types of Sharing Rules in Salesforce based on which records to be shared:

  • Owner Based
  • Criteria Based

11. How do we do Manual Sharing?

The Manual sharing button allows users to share records with others with one button click. Sometimes we encounter a scenario where individual users want to share their records with another colleague (user). In that case, manual sharing is the best option.

12. What is Apex Sharing?

There are situations where the business requirement is too complex and standard sharing rules provided by the Salesforce will not work. In that case we can use the Apex Sharing.

To access sharing programmatically, you must use the share object associated with the standard or custom object for which you want to share. For example, AccountShare is the sharing object for the Account object and for MyCustomObject it should be like MyCustomObject__Share. Here is sample code. Learn more about Apex Sharing.

public static boolean apexSharingDemo(Id recordId, Id userOrGroupId){
      MyCustomObject__Share myCustomObject  = new MyCustomObject__Share();
      myCustomObject.ParentId = recordId;
      myCustomObject.UserOrGroupId = userOrGroupId;
      myCustomObject.AccessLevel = 'Read';
      myCustomObject.RowCause = Schema.MyCustomObject__Share.RowCause.Manual;
      Database.SaveResult[] jobShareInsertResult = Database.insert(myCustomObject,false);

Learn more about Sharing and Visibility here.

13. Type of Flow in Salesforce?

Flow is an automation tool provided by Salesforce which can be used to perform various tasks like Sending Emails, Posting chatter, Sending custom Notifications &, etc using clicks instead of code. Check Salesforce Flow Builder training if you are new.

Types of flows in Salesforce

Salesforce Flow Interview Question
  1. Screen Flow: With Screen Flow you can create a custom UI (user interface) and guide users through a business process that can be launched from Lightning Pages, Experience Cloud (previously known as Community Cloud), quick actions and more.
  2. Record-Triggered Flow: This Flow launches when is record is created, updated, or deleted. So far, we have used Apex triggers for these automations some of which can now be done using Flows.
  3. Scheduled-Triggered Flow: This flow launches at the specified time and frequency for each record in a batch. Traditionally we have met this kind of requirement using Apex batch jobs.
  4. Platform Event Flow: Launches when a platform event message is received. For example, you can pump the data from an external system in Platform Events and then use Flows to split and save the records in different objects. 
  5. Auto launched Flow: Launches when invoked by Apex, Process Builder or even REST API

14. When to use Salesforce Flow and Apex?

Try not to mix Apex, Process Builders, Workflow Rules, and Record-Triggered flows. In general, you should choose one automation tool per object.

Salesforce FlowApex
let declarative tools handle non-DML activities like email alerts and in-app alertsseparate DML activity and offload it to Apex

15. Best practices for Salesforce Flow?

Check out the Apex hour blog post to learn about Best practices for Salesforce Flow.

  1. Always! Plan Before You Build
  2. “One Record-Triggered Flow” Per Object – Per Type
  3. No DML Statement in Loops
  4. Use the Advanced Technique to Merge Decision Node
  5. Build Reusable Flow(s) – Subflow(s)
  6. Don’t Create Flow for Everything
  7. Build in a test/Sandbox environment
  8. Supercharge Flow with Invocable Apex
  9. Don’t Hardcode IDs, Query for them!
  10. Dont mix Trigger, Process Builder, Flow and Record Trigger Flow
  11. Handle Errors with Fault Paths
  12. Exception handling in flow using Platform Events
  13. Use Debug Log to Check Why a Flow Fails at Runtime
  14. Flow Naming Conventions

Salesforce Developer Apex Interview Question and Answers

Let’s see the Salesforce platform Apex interview questions and answers:

16. What is Apex? and when to use Apex over Flow?

Apex is a programming language developed by Salesforce. It is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Salesforce platform.

One common approach is to separate DML activity and offload it to Apex, and let declarative tools handle non-DML activities like email alerts and in-app alerts — just be careful and ensure none of your Apex conflicts.

17. What are Apex Best practices in Salesforce?

Apex code is used to write custom and robust business logic. As with any language, there are key coding principles and best practices that will help you write efficient, scalable code. Check our Apex best practices of Salesforce.

  1. Bulkify Apex Code
  2. Avoid SOQL & DML inside for Loop
  3. Querying Large Data Sets
  4. Use of Map of Sobject
  5. Use of the Limits Apex Methods
  6. Avoid Hardcoding IDs
  7. Use Database Methods while doing DML operation
  8. Exception Handling in Apex Code
  9. Write One Trigger per Object per event
  10. Use Asynchronous Apex

18. What is Apex Trigger? and When we should use Apex Trigger?

The trigger is a procedure in a database that automatically invokes whenever a special event in the Database occurs. Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. Learn more about apex trigger here.

There lots of automation tool available in Salesforce. Lets understand the when to use Apex Trigger in Salesforce.

  1. Complex logic incapable of being processed via declarative artifacts
  2. Logic associated with DML
  3. Operations on unrelated objects
  4. Integration with External Systems

19. What is Apex Trigger Handler pattern?

Check this blog post to learn about which all trigger patterns are available in Salesforce. For Trigger Handler code check this post.

20. What is Apex Trigger Framework? What are different Trigger Framework are available in Salesforce?

How many trigger frameworks are available in Salesforce, which one is a lightweight apex trigger framework and a Comparison of different approaches? Check our Apex hours Trigger Framework in Salesforce sessions.

Type of different frameworks in Salesforce

  1. Trigger Handler Pattern
  2. Trigger Framework using a Virtual Class
  3. Trigger Framework using an Interface
  4. An architecture framework to handle triggers

21. What is Async Apex in Salesforce? How many ways do we have for Async processing?

In technology terminology, Asynchronous operation means that a process operating independently of other processes.

Using Async in Salesforce – how will we do it?

  1. Schedule & Batch jobs
  2. Queues
  3. @future
  4. Change Data Capture – Apex Triggers (Summer ’19)
  5. Platform Events – Event Based
  6. Continuations (UI)

22. What is a Batch job in Salesforce?

Batch class is used to process millions of records with in normal processing limits. With Batch Apex, we can process records asynchronously to stay within platform limits. If you have a lot of records to process, for example, data cleansing or archiving, Batch Apex is probably your best solution. In Batch Apex each transaction starts with a new set of governor limits, making it easier to ensure that your code stays within the governor execution limits

23. What is the difference between the Stateful and Stateless batch jobs?

Using Stateful Batch Apex

If your batch process needs information that is shared across transactions, one approach is to make the Batch Apex class itself stateful by implementing the Stateful interface. This instructs to preserve the values of your static and instance variables between transactions.

global class SummarizeAccountTotal implements Database.Batchable<sObject>, Database.Stateful{

In Short, if you need to send a mail to check the number of records passed and failed in the batch job counter, in that case, can you Stateful batch job?
If you want to create one counter and share/ use it in each execute method use the same.

Using Stateless Batch Apex

Batch Apex is stateless by default. That means for each execution of your execute method, you receive a fresh copy of your object. All fields of the class are initialized, static and instance.

global class SummarizeAccountTotal implements Database.Batchable<sObject>{

24. What is mixed DML?

A Mixed DML operation error occurs when you try to persist in the same transaction and change to a Setup Object and a non-Setup Object. For example, if you try to update an Account record and a User record at the same time.

Salesforce Developer Lightning Interview Question and Answers

25. What is Lightning Data Service?

Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you. In addition to simplifying access to Salesforce data, Lightning Data Service improves performance and user interface consistency

26. How to do communication between Lightning web components?

Use the Events in lightning web components (LWC) to communicate between components. Events in Lightning web components are built on DOM Events, a collection of APIs and objects available in every browser. Here we will be see how to the events using the Custom-event interface and publish-subscribe utility.

Learn about Event in LWC in our Events in Lightning web components post. Events are used in LWC for components communication. There are typically 3 approaches for communication between the components using events.

  1. Parent to Child Event communication in Lightning web component
  2. Custom Event Communication in Lightning Web Component (Child to Parent )
  3. Publish Subscriber model in Lightning Web Component or LMS (Two components which doesn’t have a direct relation )

27. How to call Apex class in Lightning web component and how many way we have and when to use which option?

You can call the apex methods as functions into the component by calling either via the wire service or imperatively. To call an Apex method, a Lightning web component can:

  • Wire a property
  • Wire a function
  • Call a method imperatively

To expose an Apex method to a Lightning web component, the method must be static and either global or public. Annotate the method with @AuraEnabled

Learn more from the Call apex method from the Lightning web components post.

28. What are the basic difference between Application Event and Component Event in Aura component?

Application EventComponent Events
Application Events are handled by any component have handler defined for event.These events are essentially a traditional publish-subscribe modelComponent Events can be handled by same component or a component that instantiates or contains the component
Application event can be used through out the application.
The component events can only be registered in child component and handled by parent component
We use attribute type="APPLICATION" in the aura:event tag for an application event.We use attribute type="COMPONENT" in the aura:event tag for a component event.

29. What is a lightning messaging service?

Lightning Message Service (LMS) allows you to communicate between Visualforce and Lightning Components (Aura and LWC both) on any Lightning page. LMS API allow you to publish message throughout the lightning experience and subscribe to the same message anywhere on lightning page.

Learn more here.

30. What is lazy loading in LWC and how do lazy loading in LWC?

Lazy loading is an optimization technique to load the content on demand. Instead of loading the entire data and rendering it to the user in one go as in bulk loading, the concept of lazy loading assists in loading only the required section and delays the remaining, until it is needed by the user.

Learn how to use lazy load in the lightning web component here.

31. What are Design Attributes in Lightning Web Components?

We can use Design Attribute to make lightning web components attribute available to System Admin to edit Lightning App Builder or Community. So we can expose the component attribute in Lightning App Builder using design Attribute.

Learn more from Design attributes in Lightning Web Components post.

Salesforce Integration Interview Questions

Here is a list of the most frequently asked Salesforce Integration question in the Developer Interview.

32. What is web services?

Web service is a standardized medium to propagate communication between the client and server applications on the World Wide Web. Web services provide a common platform that allows multiple applications built on various programming languages to have the ability to communicate with each other.

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

33. What is the difference between SOAP and REST?

Here is difference between SOAP and REST API.

Relies on SOAP protocolRelies on REST architecture using HTTP
Transports data in XMLTransports data in JSON or XML
Highly structured/ typedLess structured? Less bulky data
Handles large data loadsWorks well with JavaScript
Designed with large enterprise application in mindDesigned with mobile devices in mind

34. What is the difference between Enterprise WSDL and Partner WSDL?

Here is difference between Enterprise WDSL and Partner WDSL.

Enterprise WDSLPartner WSDL
Strongly TypedLoosely Typed
Tied to a specific configuration of SalesforceUseful for any configuration of Salesforce
Changes if custom field or custom objects are added to your organizationDoes not changes if custom field or custom objects are added to an organization’ Salesforce configuration

35. Explain about Integration Patterns?

In salesforce we have welcome Integration patterns.

  1. ” Remote Process Invocation—Request and Reply ” : Salesforce invokes a process on a remote system, waits for completion of that process, and then tracks state based on the response from the remote system.
  2. ” Remote Process Invocation—Fire and Forget ” : Salesforce invokes a process in a remote system but doesn’t wait for completion of the process. Instead, the remote process receives and acknowledges the request and then hands off control back to Salesforce.
  3. ” Batch Data Synchronization ” : Data stored in Lightning Platform is created or refreshed to reflect updates from an external system, and when changes from Lightning Platform are sent to an external system. Updates in either direction are done in a batch manner.
  4. ” Remote Call-In ” : Data stored in Lightning Platform is created, retrieved, updated, or deleted by a remote system.
  5. ” UI Update Based on Data Changes ” : The Salesforce user interface must be automatically updated as a result of changes to Salesforce data.
  6. Data Virtualization ” : Salesforce accesses external data in real time. This removes the need to persist data in Salesforce and then reconcile the data between Salesforce and the external system

Please below recording to learn about. Salesforce Integration Patterns & Best Practices.

Scenario based Salesforce developer interview questions

Check more Salesforce Lightning Scenario-based Salesforce developer interview questions here.


I hope this set of Salesforce Interview Questions would be quite helpful to clear your Salesforce Developer interview. Feel free to add questions in the comments that you recently faced.

Amit Chaudhary
Amit Chaudhary

Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates.

He is a active blogger and founder of Apex Hours.

Articles: 466

Leave a Reply

Your email address will not be published. Required fields are marked *