Salesforce Developer

500+ Salesforce Developer Interview Questions and Answers

Updated 5 Jul 2025
search-icon

Asked in NTT Data

2w ago

Q. Write a SOQL query to fetch the values of description field from the Account. Why does "the description field cannot be filtered in the query call"?

Ans.

SOQL query to fetch description field from Account and reason for inability to filter

  • SOQL query: SELECT Description FROM Account

  • Description field is not filterable because it is a long text field

  • Long text fields cannot be filtered in SOQL queries

6d ago

Q. Write a trigger that, when inserting a contact (application user), checks if the contact is associated with any account. If not, assign it to a 'Test Account'. If the 'Test Account' does not exist, create it, e...

read more
Ans.

Trigger to assign or create a Test Account for Contacts without an associated Account.

  • Use an 'after insert' trigger on the Contact object.

  • Query for existing 'Test Account' to avoid duplicates.

  • If no Account is associated with the Contact, assign the existing 'Test Account'.

  • If no 'Test Account' exists, create one and associate it with the Contact.

  • Ensure to handle bulk inserts to avoid governor limits.

Asked in Capgemini

2d ago

Q. How to invoke flows - using other flows and Apex. How do we invoke an apex class from a flow and pass variables?

Ans.

Flows can be invoked using other flows and Apex. Apex classes can be invoked from a flow by using invocable methods and passing variables as input parameters.

  • To invoke a flow from another flow, use the 'Launch Flow' element in the Flow Designer.

  • To invoke an Apex class from a flow, create an invocable method in the Apex class and annotate it with @InvocableMethod.

  • Pass variables from a flow to an Apex class by defining input parameters in the invocable method.

  • In the flow, use t...read more

Q. Describe a trigger scenario where the count of child records is updated on the parent record using a trigger. How do you bulkify a trigger?

Ans.

Bulkify a trigger to count child records and update parent records efficiently in Salesforce.

  • Use a Map to store parent records and their corresponding child counts.

  • Query all relevant child records in a single SOQL query to avoid governor limits.

  • Iterate through the child records and populate the Map with counts.

  • Update the parent records in bulk after processing all child records.

  • Example: If a parent Account has multiple Contacts, count them and update a custom field on the Acc...read more

Are these interview questions helpful?

Asked in Deloitte

2w ago

Q. How do you fetch data into a table using 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

1w ago

Q. How do you call Apex code using Process Builder?

Ans.

Apex code can be called using process builder by creating an Apex action and invoking it in the process builder.

  • Create an Apex class with a method that performs the desired functionality

  • In the process builder, create a new action and select the Apex class and method

  • Configure the input and output variables for the Apex action

  • Add the Apex action to the process builder flow

  • Activate the process builder

Salesforce Developer Jobs

Schneider Electric India  Pvt. Ltd. logo
Salesforce Developer 3-7 years
Schneider Electric India Pvt. Ltd.
4.1
₹ 9 L/yr - ₹ 19 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
Cummins logo
Salesforce Developer 3-8 years
Cummins
4.3
Pune
Ford Global Business Services logo
Salesforce Developer 4-5 years
Ford Global Business Services
4.3
Chennai

Asked in Capgemini

2w ago

Q. What are triggers and what are their uses?

Ans.

Triggers are automated actions that are executed when a specific event occurs in a Salesforce database.

  • Triggers are used to perform custom actions before or after specific events, such as inserting, updating, or deleting records.

  • Triggers can be used to enforce business rules, validate data, or update related records.

  • Triggers are written in Apex code and can be used to extend the functionality of Salesforce beyond its standard capabilities.

  • For example, a trigger can be used to...read more

Asked in HARMAN

2d ago

Q. What can do for run apex class ? what is get precaution ?

Ans.

To run an Apex class, we need to create an instance of the class and call its methods. Precautions include testing and avoiding governor limits.

  • Create an instance of the class using the 'new' keyword

  • Call the methods using dot notation

  • Test the class thoroughly before deploying to production

  • Avoid hitting governor limits by optimizing code and limiting queries

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Nagarro

2w ago

Q. What happens if we don't provide values for required fields when inserting data using insert or database.insert in Salesforce?

Ans.

