Salesforce Developer
500+ Salesforce Developer Interview Questions and Answers

Asked in NTT Data

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"?
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

Asked in Cloud SynApps

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 moreTrigger 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

Q. How to invoke flows - using other flows and Apex. How do we invoke an apex class from a flow and pass variables?
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

Asked in Virtusa Consulting Services

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?
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

Asked in Deloitte

Q. How do you fetch data into a table using Apex?
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
Asked in Merfantz Technologies

Q. How do you call Apex code using Process Builder?
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




Asked in Capgemini

Q. What are triggers and what are their uses?
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

Q. What can do for run apex class ? what is get precaution ?
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 🌟

Asked in Nagarro

Q. What happens if we don't provide values for required fields when inserting data using insert or database.insert in Salesforce?
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

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?
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

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?
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

Asked in Persistent Systems

Q. How does the wire method work? While importing data, how can you add a record inside the wire method in a JavaScript file?
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

Q. What is the use of the @track decorator? Is it mandatory to explicitly use it, and if so, for which use case?
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
Asked in Lot Technologies

Q. * Sharing and without sharing difference * Difference between "null" and "isbllank" * Challenging scenario in my previous role.
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

Q. What are the methods of the Batchable Interface?
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.
Asked in Parim Infocomm

Q. What is power electronics, what is the architecture of the ic2716
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

Q. What is Queueable Apex in Salesforce?
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 moreTo 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.

Asked in Tech Mahindra

Q. With Read and Write permissions on an object, what could prevent a user from seeing all records?
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

Q. What is java & features,jdk8,exceptions & types,list ,set & map, spring boot artitecture.
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

Asked in Pegasus Technologies

Q. What is the most important aspect of coding as a developer?
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

Q. Write a trigger on account to display child contacts Write a inline lightning component anything
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

Asked in Ksolves India Limited

Q. Write a trigger on the Account object that inserts two contacts when an account is created.
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

Asked in Rudhra Info Solutions

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 moreSalesforce 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

Q. What is the Singleton Pattern in Apex, and how is it implemented?
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

Q. Was Apex a loosely typed programming language or a strongly typed programming language?
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

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

Asked in Persistent Systems

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

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

Asked in Cloud Analogy

Q. How do you overload a constructor in Python?
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
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Salesforce Developer Related Skills

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


Reviews
Interviews
Salaries
Users

