Friday, 5 December 2014

salesforce interview questions


Question:  State some best practices to be followed for Apex Programming.

Answer :

 Test your Triggers against bulk records. Your Apex Triggers should always work well for a

single record as well as bulk insert/updation.

 Do not have SOQL queries inside a for loop.

 Do not HARDCODE ID's inside your Apex Class

 Use the LIMITS System Class to avoid hitting governor limits by checking whether you have hit

a limit.

Question: How will you find the distinct values of a particular field in a SObject?

Answer : By using the GROUP BY Clause in an SOQL Query. For ex:

[Select Status from Case GROUP BY Status] - This will give all the distinct values for the Status field.


1.What is the difference between map and set in Salesforce collections.


A map is a collection of key-value pairs where each unique key maps to a single value. Keys can be any

primitive data type, while values can be a primitive, sObject, collection type or an Apex object. For

example, the following table represents a map of countries and currencies:

Country (Key) 'United States' 'Japan' 'France' 'England' 'India'

Currency (Value) 'Dollar' 'Yen' 'Euro' 'Pound' 'Rupee'

Similar to lists, map values can contain any collection, and can be nested within one another. For

example, you can have a map of Integers to maps, which, in turn, map Strings to lists. A map can only

contain up to five levels of nested collections inside it.


A set is an unordered collection of primitives or sObjects that do not contain any duplicate elements. For

example, the following table represents a set of String, that uses city names:

'San Francisco' 'New York' 'Paris' 'Tokyo' To declare a set, use the Set keyword followed by the primitive

data type name within <> characters. For example:

2. Why Use Triggers?

Triggers are used to perform immediate actions based on previous action e.g. field update. An apex

language is used to write triggers

Eg: Account merges

3. What are different types of Triggers?

There are two types of triggers

a) Before trigger- is used before database operation

b) After trigger-is used to access field values that are set by the database (such as a record's Id or

lastUpdated field), and to affect changes in other records, such as logging into an audit table or firing

asynchronous events with a queue.

4. Why Use Visual Force?

Visual force is a Sales force UI markup language using visual force we can construct WebPages. In Sales

force MVC architecture Visual force represents View.

5. How do you handle errors?

Error handing is done directly displaying in Visual force page using Apex Pages methods to end users or

displaying in debug logs.

6. What is a Component?

In sales force component is a reusable piece of code developed using Visual force and Apex controller.

7.Tell me about a project with Salesforce in which you led the architecture that was not explicitly limited

to the Salesforce infrastructure.

8.How long ago did you work on the above mentioned project?

9.Tell me about inner-department communications and your approach to communicating with non-

technical team members.

10.What measures have you taken to make your software products more easily maintainable?

11.What development processes have you used in your recent projects? Were any tools used to support

these processes? If so can you name some of the advantages and short comings of the tool/ tools?

12.What is an junction object?.

13.What is the difference between master detail relationship and look up relationship. ?

14.How will you handle 10001 SOQL problem in apex?

15. Define and

16.Explain some examples for work-flow rules?

17.What is the use of future method?

18.What is abstract class?.

19.Explain object oriented concepts in sales force how will you implement this?

20.How will you import and export data between two systems eg: SFDC and SQL?

21.What is appexchange?

22.Explain about cloud?.

23.Explain about validation rules in salesforce?.

24.What is the difference between roles and profiles?.

25.What is the difference between record level ,field level, object level security?

26.How will you use web services in sales

27.Can you explain about limitation why this limitation placed in sales force.

28.what is view state in sales force?.It there is any limitation after winter11?

29.What is the difference between Role and Profile?

30.How you handle part of page refresh using VF?

31.How you can define a trigger is executed successfully?

32.Explain about yours current project?

33.How do you rate yours self in apex,VF?

34.How you can deal with project dead lines?

35.How you can use external WSDL files in Sales force?

36.What is difference between rest full and soap API?

37.What is yours Strong point Sales force?

38.How you can with SQL injections in Sales force?

39.Can you explain test methods in salesforce?

40.How did you display error messages in salesforce? On VF Pages?


41.Can you explain relationships in salesforce?