If required fields are not given while inserting data through insert or database.insert, an error is thrown.

  • An error message is displayed indicating which fields are required.

  • The record is not inserted into the database.

  • The transaction is rolled back.

  • The error can be caught and handled in the code.

  • Validation rules can also prevent the insertion of records with missing required fields.

Asked in Cloud Q

1w ago

Q. What are the various types of custom objects in Salesforce, including their extensions such as how custom objects typically end with __c and custom metadata ends with __mdt?

Ans.

Various types of custom objects in Salesforce and their extensions

  • Standard custom objects (ending with __c)

  • Custom metadata types (ending with __mdt)

  • Custom settings (ending with __c)

  • External objects (ending with __x)

  • Big objects (ending with __b)

Asked in Cloud Q

5d ago

Q. Which DML method do you prefer for updating the list of records in a Batch Class, and why do you prefer that method over others?

Ans.

I prefer using the Database.update method in a Batch Class for updating a list of records.

  • Database.update is bulkified and can handle large volumes of records efficiently

  • It allows for partial success handling, where some records can be updated even if others fail

  • It automatically triggers any necessary validation rules and workflows

  • It is recommended for use in Batch Classes to ensure optimal performance

2w ago

Q. How does the wire method work? While importing data, how can you add a record inside the wire method in a JavaScript file?

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

Asked in NTT Data

2w ago

Q. What is the use of the @track decorator? Is it mandatory to explicitly use it, and if so, for which use case?

Ans.

The @track decorator in Salesforce is used to track changes to a property in a Lightning web component.

  • Used to make a property reactive and trigger re-renders when its value changes

  • Not mandatory but recommended for properties that need to be reactive

  • Use @track when you want changes to a property to be reflected in the UI

2w ago

Q. * Sharing and without sharing difference * Difference between "null" and "isbllank" * Challenging scenario in my previous role.

Ans.

Salesforce Developer interview questions on sharing, null vs isblank, and challenging scenario.

  • Sharing determines the level of access to records for users and groups.

  • Without sharing means that access to records is not restricted by sharing rules.

  • Null means that a field has no value, while isblank checks if a field is null or empty.

  • Challenging scenario in previous role involved integrating multiple systems with complex data mappings.

Asked in Cognizant

3d ago

Q. What are the methods of the Batchable Interface?

Ans.

Batchable interface has three methods: start(), execute(), and finish().

  • start() method is used to initialize the batch job and return the query locator.

  • execute() method is used to process the records returned by the query locator.

  • finish() method is used to perform any final operations after the batch job completes.

1w ago

Q. What is power electronics, what is the architecture of the ic2716

Ans.

Power electronics is the application of electronics to control and convert electrical power.

  • Power electronics involves the use of semiconductor devices such as diodes, transistors, and thyristors to control and convert electrical power.

  • The architecture of the ic2716 is a 16Kbit EPROM (erasable programmable read-only memory) with a 24-pin DIP (dual in-line package) configuration.

  • The ic2716 is commonly used in microcontroller and embedded systems for storing program code and da...read more

Asked in Accenture

2w ago

Q. What is Queueable Apex in Salesforce?

Ans.

Quable Apex is a tool that allows developers to write and test Apex code in a more efficient and organized way.

  • Quable Apex provides a structured way to organize Apex code

  • It allows developers to write and test code in a more efficient manner

  • Quable Apex includes features such as code versioning and deployment management

  • It can be integrated with Salesforce's development tools such as the Force.com IDE

Q. How to convert Json data into string in LWC Can we do callouts from LWC? What is the precautions need to take care Before writing queaueable apex class? Have you worked on platform events? How to communicate un...

read more
Ans.

To convert Json data into string in LWC, use JSON.stringify() method.

  • Use JSON.stringify() method to convert Json data into string in LWC.

  • Yes, callouts can be made from LWC using imperative Apex.

  • Precautions before writing queueable Apex class include governor limits, bulkification, and error handling.

  • Platform events can be used for inter-component communication in LWC.

  • To communicate unrelated LWC components, use Lightning Message Service or Custom Events.

1w ago

Q. With Read and Write permissions on an object, what could prevent a user from seeing all records?

Ans.

