Salesforce Interview Questions Sample 4

1)Best Practices for Apex, VF pages to avoid governor limits
Ans:
a. Do not write your SOQL or DML in for loop, if we write it will go on loop and may hit the governor limits
b. Avoid hard coding id's
c. Use Transient Variable or static variable to avoid view state error in VF pages
d. Use @future annotation(these methods that are executed asynchronously)
e. Use collections(List, set and Map)
f. Use Custom settings(List, Heirachy)
g. Good to bulkify your code
h. Use batch apex
i. Good to write your code in seperate class and call it from test class

2) Define render, re-rendered and renderas in VF pages
Ans:

Render: Use to check conditions
Re-rendered:If you want to refresh a specific page you can use this keyword
Renderas: Used to generate page in PDF

3) How do you restrict access to any user in salesforce?
Ans: This can be done via OWD, define as Private and then if want to open up access use either one of these like Role Heirachy, Sharing rules, Manual sharin.

4) What is an AppExchange
Ans: App Exchange is an application where you can download various packages, its a store where you can find your needed software.
It offers both free and paid apps, as per the need we can get the software and install it in our org.

5) Different types of API's?
Bulk API: This API is used to load huge files.
Its an asynchronous API

Rest API: Supports both JSON and XML
Its light weight
Can be used for Web Applications and Mobile applications
Rest doesnt need much bandwidth when request are sent to the server.

SOAP API: Supports only XML
Its heavy weight
SOAP requires more bandwidth for its usage. Since SOAP Messages contain a lot of information inside of it, the amount of data transfer using SOAP is generally a lot.

6) Can we convert formula field into any other data type ?
Ans: No, Formula fields are special read-only fields that cannot be converted to any other data type. Likewise, you cannot convert any other field type into a formula field.

7) how to check how many times execute method executed in Batch class ?
Ans: Use Database.stateful

1 comment:


  1. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this salesforce cpq training
    learn cpq salesforce

    ReplyDelete