Salesforce Developer

400+ Salesforce Developer Interview Questions and Answers

Updated 11 Dec 2024

Popular Companies

search-icon

Q51. 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

Q52. 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

Q53. 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

Q54. 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

Are these interview questions helpful?

Q55. 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

Q56. 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

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q57. 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

Q58. 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

Salesforce Developer Jobs

Salesforce Developer 4-6 years
Capgemini Technology Services India Limited
3.8
Bangalore / Bengaluru
Salesforce Developer 4-9 years
Cognizant
3.8
Hyderabad / Secunderabad
Tietoevry - Salesforce Developer - Solution Design (5-7 yrs) 5-7 years
EVRY India Pvt Ltd
4.5
₹ 10 L/yr - ₹ 25 L/yr

Q59. 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.

Q60. 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

Q61. 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

Q62. 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

Q63. 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

Q64. 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

Q65. 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.

Q66. 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

Q67. 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

Q68. 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.

Q69. 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

Q70. 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}'

Q71. 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

Q72. 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

Q73. 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

Q74. 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

Q75. 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

Q76. 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

Q77. 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.

Q78. 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

Q79. 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'];

Q80. 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

Q81. 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

Q82. 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

Q83. 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

Q84. 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.

Q85. 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

Q86. 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

Q87. 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

Q88. 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

Q89. 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

Q90. 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.

Q91. What are the types of relationships in salesforce?

Ans.

Salesforce has four types of relationships: Lookup, Master-Detail, Many-to-Many, and Hierarchical.

  • Lookup relationship is a simple association between two objects.

  • Master-Detail relationship is a parent-child relationship where the child record cannot exist without the parent.

  • Many-to-Many relationship is used when a record in one object can be linked to multiple records in another object and vice versa.

  • Hierarchical relationship is used to create a parent-child relationship betw...read more

Q92. 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

Q93. 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'

Q94. Write a trigger to update StageName on Opportunity whenever the Account Active field is set to Yes

Ans.

Trigger to update StageName on Opportunity when Account Active field is set to Yes

  • Create a trigger on Account object

  • Query for related Opportunities

  • Update StageName field on Opportunities where Account Active is Yes

Q95. Aura components. Events and it's types.

Ans.

Aura components use events to communicate between components. There are three types of events: Component, Application, and System.

  • Component events are used to communicate between components in the same hierarchy.

  • Application events are used to communicate between components across the entire application.

  • System events are used to communicate with Salesforce and other third-party systems.

  • Events are fired using the $A.get('e.eventName') method.

  • Events can also have attributes that...read more

Q96. How the event propagates through parent to child and vice versa

Ans.

Events propagate through parent to child using event bubbling and child to parent using event capturing.

  • Event propagation in DOM occurs in two phases: capturing phase and bubbling phase.

  • During capturing phase, events are captured from the top-most parent element down to the target element.

  • During bubbling phase, events are bubbled up from the target element to the top-most parent element.

  • This allows for event handling at different levels of the DOM hierarchy.

  • Example: Click eve...read more

Q97. What is the difference between Batchable and Queueable Apex?

Ans.

Batchable Apex is used for processing large data sets in smaller chunks, while Queueable Apex is used for asynchronous processing of single job.

  • Batchable Apex is used for processing large data sets in smaller chunks

  • Queueable Apex is used for asynchronous processing of single job

  • Batchable Apex can be scheduled to run at specific times, while Queueable Apex runs immediately after being added to the queue

  • Batchable Apex uses the Database.Batchable interface, while Queueable Apex ...read more

Q98. write trigger on opportunity to sum of total opps and populate on account sumofopps field

Ans.

Write a trigger on Opportunity to calculate the sum of total opportunities and populate it on the Account's 'SumOfOpps' field.

  • Create a trigger on the Opportunity object

  • Use an aggregate query to calculate the sum of the 'Amount' field on all related Opportunities

  • Update the 'SumOfOpps' field on the related Account with the calculated sum

Q99. What is custom object in salesforce . What is salesforce .

Ans.

Custom object is a database table that allows you to store data specific to your organization in Salesforce.

  • Custom objects are created by the user to store data specific to their organization

  • They can have custom fields, relationships, and page layouts

  • Examples include a custom object for tracking customer feedback or a custom object for managing project tasks

Q100. Annotations used in salesforce

Ans.

Annotations are used in Salesforce to add metadata to classes, methods, and variables.

  • Annotations are used to provide additional information to the compiler or runtime engine.

  • They can be used to control the behavior of code, such as enforcing security or limiting access.

  • Examples of annotations include @AuraEnabled, @TestSetup, and @Deprecated.

  • Annotations can also be used to provide documentation for code, such as @description or @param.

  • Annotations are defined using the @ symb...read more

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
 • 10k Interviews
3.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.8
 • 5.4k Interviews
3.7
 • 5.2k Interviews
3.8
 • 4.7k Interviews
3.8
 • 2.8k Interviews
3.4
 • 1.3k Interviews
4.1
 • 260 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

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
Get AmbitionBox app

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