User may not see all records due to sharing settings, role hierarchy, or record ownership restrictions.

  • Sharing Rules: If sharing rules are set up, users may only see records shared with them.

  • Role Hierarchy: Users in lower roles may not see records owned by users in higher roles.

  • Record Ownership: Users can only see records they own unless sharing rules allow otherwise.

  • Field-Level Security: Even with object permissions, field-level security may restrict visibility of certain fi...read more

Asked in Team Lease

2d ago

Q. What is java & features,jdk8,exceptions & types,list ,set & map, spring boot artitecture.

Ans.

Java is a popular programming language with features like OOP, platform independence, and exception handling. JDK8 is a version of Java with new features.

  • Java is an object-oriented programming language

  • JDK8 introduced features like lambda expressions and streams

  • Exceptions are used to handle errors and unexpected events

  • List, Set, and Map are data structures in Java

  • Spring Boot is a framework for building web applications

2w ago

Q. What is the most important aspect of coding as a developer?

Ans.

Understanding the problem and writing clean, efficient, and maintainable code are important for coding as a developer.

  • Understanding the problem and requirements

  • Writing clean and efficient code

  • Maintaining code quality and readability

  • Testing and debugging

  • Continuous learning and improvement

  • Collaboration and communication with team members

Asked in Capgemini

2w ago

Q. Write a trigger on account to display child contacts Write a inline lightning component anything

Ans.

Trigger to display child contacts on account and inline lightning component

  • Create a trigger on Account object

  • Query for child Contact records related to the Account

  • Display the Contact records in a related list on the Account page layout

  • Create an inline lightning component to display additional information on the Account page

2w ago

Q. Write a trigger on the Account object that inserts two contacts when an account is created.

Ans.

Write a trigger on account object to insert 2 contacts when account is created.

  • Create a trigger on Account object

  • Use 'after insert' trigger event

  • Create 2 Contact records and assign Account Id to them

  • Insert the Contact records

4d ago

Q. What is Salesforce What is object and field Different between relationships What is owd What is profile and role What are the events in trigger Types of flows Actions in look up relationship and mater relations...

read more
Ans.

Salesforce is a cloud-based CRM platform that helps businesses manage customer interactions and automate sales processes.

  • Objects are database tables that store data in Salesforce

  • Fields are columns in the database tables that store specific types of data

  • Relationships define how objects are related to each other in the database

  • OWD (Organization-Wide Default) settings determine the default level of access to records for users in an organization

  • Profiles and roles control access t...read more

Asked in Cloud Q

1w ago

Q. What is the Singleton Pattern in Apex, and how is it implemented?

Ans.

Singleton Pattern ensures a class has only one instance and provides a global point of access to it.

  • Singleton Pattern is implemented by creating a private constructor, a static variable to hold the instance, and a static method to return the instance.

  • The static method checks if the instance is null, creates a new instance if it is, and returns the existing instance if not.

  • Example: public class SingletonExample { private static SingletonExample instance; private SingletonExamp...read more

Asked in Cloud Q

1w ago

Q. Was Apex a loosely typed programming language or a strongly typed programming language?

Ans.

Apex is a strongly typed programming language.

  • Apex is a strongly typed language, meaning variables must be declared with a specific data type.

  • Data types in Apex include primitives like Integer, String, Boolean, as well as custom objects and collections.

  • Strong typing helps catch errors at compile time rather than runtime, improving code reliability and performance.

Asked in Cognizant

2w ago

Q. How do you call a child component from a parent component 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

1w ago

Q. How can the create date be changed while uploading a 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

Asked in TCS

4d ago

Q. Given a set of objects, such as Case and Account related with a lookup, how would you find the number of cases associated with a specific account using best practices?

Ans.

Count the number of cases related to an account using SOQL and best practices in Salesforce.

  • Use SOQL to query the Case object with a WHERE clause filtering by the AccountId.

  • Example: SELECT COUNT() FROM Case WHERE AccountId = '001XXXXXXXXXXXX'

  • Consider using aggregate functions for efficiency.

  • Ensure proper indexing on the AccountId field for faster query performance.

  • Use a trigger or process builder if you need real-time updates on case counts.

2w ago

Q. How do you overload a constructor in Python?

Ans.

Overloading constructor in Python allows creating multiple constructors with different parameters.

  • Define multiple constructors with different parameters

  • Use default values for optional parameters

  • Call the appropriate constructor based on the number and type of arguments passed

Previous
1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits