Salesforce Developer

filter-iconFilter interviews by

400+ Salesforce Developer Interview Questions and Answers

Updated 7 Mar 2025

Popular Companies

search-icon

Q51. what can cause data loss in salesforce

Ans.

Various factors can cause data loss in Salesforce.

  • Human error such as accidental deletion or overwriting of data

  • System failures or crashes

  • Data migration or integration errors

  • Malicious intent or hacking

  • Expiration of data retention policies

  • Third-party app or plugin issues

Q52. Fetch data in table from apex

Ans.

Fetching data from table in Apex

  • Use SOQL query to fetch data from table

  • Assign the query result to a list variable

  • Iterate through the list to access individual records

Q53. Tell me about trigger Governor limit Soql sosl Relationship in Salesforce

Ans.

Triggers are code that execute before or after specific events occur in Salesforce. Governor limits are limits on resources that a single transaction can consume. SOQL and SOSL are query languages used to search for data in Salesforce. Relationships define how objects are related to each other in Salesforce.

  • Triggers are used to automate processes in Salesforce

  • Governor limits prevent a single transaction from consuming too many resources

  • SOQL is used to search for data in a sin...read more

Q54. Your organization wants to track donation form donor to various campaign. How would you create data model in salesforce?

Ans.

Create custom objects for Donor, Donation, and Campaign with appropriate relationships in Salesforce.

  • Create a custom object for Donor with fields like Name, Contact Information, etc.

  • Create a custom object for Donation with fields like Amount, Date, Donor (lookup to Donor object), etc.

  • Create a custom object for Campaign with fields like Name, Start Date, End Date, etc.

  • Establish relationships between Donor and Donation (one-to-many) and between Donation and Campaign (many-to-on...read more

Are these interview questions helpful?

Q55. Can we using old method for data update ?

Ans.

No, using old methods for data update is not recommended.

  • Old methods may not be compatible with new systems

  • Old methods may not have the necessary security measures

  • Using old methods can lead to data corruption or loss

Q56. What are API calls in Salesforce?

Ans.

API calls are requests made to Salesforce servers to retrieve or manipulate data.

  • API calls are used to integrate Salesforce with external systems

  • API calls can be made using SOAP, REST, or Bulk APIs

  • API calls are limited based on the edition of Salesforce and can be monitored in the Developer Console

  • Examples of API calls include retrieving data from Salesforce, creating new records, and updating existing records

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q57. Tell me about Asynchronous Apex? Difference between Batch Apex and Queueable Apex

Ans.

Asynchronous Apex allows you to run processes in the background, without user interaction. Batch Apex and Queueable Apex are two types of Asynchronous Apex.

  • Asynchronous Apex allows you to process large amounts of data asynchronously, without impacting the user interface.

  • Batch Apex is used to process large data sets that can be divided into smaller batches for processing.

  • Queueable Apex allows you to submit jobs for asynchronous processing, similar to future methods but with mo...read more

Q58. how to change create date while uploading the record through data loader?

Ans.

You can change the create date while uploading records through Data Loader by enabling the 'Allow Insert' option.

  • Enable 'Allow Insert' option in Data Loader settings

  • Map the 'Created Date' field in the mapping file to the desired date/time value

  • Ensure the user has the necessary permissions to change the create date

Salesforce Developer Jobs

Salesforce Developer 1-7 years
Amazon India Software Dev Centre Pvt Ltd
4.1
Chennai
Salesforce Developer 2-6 years
AU Small Finance Bank
4.2
Jaipur
AU Small Finance Bank - Salesforce Developer - Lightning Component Framework (2-5 yrs) 2-5 years
Au Finance Bank
4.2

Q59. how wire method works, while importing data want to add record inside wire method in Jsfile how?

Ans.

Wire method in Salesforce is used to fetch data from Apex controller to Lightning Web Component. Adding records inside wire method in JS file involves using imperative Apex to create records.

  • Use @wire decorator in Lightning Web Component JS file to call an Apex method

  • Inside the wire method, use imperative Apex to create records by calling the createRecord method from the Lightning Data Service

  • Pass the record data as parameters to the createRecord method

Q60. What are external objects and how can you use them with a scenario?

Ans.

External objects are virtual objects that allow you to access data stored outside Salesforce.

  • External objects represent data from an external system in Salesforce without copying the data into Salesforce.

  • They are defined using external data sources and external data objects.

  • You can use them to integrate data from external systems like databases, ERP systems, or web services.

  • External objects allow you to view and interact with external data in Salesforce as if it were native S...read more

Q61. Write the code to reverse the string

Ans.

Code to reverse a string

  • Use a loop to iterate through the string

  • Create a new string and add each character from the original string in reverse order

  • Return the new string

Q62. Write cod on the trigger what you perform on the realtime use case

Ans.

Trigger code for a real-time use case

  • Identify the object and event that will trigger the code

  • Write the code to perform the desired action on the object

  • Test the code thoroughly to ensure it works as expected

Q63. How to cal child to parent in Lightning aura

Ans.

To call child to parent in Lightning aura, use events and event handlers.

  • Create an event in the child component

  • Register the event in the parent component

  • Create an event handler in the parent component

  • Fire the event from the child component

  • Handle the event in the parent component

  • Pass data between the child and parent components using event attributes

Q64. What is difference between profile and permission sets

Ans.

Profiles define user's access to objects and fields while permission sets grant additional permissions to users.

  • Profiles are assigned to users and define their access to objects, fields, tabs, and other features.

  • Permission sets are used to grant additional permissions to users without changing their profiles.

  • Profiles are used to restrict access while permission sets are used to grant access.

  • Profiles are used to define the baseline access while permission sets are used to exte...read more

Q65. how manual sharing works and how to see manually shared rercords

Ans.

Manual sharing allows users to manually grant access to records. To see manually shared records, use the 'Sharing' button on the record detail page.

  • Manual sharing is a feature in Salesforce that allows users to manually grant access to records.

  • It is useful when users need to share specific records with other users or groups.

  • To manually share a record, users can click on the 'Sharing' button on the record detail page.

  • From there, they can add individual users or groups and spec...read more

Q66. 1.Different relationships? 2.Difference between whoid and whatid? 3.what is global class? 4.what is Salesforce?

Ans.

A Salesforce Developer interview question about relationships, whoid and whatid, global class, and Salesforce.

  • Different relationships in Salesforce include one-to-many, many-to-many, and hierarchical relationships.

  • Whoid and whatid are fields used in Salesforce to identify the related object in an activity record. Whoid represents a person, while whatid represents an object.

  • A global class in Salesforce is a class that can be accessed from any Apex code in a Salesforce organiza...read more

Q67. Explain Future method? and why we need (Callout= true) along with that annotation?

Ans.

Future method is used to run code asynchronously. Callout=true is needed to make HTTP callouts from future methods.

  • Future methods are used to run code asynchronously in Salesforce.

  • They are annotated with @future annotation.

  • Callout=true is needed to make HTTP callouts from future methods.

  • Without Callout=true, making HTTP callouts from future methods is not allowed.

Q68. Access Modifiers in Apex

Ans.

Access modifiers in Apex control the visibility and accessibility of classes, methods, variables, and interfaces.

  • There are three access modifiers in Apex: private, public, and global.

  • Private access modifier restricts access to only within the defining class.

  • Public access modifier allows access from any other class or trigger.

  • Global access modifier allows access from any Apex code in any Salesforce organization.

  • Access modifiers can be applied to classes, methods, variables, an...read more

Q69. How would you do an integration that allow another entity to insert Leads?

Ans.

Use Salesforce API to create a custom integration for inserting Leads from another entity.

  • Create a custom REST API in Salesforce to receive Lead data from the external entity

  • Implement authentication and authorization mechanisms to ensure secure data transfer

  • Map the fields from the external entity to the Lead object in Salesforce

  • Handle error scenarios and provide appropriate feedback to the external entity

Q70. Components under a lightning aura bundle

Ans.

Components under a Lightning Aura Bundle

  • A Lightning Aura Bundle can contain multiple components

  • These components can be of different types such as Lightning Component, Apex Class, etc.

  • The components can communicate with each other using events

  • The bundle can also contain design resources like CSS and images

Q71. Develop calc in programming language of your choice

Ans.

I would develop a calculator in Python using basic arithmetic operations and GUI libraries.

  • Use Python's built-in arithmetic operators (+, -, *, /) to perform calculations.

  • Use a GUI library like Tkinter or PyQt to create a user-friendly interface.

  • Implement error handling to prevent invalid inputs and division by zero.

  • Consider adding additional features like memory functions or scientific notation.

  • Test the calculator thoroughly to ensure accurate results.

Q72. How you can optimize SOQL? Concept of indexing.

Ans.

Optimizing SOQL involves understanding indexing and using it to improve query performance.

  • Use WHERE clauses to filter results before querying

  • Avoid using SELECT * and instead specify only necessary fields

  • Use LIMIT to limit the number of records returned

  • Understand the relationship between objects and use JOINs when necessary

  • Use the EXPLAIN keyword to analyze query performance

  • Index fields that are frequently used in WHERE clauses or ORDER BY clauses

Q73. what is salesforce backend like MVC ?

Ans.

Salesforce backend follows a similar pattern to MVC architecture.

  • Salesforce backend is divided into three layers: Model, View, and Controller.

  • Model layer contains the data and business logic.

  • View layer is responsible for rendering the user interface.

  • Controller layer handles user input and communicates with the Model and View layers.

  • Apex is used for the Controller layer and SOQL for the Model layer.

  • Visualforce is used for the View layer.

  • This architecture helps in separating co...read more

Q74. Wha are important feature of service cloud, LWC decorators, events in lwc, asynchronous apex , batch class, flows and its type , experience cloud basics .

Ans.

Service Cloud features, LWC decorators, events, asynchronous apex, batch class, flows, and experience cloud basics.

  • Service Cloud features include case management, knowledge base, omni-channel routing, and service console.

  • LWC decorators are used to add metadata to Lightning web components, such as @api, @track, and @wire.

  • Events in LWC are used for communication between components, such as standard events like onchange and custom events.

  • Asynchronous Apex allows for long-running...read more

Q75. Why can't we create a master detail on contact as the child object

Ans.

Master-detail relationship on Contact as child object is not allowed due to data integrity concerns.

  • Contact is a standard object and cannot be a child object in a master-detail relationship

  • Master-detail relationships require the child object to have a lookup to the parent object

  • Contacts are often used as the primary object in many relationships, making it unsuitable as a child object

Q76. When you want delete account accosiated with contact. The account should not get deleted.

Ans.

To delete an account associated with a contact without deleting the account itself.

  • Remove the contact's association with the account before deleting the contact.

  • Check for any other dependencies before deleting the contact.

  • Consider creating a custom field to track the association between the contact and account.

Q77. How to use current page's Id in LWC

Ans.

To use current page Id in LWC, we can import '@salesforce/apex' and call Apex method to get the Id.

  • Import '@salesforce/apex' in LWC JS file

  • Create an Apex method to return current page Id

  • Call the Apex method in LWC JS file using '@wire'

  • Access the current page Id in LWC HTML file using '{pageId}'

Q78. Best practices for Apex class and Test class

Ans.

Best practices for Apex class and Test class

  • Use meaningful class and method names

  • Write clear and concise code

  • Use comments to explain complex logic

  • Write test classes to cover all scenarios

  • Use System.assert() to validate expected results

  • Avoid hardcoding values

  • Use try-catch blocks to handle exceptions

  • Avoid SOQL queries and DML statements in loops

  • Use @isTest annotation for test classes

  • Use Test.startTest() and Test.stopTest() to test governor limits

Q79. Why we use test.startTest and test.stopTest?

Ans.

test.startTest and test.stopTest are used in Salesforce to isolate and execute test code.

  • test.startTest and test.stopTest are used to isolate and execute test code within a specific context

  • test.startTest marks the beginning of a block of code that should be covered by a single test transaction

  • test.stopTest marks the end of that block and ensures that all asynchronous processes are completed before continuing

  • Using these methods helps in accurately measuring the performance and...read more

Q80. in future what is use of salesforce

Ans.

Salesforce will continue to be a leading CRM platform, enabling businesses to streamline their operations and improve customer engagement.

  • Salesforce will continue to innovate and introduce new features and functionalities.

  • It will enable businesses to leverage AI and machine learning to gain insights and improve decision-making.

  • Salesforce will also play a key role in digital transformation initiatives, helping businesses to modernize their operations and stay competitive.

  • Examp...read more

Q81. What is the asynchronous apex, and why do we use ascynchronously rather than a synchronous apex.

Ans.

Asynchronous Apex is used to perform long-running operations in the background without blocking the user interface.

  • Asynchronous Apex allows for processing tasks in the background, freeing up the user interface for other actions.

  • It is used for long-running operations like callouts to external systems, batch processing, and future methods.

  • Using asynchronous Apex helps improve performance and scalability of the application.

  • Examples include @future methods, Queueable Apex, Batch ...read more

Q82. tirgger to update shipping address

Ans.

A trigger can be created to update shipping address based on certain criteria.

  • Create a trigger on the object where the shipping address is stored

  • Use an if statement to check the criteria for updating the address

  • Update the shipping address field using the appropriate syntax

Q83. what is salesforce architecture ?

Ans.

Salesforce architecture is a multi-layered framework that allows for customization and scalability.

  • Salesforce architecture consists of four layers: presentation, logic, data, and storage.

  • The presentation layer is responsible for the user interface and user experience.

  • The logic layer contains the business rules and processes.

  • The data layer stores the data and manages relationships between objects.

  • The storage layer manages the physical storage of data.

  • Salesforce architecture al...read more

Q84. What are the integration frameworks that you have worked with?

Ans.

I have worked with integration frameworks such as MuleSoft, Apache Camel, and Dell Boomi.

  • MuleSoft

  • Apache Camel

  • Dell Boomi

Q85. Why has Salesforce introduced LWCs over Aura components?

Ans.

Salesforce introduced LWCs for better performance, reusability, and modern web standards.

  • LWCs offer better performance due to their lightweight nature and optimized rendering.

  • LWCs promote reusability through modular design and encapsulation of functionality.

  • LWCs align with modern web standards like ES6, Shadow DOM, and Web Components, making them more future-proof.

  • Aura components are based on Aura framework, which has limitations in terms of performance and flexibility.

Q86. What are all the tasks can achieve using workflow?

Ans.

Workflow allows automation of standard internal procedures and processes to save time across the organization.

  • Automatically update fields on a record

  • Send email alerts

  • Create tasks

  • Update related records

  • Submit records for approval

  • Create outbound messages

  • Invoke Apex code

  • Send outbound messages

  • Create time-dependent actions

Q87. Write a apex program fetch the all the opportunity data based on the stage details

Ans.

Apex program to fetch opportunity data based on stage details

  • Create a SOQL query to fetch all the opportunity records with the required stage details

  • Use a for loop to iterate through the query results and store the data in a list

  • Return the list of opportunity data to the calling method or class

  • Example: List oppList = [SELECT Id, Name, StageName FROM Opportunity WHERE StageName = 'Closed Won'];

Q88. 1. When to use global apex class 2. Difference between Queueable, Batch class and Schedule class 3. Have you implemented flows for API call 4. What is decorator in LWC 5. Explain flow types

Ans.

1. Global apex classes are used when the class needs to be accessed from outside the package. 2. Queueable, Batch, and Schedule classes are used for asynchronous processing in Salesforce. 3. Yes/No. 4. Decorator in LWC is used to enhance the functionality of a component. 5. Flow types include autolaunched flows, screen flows, and trigger flows.

  • Global apex classes are used for external access

  • Queueable, Batch, and Schedule classes are used for asynchronous processing

  • Decorator i...read more

Q89. What are the difference between types of normal forms in DBMS

Ans.

Different normal forms in DBMS help in organizing data efficiently and reducing redundancy.

  • First Normal Form (1NF) - Eliminates repeating groups and ensures each attribute contains only atomic values.

  • Second Normal Form (2NF) - Meets 1NF requirements and all non-key attributes are fully functional dependent on the primary key.

  • Third Normal Form (3NF) - Meets 2NF requirements and eliminates transitive dependencies between non-key attributes.

  • Boyce-Codd Normal Form (BCNF) - A stro...read more

Q90. Write a trigger to update a field on child record a default value if the child record is the only child of parent

Ans.

Write a trigger to update a field on child record with default value if it is the only child of parent

  • Create a trigger on the child object

  • Query for the parent record and check if it has only one child record

  • If the parent has only one child, update the field on the child record with the default value

Q91. How to get the client id and secret of an external app in integration

Ans.

Client id and secret can be obtained by registering the external app in the integration platform

  • Register the external app in the integration platform (e.g. Salesforce)

  • Navigate to the app's settings or configuration page

  • Look for the client id and secret provided by the integration platform

  • Use the client id and secret in the app's authentication process

Q92. diff between master-detail relationship & lookup relationship

Ans.

Master-detail relationship is a parent-child relationship where the child record cannot exist without the parent record. Lookup relationship is a simple association between two objects.

  • Master-detail relationship is a stricter relationship than lookup relationship.

  • Master-detail relationship is used when there is a parent-child relationship between two objects.

  • In master-detail relationship, the child record inherits the sharing and security settings of the parent record.

  • Lookup ...read more

Q93. What is the by default sharing method followed by apex code

Ans.

Apex code follows the by default sharing method of 'with sharing'.

  • By default, Apex code enforces sharing rules that apply to the current user.

  • This means that the code runs in the user's context and respects their sharing settings.

  • Developers can also use 'without sharing' to bypass sharing rules if necessary.

Q94. What is governor limit ? why is it there ?

Ans.

Governor limits are limits enforced by Salesforce to ensure efficient use of shared resources.

  • Governor limits are enforced on Apex code, SOQL queries, DML statements, and other operations.

  • They prevent runaway code from monopolizing shared resources and causing performance issues.

  • Examples of governor limits include limits on CPU time, heap size, and database queries.

  • Developers must design their code to work within these limits to ensure efficient use of resources.

  • Governor limi...read more

Q95. How to improve test coverage of a class.

Ans.

To improve test coverage of a class, write more test cases to cover all possible scenarios.

  • Identify uncovered lines of code using a code coverage tool

  • Write test cases for each uncovered line of code

  • Write test cases for boundary conditions and edge cases

  • Use mock objects to simulate dependencies

  • Refactor code to make it more testable

Q96. Difference between process builder and workflow.

Ans.

Process builder is more powerful than workflow and can perform complex actions.

  • Process builder can update related records, create records, and call Apex classes

  • Workflow can only update the record it is triggered on

  • Process builder has a visual interface for easier setup

  • Workflow has been around longer and is simpler to use

  • Both can be used to automate business processes

Q97. What is differences between custom setting and metadata?

Ans.

Custom settings are used to store data that can be used across the organization, while metadata is used to define the structure of an application.

  • Custom settings are used to store data that can be used across the organization, while metadata is used to define the structure of an application.

  • Custom settings can be accessed using Apex code, while metadata can be accessed using the Metadata API.

  • Custom settings can be used to store data that is specific to an organization, while ...read more

Q98. what is master detail relationship

Ans.

Master-detail relationship is a type of relationship in Salesforce where the master record controls certain behaviors of the detail record.

  • Master-detail relationship is a parent-child relationship where the master record controls certain behaviors of the detail record.

  • The detail record inherits certain fields, security, and sharing settings from the master record.

  • Deleting a master record automatically deletes all its detail records.

  • A detail record cannot exist without a maste...read more

Q99. What is the use of SOQL?

Ans.

SOQL is used to query data from Salesforce database.

  • SOQL stands for Salesforce Object Query Language.

  • It is used to retrieve data from Salesforce objects.

  • It supports filtering, sorting, and grouping of data.

  • It can be used in Apex code, Visualforce pages, and Lightning components.

  • Example: SELECT Name, AccountNumber FROM Account WHERE Industry = 'Technology'

Q100. why we use apex programming language

Ans.

Apex is used for building custom business logic and integrations on the Salesforce platform.

  • Apex is a strongly-typed, object-oriented programming language.

  • It allows developers to create custom code to extend Salesforce functionality.

  • Apex can be used to build triggers, controllers, and classes for custom business logic.

  • It can also be used to integrate Salesforce with external systems.

  • Apex code runs natively on the Salesforce platform, providing secure and scalable performance.

Previous
1
2
3
4
5
6
7
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.5k Interviews
3.8
 • 8.2k Interviews
3.6
 • 7.6k Interviews
3.7
 • 5.6k Interviews
3.7
 • 5.6k Interviews
3.7
 • 4.8k Interviews
3.8
 • 2.8k Interviews
3.4
 • 1.4k Interviews
4.0
 • 224 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Recently Viewed
SALARIES
Reliance Industries
SALARIES
Simplex Infrastructures
JOBS
Technip Energies
No Jobs
INTERVIEWS
Apollo Tyres
No Interviews
SALARIES
TVS Eurogrip
SALARIES
Apollo Tyres
SALARIES
Grab Greco
INTERVIEWS
MRF Tyres
No Interviews
SALARIES
Bridge & Roof Co
SALARIES
Bridge & Roof Co
Salesforce Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter