CompanyTechAim
Focus AreaSalesforce Developer
Questions11+
Topics5
TechAim – Salesforce Developer Interview Questions
What's Covered
Topics covered in this interview.
01Lightning Web Components2
02SOQL & Data1
03Apex & Triggers3
04Salesforce Core Concepts2
05General & Experience3
All Interview Questions
Every question asked in this interview, listed one by one.
1Explain LWC Decorators.
2Why we use AuraEnabled in apex?
3How many records we can retrieve from soql query?
4What are Asynchronous methods explain?
5What is use of finish method in batch apex?
6How you can handle exception in future method
7Explain Role, Profile and Permission set?
8What is required configuration for api integration?
9You have one account and if you are inserting new contact and that account has already associated with the contact then you need to throw an error?
10Tell me about types of reports and dashboard?
11What is difference between authorization and authentication?
Preparing for a Salesforce developer interview?
Browse more real company interview experiences and hands-on Apex trigger patterns.
Quick answers to key questions
- LWC decorators.
@apimakes a property or method public so a parent component can use it.@trackmakes changes inside objects and arrays reactive (simple fields are reactive by default in current versions).@wireconnects a property or function to a data source such as Apex or the Lightning Data Service. - Why AuraEnabled? It exposes an Apex method to Lightning components. Use
cacheable=truefor read-only methods used with@wire. - How many records can a SOQL query return? A transaction can retrieve up to 50,000 records in total across all its SOQL queries. A batch Apex query locator can go up to 50 million records.
- Asynchronous Apex. Future methods, queueable Apex, batch Apex and scheduled Apex. They run in the background, with higher limits than synchronous code.
- Use of the finish method in batch Apex. It runs once after all batches are done. Use it for post-processing, such as sending a summary email or starting another batch job.
- Exception handling in a future method. A future method returns nothing, and the caller cannot catch its errors. Use try and catch inside the method and log the error in a custom object or send an email.
- Role, profile and permission set. A role decides which records a user can see through the hierarchy. A profile sets the base object, field and system permissions. A permission set adds extra permissions to a user.
- Configuration for API integration. Enable API access for the integration user, create a Connected App for OAuth, store the endpoint and credentials in a Named Credential, and give the integration user only the permissions it needs. Check IP restrictions and the authentication flow as well.
- Types of reports and dashboards. Reports can be tabular, summary, matrix or joined. Dashboards show charts, gauges, metrics and tables built from reports.
- Authentication and authorization. Authentication proves who you are, for example with a username, password and MFA. Authorization decides what you are allowed to do after you are logged in.
Throw an error if the Account already has a Contact
trigger ContactTrigger on Contact (before insert) {
Set<Id> accountIds = new Set<Id>();
for (Contact c : Trigger.new) {
if (c.AccountId != null) accountIds.add(c.AccountId);
}
Set<Id> accountsWithContact = new Set<Id>();
for (Contact existing : [SELECT AccountId FROM Contact WHERE AccountId IN :accountIds]) {
accountsWithContact.add(existing.AccountId);
}
for (Contact c : Trigger.new) {
if (c.AccountId != null && accountsWithContact.contains(c.AccountId)) {
c.addError('This Account already has a Contact.');
}
}
}If more than one new Contact for the same Account is inserted in one batch, add a check that also tracks the Accounts seen in the current batch.