42.What are SOQL limitations?

43.How can bypass SOQL statement to fetch more 1000 records?

44.What job did you like more in your carrier?

45.Can you explain a scenario integrating login method to third party application.

46.Can you explain about SFDC controllers?

47.Can you explain about sales process?

48.What is a set in salesforce deployments?

49.How many ways you can invoke an work flow?

50.What are governor limits can you explain about it?

51.East Sales Team can't access west sales team data how do you configure it?

52.What is Role,Profile,Security?

53.I have an contact .It phone number field is empty how you can get phone number from an related


54.How do you handle SOQL problem in Trigger?

55.How you can access JQuery in VF page?

56.What is change set in salesforce?

57. What is transient variable in salesforce?

58.How you can measure trigger performance?

 Give a reason for the Error that states "To many SOQL Queries: 21"?

Too many SOQL queries: 21 Error in

1. Basically the For Loop or the trigger or class it is not built for doing more then 20 queries

at once and it is hitting the governance limits.

  Give all the Actions for a Trigger in

1. Insert

2. Update

3. Delete

  Can you write a test class within a Trigger? True/False

1. False

  What is the difference between and trigger.old?

1. returns new versions or records for the Sobject.

2. Trigger.old returns old records or existing records for the SObject

  What is SOSL?

1. The SQL language for in regards to Search Functionality. Salesforce

Object Search Language

  What is the main difference between List and Set?

1. List contains Duplicates

2. Sets do not contain duplicates

  Describe a Junction Object.

1. Junction Object is when an object has 2 master detail relationships.

  Tell me ways of deploying Apex Code into Production from Sandbox.

1. ANT Tool

2. Eclipse

3. Change Sets

  Do picklist dependencies follow through onto the Visual Force code or is there a special tag for it

within the code?

1. Picklist Dependencies are now part of Visualforce and no special code is required.

  How do you get a static URL for Salesforce, and why would you want that?

1. To connect to salesforce from the API, an API Login should be issued to:

( for version 21).

On Success - server Url and session ID will be returned.

2. Static URL can be used for in Webservices API to connect to an endpoint.

3. Take the Salesforce Server that your instance is on and append "-" Of Course the 21.0 is the Version that salesforce is

running at the time.

  How one knows how to get the server that your instance is on?

1. Once one logs into Salesforce look at the URL and the first 3 characters is the server you

are on. For example, "cs3" is the server that my instance is on.

  What do you need for webservices API?


  What is the difference between Enterprise WSDL and Partner WSDL?

1. Enterprise WSDL has all the metadata and functions provided for the org. So if a field

attribute or object is changed or added, one must re-generate the WSDL to update the file.

2. Partner WSDL - the developer has to do all the leg work up front and then if a field is

added or object is changed or added, you do not have to re-generate the WSDL. It reflects on the

WSDL with all changes. Mostly the developer would add it to his or her code. Plus you are

utilizing SObjectDescribe() more.

answer for above two questions.

Lookup and master relations are use full for making relation between two objects(important point "not for


manly three conditions are making difference in these relations

lookup realation

1)In look up relation the field is not an mandatory, that means if we created lookup relation for any two

objects that particular field should not contain red mark beside that.

2) you can change look value that means it is editable

3) If we delete parent its wont create any effect on child

     for example "department object" is an parent "employ" is an this case deleting of "department"

can not create any effect on child.

master relation

this is completely opposite to the lookup relation.

1) its mandatory (you must fill it)

2)not editable (your value fixed )

3) if you delete parent child details also move to trash

Q3) Where is the view Account hierarchy link?

Q4)What does the Account Hierarchy tell or do?

answer for above two questions

"Account hierarchy link will appear in accounts"

More information about this

Before going to this we need to now what is account and what is contact?

EXAMPLE: accer is providing laptops and tabs and I am having the company of ABC bank.My

marketing manager called accer for 50 laptops and my HR manager called accer for 35 TABs.

according to above condition

ABC bank is the account and marketing manager and HR manager will come under contact.

Account hierarchy show these two contacts under ABC bank link

Q5) how to create field?

Before going this we need to now,what are the types of objects and fields

