Salesforce interview Questions Latest
Salesforce interview Questions
In this post, I have collected all the Salesforce interview Questions which were asked to me in Salesforce interview for 2-3 years of experience. I have compiled these questions to the best of my knowledge.
The answer provided here are answered to the best of my knowledge and they can be wrong, so kindly refer Apex developer guide and visualforce guide and other means to verify the answers.
If you think any answer is incorrect then do mention the same in the comments.
Here goes the list of Salesforce Interview Questions
Q 1. Which of the below can’t be used in Apex DML Operation?
- a) trigger.old
- b) trigger.new
- c) trigger.new and trigger.old
- d) None of the above
Q2.When considering trigger context variables, which of the statement is true?
- a) We can delete trigger.new
- b) We cannot delete trigger. new
- c) trigger.new is always ready only
- d) trigger.new is ready only, so we can delete
- e) None of the statement is true
3. In Apex, if you want to make something public, you need to use the PUBLIC access modifier.
4. On deletion of parent record, the child record should not getddeleted, which relationship will satisfy this requirement?
- a) Lookup
- b) Master-Detail
- c) Many to Many
- d) Master to Master
- e) Both b & c
Q.5. Product manager at XYZ company is required to help their sales team in selling certain products, but product manager does not have access to the opportunities and his involvement is required in assisting the deal. How will a salesforce admin resolve this scenario?
- a) Notify the product manager using opportunity update reminders
- b) Enable opportunity teams and allow users to add the product manager.
- c) Use similar opportunities to show opportunities related to the product manager.
- d) Enable account teams and allow users to add the product manager.
Q.6. When would a developer use upsert and external IDs? (There are two correct answers.)
- a)To integrate with an external system.
- b) To migrate customizations from sandbox to production.
- c) To load related records without knowing Salesforce record IDs.
- d) To use the Web Services API to query for data.
Q7. Considering child to parent relationship, you can traverse —
- a) up to five levels
- b) up to one level only
- c) up to three levels
- d) up to four levels
- e) All of the above statements are true
Q.8. Which of the Data format and communication is supported by REST API?
- a) XML and Synchronous
- b) JSON, XML and Asynchronous
- c) JSON, XML and Synchronous
- d) JSON and Synchronous
- e) None of the above
9. Which of the authorizations are supported by SOAP API ?
- a) Session ID
- b) Oath 2.0
- c) Both Oath 2.0 and Session ID
- d) None of the above
Q.10. Write a SOQL query to find the Ids and Cust__c of the Object CustObj__c. CustF__c field should contain either of the below values —
*AAA and BBB selected or *CCC selected
Select id, Cust__c from CustObj__c where CustF__c includes(‘AAA;BBB’,’CCC’)
*CCC selected
Select id, Cust__c from CustObj__c where CustF__c includes(‘CCC’)
Q.11. Write an SOQL query which returns account IDs for all Accounts that do not have any open Opportunities?
select id from account where id in (select accountid from opportunity where stagename in (‘Closed Won’, ‘Closed lost’))
Q.12. Which of the below SOQL query is true?
- a) Select Account.Narne , (Select Note.Body From Account.Notes ) From Account
- h) Select Account.Name , (Select Note.Body From Account.Notes where Note.Body LIKE `D%’) From Account
Q.13. Which one is a valid exception handling block in Apex?
a) try { code block }
catch (exceptionType)
{ code_block }
finally code block
b) try { code block }
catch (exceptionType)
code block
}
c)try { code block }
catch (exceptionType) {
code block }
catch (Exception e){ }
d) All of the above.
e) None of the above.
Q.14. Class annotated with isTest must be declared as?
a)Private
b)Public
c)Global
d)Private and Public both
e) None of the above
Q.15. Which statement is False regarding the isTest annotation
- a) Classes defined as isTest must be declared as Private.
- b) Classes defined as isTest do not count against organizations limits for Apex scripts.
- c) Classes defined as isTest cannot be called from another class or trigger.
- d) Classes defined as isTest can only contain methods declared as test methods.
- e) None of the above
Q.16. Which triggers are invoked when two contacts are Merged?
- a) Only delete and update contact triggers
- b) Only delete and update triggers on the parent account
- c) No triggers
- d) Delete and update contact triggers and triggers on the parent account
- e) None of the above
Q.17. In Salesforce which fields are indexed automatically?
- a) Primary keys
- b) External lds
- c) Audit dates (such as last modified date)
- d) Only External ids and audit dates
- e) All of the above
Q.18. Given the controller code what is the expected output?
<apex:page controller=”the controller”>
{lout}
<apex: page>
public class theController
{
public string out{
get {
if(out== null) out = ‘getter’;
return out ;
}
set;
public theController()
{
Out= ‘constructor’;
}
public void setout
{ out = ‘action’; }
}
- a) null
- b) action
- c) constructor
- d) getter.
Q.19. Which among these is a valid SOQL to query all records in an organization, including delete and archived activities?
- a) SELECT count() FROM contact WHERE accountid = a.id QUERY ALL.
- b) SELECT count() FROM contact WHERE accountid = a.id INCLUDE ALL.
- c) SELECT count() FROM contact WHERE accountid = a.id ALL ROWS.
- d) None of the above.
Q.20. How can permission sets be used?
- a) To assign unique login hours for specific users
- b) To assign access to a custom object for specific users
- c) To assign access to a custom field for specific users
- d) Only b & c
- e) All of the above
Q.21. Customer wants to add a custom validation process to the contact save process. Before the record is created and saved to the database, the customer wants run a validation, which will checks if the associated account is active or not, this validation should be active for all UI as well as integration requests. Which design accomplish this
- a) A custom Web service
- b) A before insert trigger
- c) A custom Visualforce controller
- d) A client-side 5-control
Q.22. What types of element do list contains.
- a) Integer
- b) String
- c) Object
- d) Integer and string
- e) All of the above
Q.23. Which of the following code segments show a correct way of accessing data with Standard List Controllers?
- <apex:page standardController=”Account” recordSetVar—“accounts” >
<apex:pageBlock >
<apex:pageBlockTable value=”{!accounts}” var=”a”>
<apex:column value=”{!a.name}”/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>.
- <apex:page standardController=”Account” var=”accounts” >
<apex:pageBlock >
<apex:pageBlockTable value=”{!accounts}” var=”a”>
<apex:column value=”{!a.name}”/>
</apex:pageB1ockTabie>
</apex:pageBlock>
</apex:page>
- <apex:page standardListController=”Account” recordSetVar=”accounts” >
<apex:pageBlock >
<apex:pageBlockTable value=”{!accounts}” var=”a”>
<apex:column value=”f!a.namer>
</apex:pageBlockTable>
<apex:pageBlock>
<apex:page>
- <apex:page standardListController=” Account” var=”accounts” >
<apex:pageBlock >
<apex:pageBlockTable value=”{laccounts}” var=”a”>
<apex:column value=”a.name}”/>
</apex: pageBlockTable>
</apex:pageBlock>
</apex:page>.
Q.24. Which among these is a valid constructor for standard controller extension on Account?
- a) public myControllerExtension(ApexPages.Controller stdController){
this.acct= ( Account)stdController.getRecord();
}
- b) public myControllerExtension(ApexPages.StandardSetController stdController){
this.acct = (Account)stdController.getRecord();
- c) public myControllerExtension(ApexPages.StandardController stdController) {
this.acct = (Account)stdController.getRecord();
- d) None of the above.
Its really nice
Thank you for sharing great listing salesforce interview question and answer. i am looking for job change in salesforce
[…] are broadly four types of field: Salesforce interview Questions Latest – SalesforceNextGen. In this post, I have collected all the Salesforce interview Questions which were asked to me in […]
Hey Mr Datta,
Hope you are doing well?
I have a suggestion or you can say I have a need.
Could you please post “Apex Governor Limits” in a good | Clarify | Simple words.
I hope I will get it soon here.
Thanks
Hi
Thanks for reaching out.
I will try to simplify the Governor Limit and provide a post for the same
Regards