As you all know, Salesforce is one of the hottest technologies in the market and has tremendous requirements for qualified resources. However, since the technology is still catching up, the supply of requirements is at a much weaker side compared to the demand.
The technical gurus of Salesforce, would definitely crack the toughest interviews in the market. However, the newbies who are looking to polish up their technical skills in cracking the interviews in Salesforce will need a helping hand. So, I will post a couple of questions here that would be asked in most of the technical interviews. Of course, the interviewer can build up an ad-hoc scenario and shoot it to you while you are in the hot seat. Even then, the below set of questions should help you sail easily through the brain storming session of interview.
- What are the actions that can be performed in Workflow rules ?
- Given a business requirement, wherein you have to execute all the available actions in a single workflow rule, what would be the sequence of actions ?
- There is a simple SOQL query ‘Select Id, Name from Opportunity’ which fetches millions of records without any selection criterion. How do we optimize the performance of this simple query without using any selection criterion ?
- Suppose there are 2 Account records with 3 contacts associated against each Account record. What would be the end result, if I merge these two Account records ?
- List 3 Governor limits in Apex.
- How can two components who are not related to each other, interact with each other in lightning ?
- Is it possible to invoke an addError() operation on the Trigger.Old list in a delete operation in Trigger ?
- What should be done to override the governor limit that restricts you from fetching more than 50,000 records in a SOQL query ?
- There is a master-detail relationship between two objects and I want to ensure that the master object should not have more than 10 child records. How can we achieve this without using a trigger ?
- What are skinny tables ? What are they used for ?
- What is the use of @testsetup annotation in a test class ?
- How can a test class access the private members of another class ?
- How can we refresh/reset the governor limits within a test class ?
- What are lightning events ? Where do you use them ?
- Can we call a batch apex program in apex trigger ?
- I want to ensure that once a child record has been added to a master-detail relationship, it cannot be deleted. How can we achieve this using the declarative capability of the platform ?
- In a particular object, I have given only read access to a certain field named as ‘Site__c’ to all users in the organization. However, if I have marked ‘Site__c’ as a required field in the page layout for that object. So, what will happen when a user saves the record in that object through that page layout ?
- What are the different types of attributes that can be added to a lightning component ?
- What is the difference between application level events and component level events in lightning ?
- What is the difference between pageblocktable and datatable in VF pages ?
- What is the use of the ‘transient’ keyword ?
- How can we set-up recurring time-based workflow actions in the platform ?
- Explain the different scenarios wherein you need to use different types of collections i.e List, Set and Map.
- What would happen if I perform a DML update operation on the before update trigger of the same sObject record ?
- What is the use of the <aura:method> tag in Lightning ?
- How do you create RESTful web services using apex ?
- How do you implement Aggregate functions in apex ?
- What is the difference between custom objects, custom settings and custom meta data ?
- What is the use of communities in Salesforce ?
- List the important methods in List, Set and Map
- What are future methods and where are they used ?
- What is the difference between the normal “insert” operation and “Database.insert” operation ? Which is preferred over the other and why ?
- How do you implement the locking functionality of records in apex ?
- What is the difference between SOQL and SOSL query ?
- How do you implement SOAP web services in apex ?
- What are the different context variables available in apex triggers ?
- What are dynamic SOQL queries and how do you prevent SOQL injection in dynamic SOQL queries ?
- What is apex managed sharing ?
- What is the difference between approval process and workflow rules ?
- When do we need to use Javascript remoting and how is it implemented ?
- How can you setup governor limit email warnings in apex ?
- What is Lightning connect ?
- What are the different types of reports in Salesforce ?
- What is analytic snapshot ?
- What is the use of the Database class in apex ?
- What are the most important points to be considered while bulkifying a trigger ?
- How can we schedule apex programs ?
- What is the use of apex email services ?
- What is the use of the invocable method annotation ?
- What is the return type of SOSL queries ?
Please feel free to comment if you need answers to any of the questions above.
Hi Akhil,
This is an excellent post, i faced few questions from the above list in my recent interviews, This would be great if you provide answers to all of them.
Thanks,
Anil
LikeLiked by 1 person
Hello can I get the answers for these
LikeLike
Hi Anil and Praneeth,
Many of the questions listed above are theoretical ones. So, please understand that providing answers to each one of them would be a tedious task. Rather than that you can ask me if you need answers to some specific questions and I will reply here.
The answers to the theoretical questions can also be found on the salesforce help.
LikeLike
Hi Akhil please answer Question no.2.
LikeLike
Hi Bina,
The sequence of workflow actions when executed against a single rule is as below
1. Field Update
2. Action Task
3. Email Alert
4. Outbound Message
LikeLike
Hi,
Please provide and for imp qns.
LikeLike
Thanks Akhil. This post is really helpful.
LikeLiked by 1 person
Hi Akhil,
Thanks for the wonderful post.
Could you please answer- 3,9,16 and 17?
LikeLiked by 1 person
Hi Manish,
Below are the answers for the same.
3. We need to use skinny tables in such scenarios wherein we need to fetch a limited set of fields without using any selection criterion for a huge set of records. Refer the link below for more details.
https://developer.salesforce.com/blogs/engineering/2013/03/long-and-short-term-approaches-for-tuning-force-com-performance.html
9. You can setup a validation rule on the roll-up summary field of the master object which restricts the roll-up summary(COUNT OF CHILD RECORDS) field to have a value greater than 10.
16. Use a validation rule on the roll-up summary field of the master object that will restrict it to have a value lesser than the previous value (Hint: Use formulas to compare the current value with the previous value).
17. The record will be saved without throwing any errors. Field-level security at the profile level always have a higher precedence over the Field-level security you set on the page-layout settings. You can try this scenario by yourself.
LikeLike
Hi Akhil,
for 17 question, ultimately the site__C field is readonly eventhouth it is marked as required in pagelayout bz it is readonly in FLS. right ?
(if a field is required in the page layout and read only in the field-level security settings, the field-level security overrides the page layout and the field will be read only for the user.)
Thanks,
kiran.
LikeLiked by 1 person
I find it a little hard to believe that some of those are actually interview questions.
As for #2, the answer rather appears to be:
“The order in which individual actions and types of actions are executed is not guaranteed. However, field update actions are executed first, followed by other actions.”
See: https://help.salesforce.com/apex/HTViewHelpDoc?id=workflow_rules_considerations.htm
Fwiw, if someone expected this type of knowledge to be on the tip of my tongue, I’d also expect them to be a terrible employer.
LikeLike
Hi tobibeer,
You are correct on saying that Salesforce doesn’t mention anywhere that the order of actions is as mentioned in my answer. However, I have posted that order based on what I found in a real-time scenario.
LikeLike
Hi Akhil,
Can u pls answer for 7,22 ,33,37 questions ?
Thanks,
Kiran.
LikeLike
Hi Akhil,
Thanks for the information.
can u pls answer for 7 ,22, 33,37
Thanks,
Kiran.
LikeLike
Hi Kiran,
Below are the answers
7. Yes, you can invoke addError() method on Trigger.old list
22. This can be achieved by setting up multiple workflows chained to each other.
33. You can lock records by using the “UPDATE” keyword. eg: SELECT Id FROM Account LIMIT 2 FOR UPDATE
37. The following link explains how to achieve this. https://developer.salesforce.com/page/Secure_Coding_SQL_Injection
LikeLike
hello sir.I need answer for those questions.
LikeLike
Hi sir. I need answers for 50 questions.
LikeLike
Hi akhil, how to post my questions I faced in interview ?so helpful to others..
LikeLike
I mean in ur blog
LikeLike