in basically we have two types of objects and fields

stranded objects ,stranded fields and custom fields, custom objects.

A) For crating field in stranded object we need to click on particular object in "customize"

setup> customize > account / contact > field > new

B) For creating field in custom object we need to click on object at "create"

setup > create > object > select the object > custom fields and relations > new

6)Where can you make a field required?

 In field creation we need to check on "field is mandatory".

7)I'm setting up different page layouts for different user profiles.  As a system administrator, is

there another way to see what the user sees instead of them granting log in access to you?

As a admin you can see what are the things in his layout and edit the layout.but you can not see the

exact view which is like an user view.

8)What type of Workflow Alerts are there?

Basically work flow alerts are four types, those are

Task:it is for making task to other user

Email alert :it is the process to create email alert (example: wishing mail for birthday)

Field updates: field updates are field value dependent activity

out bound messages: out bound messages are for sending data to the end point

9)Validation Rules, What are they use for in Salesforce?

Validation rules are very impotent one. its useful to create boundary for particular field.

Example: I am having salary field in my employ object.if I enter -4000Rs it will take, but this is false


if I created "salary__c < 0 "as a validation rule it wont allow to take negative values.

10)What is Dataloader?

dataloader is for integration.Mainly it is having   7 function buttons

Insert: it is for inserting data from external machine(file should be an CSV)

Update:it is for updating existing record

Upsert:it is having the function of insert and update

Delete: its for deleting data(deleted files available in recycle bin)

Hard delete: its for deleting but its not recoverable

Export:its for taking out the data from our

Export all: for all data extraction

Note: its allow the files of comma separated value (.csv)

What is the difference between Profiles and Roles in

Role is simple thing its just an name of designation.we can see in role hierarchy.

Profile is very important one all the functions dependent on profile.If we change the profile of an user, his

functions will change completely

11) what are governor limits in

 gov limits are run-time limits which is enforced at the time of Apex runtime why Because Apex runs in a

shared, multitenant environment the Apex runtime engine strictly enforces a number of limits to ensure

that code does not monopolize shared resources

types of limits that Apex enforces are


b)Database resources,

c)Number of script statements to avoid infinite loops,

d)Number of records being processed

12) Difference between auto-response rules and work flow rules

in fallowing  ways it is showing difference ....

WF: it is designed for Notifications to interested parties

AR:  for initial response to a particular case created persion

WF: it runs when record is created or edited

AR: it runs only when record created

WF: it send many mails when ever criteria matches

AR:Sends one email based on the first rule entry criteria it matches in a sequence of rule entries.

13)difference between sandbox and developer organization ?

sandbox is an test environment  where we can test our code and everything or copy of your

In SFDC we are having three type of sandboxes

Configuration sandbox: 500Mb-Refresh once per day

Developer sandbox: For coding and testing -10MB-Refresh once per day

Full sandbox: no limit-refresh a full copy for every 29 days-in full sandbox we can make a copy of 180

days for object history.

14)types for relation in SFDC

Lookup relation

Master relation

Many to May relation(junction creation)


15)what is cross object formula creation

It means creating relation between two field from two different object.For creating this object have to

have lookup or mater relation.


1) How do you hide Header and Sidebar on Visualforce page?

2) What is difference between standard and custom controller?

3) What is Controller extension?

4) How do you read parameter in Visualforce page?

5) How many dependent drop down can be put on one Visualforce page?

6) What is the maximum size of the PDF generated on Visualforce attribute renderAs?

7) How to use actionPoller tag?

8) What is difference between actionFunction and actionSupport Tag ?

9) How can we check the object accessibility on visualforce page?


10) How many rows return by list controller?


11) What is custom component?

12) What is assignTo attribute and what is its use?


General/Customization Questions

1)     Explain how MVC architecture fit for Salesforce.

2)     How will you create relationship between objects?

3)     How many types of relationships are possible between objects?

4)     How many data types are supported for a Custom Objects standard field name?

5)     What are activities?

6)     What is the difference between task and event?

7)     List and describe features used to set permission and data access in custom app.

8)     How will you create a user?

9)     What are the available editions in Salesforce?

