In general, writing code is an essential part of making enhancements to any software, product, or business process. But when it comes to Salesforce development, programmers are not necessarily required for business success.
This is possible because Salesforce provides a wide range of utilities, including drag-and-drop tools for seamless integration with your database, point-and-click tools to create custom user interfaces (UIs), and business logic engines with advanced automation capabilities. Some organizations can create advanced custom applications inside the Salesforce ecosystem without writing a single line of code. This out-of-the-box toolkit can work for a wide variety of functionality and business requirements, including customer relationship management (CRM), customer satisfaction, workflow automation, and custom sales and marketing solutions. There are also a variety of third-party applications available on Salesforce’s AppExchange. But for more complex custom business applications, a Salesforce engineer or a development team might be needed to meet your business needs. This is when coding comes into play and when you’ll need to hire a dedicated developer to help with your Salesforce integration.
If you do need to hire Salesforce developers, you should seek someone who is not only fluent with SQL and Salesforce’s drag-and-drop tools, but a certified developer who has hands-on experience with specialized skills, such as Aura, Apex, Heroku, and SOQL, Salesforce’s custom query and programming language. You might also seek someone with experience in Salesforce Lightning Web Components (LWC), Salesforce CPQ, Salesforce Sales Cloud, Salesforce Service Cloud, and Salesforce Marketing Cloud, as well as integrating custom objects and third-party systems. For any Salesforce developer, a background in software development is invaluable, as Apex is very similar to Java, while JavaScript is used for LWC, Visualforce, and Aura.
Because Salesforce continues to be the top CRM provider worldwide, dedicated Salesforce developers are always in high demand. This guide describes some of the most important interview questions to ask a potential Salesforce developer during the hiring process. These queries can serve as springboards for detailed discussions that will help identify exceptional talent in potential developers.
How to Write a Job Description for a Salesforce Developer
To attract qualified developers for your Salesforce project, you’ll first need to create a comprehensive job description. Clearly state the experience required. While finding a certified Salesforce developer might be ideal, specifying a range, such as “3-5 years of experience,” can help attract candidates with a more relevant background. However, certifications are important because they validate the candidate’s expertise and provide a benchmark for the skill level you can expect. Relevant Salesforce certifications include Salesforce Certified Administrator, Salesforce Certified Platform App Builder, or Salesforce Certified Platform Developer I and II.
In addition to technical requirements, provide more details about the position and your organization in the job description. Mention if you are looking for an on-site, hybrid, or remote Salesforce developer. For remote teams, establishing preferred time zones will ensure smoother collaboration and effective real-time communication. Discuss your approach to project management and the tools that your team uses. Finally, emphasize what makes your company unique, whether it’s an innovative startup culture, comprehensive onboarding processes, or opportunities for professional growth. A detailed job description will not only attract the best Salesforce developers, it also sets clear expectations, which will enable a more efficient hiring process.
The Most Important Salesforce Developer Interview Questions and Sample Answers
Once candidates begin to respond to your job posting, the interview process can begin. The following questions serve as good starting points for discussions that can provide insight into the technical knowledge of the candidates, as well as their complementary skill sets, such as their ability to solve problems. A candidate’s Github and LinkedIn pages can also provide valuable information about their background and skills.
Name the available collection types in Apex, and discuss their limits and characteristics.
In Salesforce, Apex supports three different collection types: Lists, Maps, and Sets.
Lists are ordered collections of elements that are distinguished by their indices. Lists should be used when you want to identify an element by its index. It’s also important to note that lists can contain duplicates.
Maps are collections of key-value pairs, where each unique key maps to a single value. A key can be any primitive data type, and value can be a primitive, sObject, collection type, or an Apex object.
Sets are unordered collections of elements that do not contain any duplicates (in contrast to lists, as noted above).
The type of developer you should hire depends on what you’re trying to accomplish and the characteristics of each collection type described above. An experienced developer may also mention that removing items from a set is more straightforward than removing an item from a list. When you remove an item from a list, the index will shift left.
There is no inherent limit on the number of items a collection can hold, although there is an implicit limit based on the heap size. Due to the multi-tenant nature of the environment, Salesforce maintains a table with all the limits. Salesforce occasionally revises these limits and adjusts the execution capabilities. A high-quality candidate should be able to explain all of this.
Discuss the transaction control limitations in Apex.
Salesforce is a multi-tenant environment, which essentially means that all resources are shared among its users. To maintain system performance and availability, the platform enforces process limits.
All experienced Salesforce developers should be well versed in effective usage of these limits, because they affect how a solution should be engineered and coded. Here are the most relevant limitations regarding transaction control.
- Static variables are not reverted during a rollback.
- The ID on an sObject inserted after setting a savepoint is not cleared after a rollback.
- Each rollback or savepoint you set counts against the governor limit for the DML statements.
- References to savepoints cannot cross trigger invocations because each trigger invocation is a new trigger context.
- If you set more than one savepoint, then roll back to a savepoint that is not the last savepoint you generated, the later savepoint variables become invalid.
What is the time limit for synchronous Apex requests? Discuss the strategies that can be used to avoid hitting the limit.
A synchronous Apex request that is running for more than five seconds is considered to be long-running. To avoid reaching this limit, it’s recommended to use any of the following strategies.
- Tune SOQL and DML operations, making sure queries are selective.
- Check if Batch Apex is a possible alternative to convert synchronous processes into asynchronous processes.
- Try to limit calls to synchronous web services.
These are standard solutions Salesforce developer candidates should know to look out for when reaching limits. Limits are at the very core of Salesforce development, and understanding them is an essential part of the app development process. A skilled Salesforce engineer will know that when you get errors mentioning limits, you should tweak your code to streamline, or break your solution into chunks that will stay within enforced limits.
What is the main difference between a global and a public class in Apex?
Global classes are visible in any application or namespace, while public classes are only visible within a specific application or namespace.
All classes using the public access modifier will be accessible only within your own application or namespace.
public class MyClass {
// Methods accessible only within your application
}
Classes using the global access modifier are accessible by Apex everywhere. An example would be a class that allows an external application to invoke an Apex Web service to perform an action in your Salesforce application.
global class MyWebService {
// Methods accessible by Apex everywhere, e.g.: the SOAP API
}
Explain how to write an Apex class that will take into consideration the sharing rules for the current user.
By default, Apex code runs in the system context, with access to all objects and fields object permissions. If you need to write a class that will take the current user sharing rules into consideration, you need to declare it with the with sharing
keywords. This class will be executed with access in the system context, with access to all objects and fields.
public without sharing class MyNoSharingRuleClass {
// Code here will NOT enforce the current user sharing rules
}
This class will enforce the sharing rules of the current user.
public with sharing class MySharingRuleClass {
// Code here WILL enforce the current user sharing rules
}
When a class is declared without these access modifiers, the current sharing rules are used. By default, the class will not enforce sharing rules except if the sharing rules are acquired from a calling class.
Explain what Apex Unit Tests are and discuss the deploy requirements for Apex code.
The Salesforce CRM platform uses Apex Unit Tests, which are class methods that check if a piece of code is working properly. Note that the unit test methods take no arguments, commit no data to the database, and send no emails.
Test methods must be defined in test classes that are annotated with @IsTest
.
An experienced candidate will know that to deploy Apex code, Salesforce requires that all of the following criteria are satisfied:
- At least 75% of your Apex code must be covered by unit tests, and all of these tests must be completed successfully.
- Every trigger must have some test coverage.
- All classes and triggers must compile successfully.
Here is an example of a basic structure of a test class.
@isTest
private class MyCustomObjectTestClass {
static testMethod void runPositiveTestCases() {
// Run your positive tests here
System.debug('Positive validation test...');
}
static testMethod void runNegativeTestCases() {
// Run your negative tests here
System.debug('Negative validation test...');
}
}
Explain how to access archived and deleted records by using the SOQL statement.
On the Salesforce platform, a deleted record is not actually deleted. Instead, it is moved to a recycle bin. Every Salesforce user has access to the recycle bin, which is conceptually similar to the recycle bin in Windows or macOS. The same goes for archiving.
Therefore, if a developer building a query wants to include the deleted and archived records in its result set, they can use the ALL ROWS
keywords in the SOQL statement. Here’s an example.
SELECT COUNT() FROM Contact WHERE AccountId = a.Id ALL ROWS
Explain how to assure a process can update records, without the risk of other processes or users simultaneously updating the same records.
SOQL supports the FOR UPDATE
keywords.
When included in the SOQL statement, the keywords guarantee that no other process or user will be able to update the records concurrently. After the transaction handling the records is completed, the lock is released.
Consider the following snippet of code, and explain what, if anything, is wrong with it.
List<Opportunity> opportunityList = [SELECT Id, Name, StageName FROM Opportunity WHERE StageName = 'Qualification'];
The preceding code fetches all the opportunities in the Qualification
stage. While the code snippet is correct, we are using the string literal directly, without a constant or a configuration.
This coding practice could become a source of problems because there may be other classes using the same approach.
For example, if we assume that we want to change the stage name from Qualification
to Pending Review
, this would take a certain amount of work to perform an impact analysis and incorporate the changes in the code.
A qualified candidate can explain that this situation could have been avoided with a constant or a configuration approach, and our query should look something like this, assuming we have created a constant.
public static final String STAGE_NAME = 'Qualification';
The final query will be:
List<Opportunity> opportunityList = [SELECT Id, Name, StageName FROM Opportunity WHERE StageName = STAGE_NAME];
Consider the following snippet of code and explain why it generates a compilation error.
global class FutureRecordProcessing
{
@future
public static void processRecords(List<MyObject__c> myObjectList)
{
// Process records
}
}
In Apex, @future
annotated methods cannot get sObjects as arguments, because the sObject might change between the time you call the method and the time it actually executes. In this particular scenario, a list of sObjects IDs should be used instead to perform a query for the most up-to-date records.
Here is an example of a future method properly querying the objects from a list of IDs:
global class FutureRecordProcessing
{
@future
public static void processRecords(List<ID> recordIds)
{
// Query records
List<MyObject__c> myObjects = [SELECT Name FROM MyObject__c WHERE Id IN :recordIds];
// Process records
}
}
Take the Time to Find a Top Salesforce Developer
The questions we covered in this article should be trivial for experienced Salesforce professionals; and therefore, should help you distinguish inexperienced software engineers, who use only drag-and-drop tools, from Salesforce experts, who have a solid skill set and a deep understanding of both SOQL and Apex. The most talented developers will be adept at application development, implementing Salesforce solutions with efficiency, scalability, reliability, and a smooth customer experience in mind.
Depending on your business goals, taking the time to find candidates with solid technical skills and extensive experience for your Salesforce implementation is well worth the effort. If your project requirements include custom solutions, hiring part- or full-time Salesforce developers will undoubtedly have a significant impact on your team’s business productivity, business efficiency, and bottom line.