10)   What is the difference between different editions of Salesforce?

11)   What is the difference between Sandbox and Developer environment?

12)   How to schedule export or take the backup of Salesforce?

13)   What are sharing settings?

14)   What are person accounts?

15)   How forecasting works in salesforce?

16)   What are system fields? Can you name some of them.

17)   What are default components available on home page?

18)   How do I change the home page layout?

19)   How many types of reports I can create in salesforce? What are they?

20)   What is dashboard? How is it created

21)   What is page layout?

22)   What is related list?

23)   What is the difference between page layout and related list?

24)   What is mini page layout?

Technical Questions

1)     What is Apex?

2)     What is VisualForce?

3)     What is an S-Control?

4)     What is the difference between Visualforce and S-Control?

5)     What are recursive triggers? How can we avoid the recursion problem?

6)     What are apex governer limits?

7)     Do governer limits apply to sandbox instances?

8)     What are recent release features?

9)     How do you use actionFunction tag?

10)   What is the difference between actionFunction and actionSupport tags?

11)   What is actionPoller?

12)   What is the difference between ISNULL and ISBLANK?

13)   How do you do FileUpload using visualforce?

14)   What is appExchange? How can I host my application on appExchange?

15)   What is batch apex?

16)   When will you use batch apex and what is the best practice?

17)   What is apex scheduler?

18)   What are webservice callouts?

19)   What are wrapper classes?

20)   When do we use wrapper classes?

21)   How do you hide header and side bar on visualforce page?

22)   What is the difference between standard and custom controller?

23)   What is controller extension?

24)   How do you read parameter in visualforce page?

25)   How many dependent drop downs can be put in visualforce page?

26)   What is the maximum size of the PDF generated on  visualforce attribute renderAs?

27)   How can we check the objects accessibility on visualforce page?

28)   How many rows are returned by a list controller?

29)   What is custom component?

30)   What is assignTo attribute and what is its use?


1. How many users have you supported.

2. What are permission sets and how do they differ from profiles.

3. When will you use profile and permission sets together.

4. Difference between roles and profiles.

5. What are controllers.

6. What are extensions.

7. Difference between controllers and extensions.

8. What is a standard controller, custom controller. Difference between the two.

9. When you override a button by specifying a VF page, what is a necessary condition for the VF page to

be available.

Ans - The VF page should have a standard controller listed for that object. Else, the VF page will not be

available to override a button.

10. Minimum number of queries required to query for 2 level, 3 level relationships.

11. How will you avoid recursive triggers.

12. How to bulkify triggers.

13. Understand basic SOQL and Apex limits.

14. What is with sharing and without sharing class.

15. How can sharing be done using Apex.

16. Explain the trigger handler pattern.

17. List few components which cannot be deployed using IDE or change sets.

18. What deployment methods have you used. List advantages and disadvantages of each.

19. How will you load data for a child object.

20. Difference between a look up and master-detail relationship.

21. Explain, the way you will query child from parent and parent from child

22. What are sharing rules, when do you used sharing rules.

23. Explain lead to opportunity conversion.

24. What are record types. Why are the record types used.

25. When is page layout assignment used.

26. Can 1 user be assigned multiple profiles, if yes how, if not, what is the work around.

27. How many types of salesforce licenses are there. What are the limits.

28. Which license will I use if users will only use 1 custom application.

29. How can I create developer, full sandbox.

30. In how many days can one refresh a full sandbox.

31. What is batch apex. Why do we use batch apex.

32. What is @future method.

33. What are test classes, what is the test coverage you need to move a code into production.

34. Can I directly change code in salesforce production org.

35. How do I log a case with salesforce.

36. How can I change owner for multiple cases at once (example - from Rob to John)

37. Difference between a workflow rule and approval process.

38. What is the order of execution of workflow rules, validation rules, triggers.

39. Explain security implementation with respect to Profiles, Roles and Hierarchy,

Sharing rules, OWD(org wide default settings). Also, specify which is the most restrictive security


40. What are custom report types.

41. What are different types of reports you can create.

42. What is Trigger.old and Trigger.New

43. What is ApexPages.addMessage

44. How is a pdf generated using visual force page.

45. How can I redirect user to a page after processing is completed in the controller/extension.

46. What are custom settings.

47. What are Action Support, Action Function and Action Poller used for.

48. What is rerender attribute used for.

49. What is package.xml

50. How can one read parameter values through the URL in Apex.


Salesforce Interview Questions:

             1.       How can we change standard Date format in to Salesforce and Local?

 2.       Difference into Action Support and Action Fuction?

 3.       Difference into Command Lind and Command Button?

 4.       Security in Salesforce?

 5.       Inline Visual force page?

 6.       How to remove redundancy in List?

 7.       If we are writing Global class how we can secure to external user?

 8.       Junction object.

 9.       How we can create custom field from page layout?

 10.   Lead conversion

 11.   Can we create contact without account?

Other Questions:

1.       What is Field Set and why we are using this?

 2.       Permission set

 3.       Trigger context and class context

 4.       What are partner and Enterprise WSDL?

 5.       What is difference between ActionFuction and ActionSupport?

 6.       Report

 7.       Ajax Toolkit- Custom button ajax

 8.       Criteria based sharing

 9.       Record sharing and types

 10.   Profile and role

 11.   Customer Portal and Self service portal

 12.   Type of relationship in soql

 13.   What are the types for run Batch class?

 14.   Dynamic Apex like Apex Describe information

 15.   Remote Action in apex.

 16.   View state

 17.   Pagination in Visual force page

 18.   Can we use in After Delete trigger?

 19.   Future methods and limitation.

 20.   What is difference between Sales Team and Account Team?


What is APEX Parser

It is used to track the custom objects and fields that are used, platform prevents users from making the

following types of modifications

 Changing a field or object name

 Converting from one data type to another

 Deleting a field or object

 Making certain organization-wide changes, such as record sharing, field history tracking, or

record types

 How to delete a class from production?

 How to fire a trigger only once?

 What is difference between 15 digit Id and 18 digit Id?

 What is a Batch Class?

 What is a Schedule class?

 What are Organization wide defaults or Shared rules?

 How to Deploy from Sandbox to production?

 Disadvantages of

 How to synchronize trigger which are written on same object with same type of insert or update


 What are web services?

 How to work with salesforce offline?

 What is Web-to-Lead?

 How many ways we can create a lead record?

 What is difference between sharing and without sharing?

 What is Data Loader and what is External Id?

 What are difference between between Roles and Profiles?

 What is a view state?

 What are different annotations used in salesforce, describe about them?

 What is Data Merging in Salesforce?

 What are record types?

 What are Report types?

 What are different type of Reports?

 What are different type of workflows used?

 Time Dependent Trigger does not work on which type of criteria?

 What is Salesforce to Salesforce?

 What is difference between and Trigger.old?

 What is difference between Rendered,Rerender and renderAs?

 What are different types of controllers available in

 Difference between SOQL and SOSL?

 Why is SOSL used for?

 Difference between System Log and Debug Log?

 What are the Governor Limits? and specify it for each edition?

 Some of the Standard objects of

 What are different types of Relationships in

 What are different type of Editions?

 What are different steps in approval process?

 What is the minimum time to schedule a class?

 How to give permissions to users for a specific record?

 What is Lead Convert?

 Integration of salesforce with other technologies?

 What is difference between personal account and business account?

 How many number of records can be retrieved from a query?

 What is a Campaign?

 What are different collection in salesforce? What is difference between List and set?

 What is StartTest() and StopTest()?

 What are the URL of sandbox and Production?

 What are difference between managed package and unmanaged package?

 What is the sequence of execution in

 Will CSS is supported in renderAs pdf?

 What are the symbols used in visual-force page?

 What are the different action tags used in visual force page?

 What is actionPoller?

 What is difference between repeat and dataList?

 What is the Code coverage to deploy into Production?

 What is System.Assert() and System.AssertEquals()?

 What is Rendered?

 What is RenderAs?

 What is reRender?

 What is actionFunction?

 What is ActionSupport?

 What is ActionSupport?

 How can I delete a controller from production?

No comments:

Post a Comment