24 December 2013

69 Important & Usefull Sales force Interview Questions&Answers

Sales force Interview Questions:
  1. What are the types of Controllers?
Ans : we have three types of the controllers.
         1. Standard controller
         2. Custom controller
         3. Controller extensions.
Controller:
            A visual force controller is a set of instructions that specify what happens when a user interacts with the components specified in associated visual force markup, such as when a user clicks a button or link.
Controllers also provide access to the data that should be displayed in a page and can modify component behavior.
Standard Controller:
          A standard controller consists of the same functionality and logic that is used for a standard sales force page.
For Example, if we use the standard accounts controller, clicking a save button in a visual force page results in the same behavior as clicking save on standard account edit page.
Custom Controller:
         A custom controller is a class written in Apex that implements all of a page’s logic.
If we use a custom controller, we can define new navigation elements or behaviors. But we must also re-implement any functionality that was already provided in a standard controller.
Controller Extensions:
        A controller extension is a class written in Apex that adds to or overrides behavior in a standard or custom controller. Extensions allow us to leverage the functionality of another while adding our own custom logic.
2.What is the difference between the Workflow and Approval process?
Workflows
                                     Approval Process
These rules are triggered upon save
These are triggered only when a user clicks “submit for approval” form.

Consists of one set of criteria and actions
Consist of multiple steps.


Have entry criteria, step criteria and step actions.


Have initial submission actions, rejection and approval actions and actions for each step.

Can be modified or deleted
Some attributes can’t be modified, processes must be deactivated before they can be deleted
3. What are the Record Types?
Ans  : Record types are used to display different pick-list values and page layouts to different users based on their profiles.
4. Have you implemented Record Types in your project?
Ans: Yes. We have created Record Types and we have done page layout assignment also.
5. How to make the Record type as a default?
Ans: By using Profiles.
Go to the particular profile and by using Record Type settings. We can make the record type as a default.
6. What is the Customer portal and Partner portal?
Ans :
Customer Portal : A salesforce.com customer portal similar to a self-service portal in that it provides an online support channel for your customers-allowing them to resolve their inquiries without contacting a customer service representive.
7. What are the annotations in the Apex?
Ans : An Apex  annotation modifies the way a method or class is used, similar to annotations in Java.
Ø  @Deprecated
Ø  @Future
Ø  @IsTest
Ø  @ReadOnly
Ø  @RemoteAction
8. what is @isTest annotation?
Ans : use the @isTest annotation to define classes or individual methods that only contain code used for testing your application.
9. How many controller extensions we can use?
Ans : Any number of controller extensions.
10. Tell me one Governor Limit?
Total number of SOQL queries issued
200
Total no. of records retrieved by SOQL queries
50000
Total no. of records retrieved by single SOQL query
200
Total no. of DML statements issued
150


11. What are the Collections?
v  Lists  
v  Maps
v  Sets
12. What is the difference between the Sets and Maps?
Ans:  A set is an unordered collection of primitives or sObjects that do not contain any duplicate elements.
A Map is a collection of key-value pairs where each unique key map to a single value. Keys can be any primitive datatype, while values can be a primitive, sObject, collection type or an Apex object.
13.What are the datatypes we can give for the Key and Values in Maps?
Ans :     Keys-   Primitive datatype.
          Values – Primitive,sObject,Collection Type or an Apex object.
14.What are the types of Sandboxes you’re using?
Ans :
1.       Full Sandbox
2.        Configuration only sandbox
Full sandbox is a production environment.
Configuration Sandbox is a test sandbox.
15. What is the difference between “with sharing” and “without sharing” keywords?
Ans : Use the with sharing keywords, when declaring a class to enforce the sharing rules that apply to the current user.
Use the without sharing keywords, when declaring a class to ensure that the sharing rules for the current user are not enforced.
16.What is the difference between Trigger.new and Trigger.old?
Ans :
Trigger.new : Returns a list of the new versions of the sObject records.
Note that this sObject list is only available in insert and update triggers and the records can only be modified in before triggers.
Trigger.old:Returns a list of the old versions of the sObject reords.
17.What is the Custom settings?
Ans : Custom setting that provides a reusable set of static data that can be accessed across your organization.There are two types of custom settings.
1.List Custom Settings
2.Hierarchy Custom Settings
18.What is the difference between the Lookup and Master-detail relationship?
Lookup Relationship
Master-detail relationship
We can create upto 25 lookup relationships.
We can create 2 master-detail relationships.
Lookup can be create if records already exists.
Master-detail cannot be created if records already exists.
If we deletes the Parent record, then the Childs will not be deleted.
If we deletes the Parent record, then the Childs will be deleted automatically.
These field values are not Mandatory.
These field values are mandatory.
Access rights are inherited to the child from the master.
Access rights are not inherited.
19.What is the difference between the Profile and Role?
Ans : A collection of settings and permissions that define how a user accesses records.
1.Profiles control a user’s permissions to perform different functions in Salesforce.
   Profile can have many users,but a user can have only one profile.
2.Roles: controls the level of visibility that users have to an organization’s data.
20.Can we create a user without assigning the Profile?
Ans : No.be’z while creating the user,selection of profile is mandatory thing.
21.How many ways we can make a field required?
Ans: There are 3 ways to make the field required
v   While creating the field
v  Using Page layouts
v  Using validation rules
v  FLS(may be this is not sure)
 22.How many ways we can create VF page?
Ans : There are the 2 ways to create a Visualforce page.
Ø  By using the URL
Ø  By using the path setup àDevelopàPages.
23.What are the Assignment Rules?
Ans :
 Assignment Rules are used to automate organization’s lead generation and support processes.
Lead assignment Rules – specify how leads are assigned to users or queries as they are created manually,captured from the web, or imported via the lead import wizards.
Case Assignment Rules—Determine how cases are assigned to users or put into queues as they are created manually,using Web-to-Case. 
24. What are the types of Relationships?
Ans :
§  Master-Detail
§  Lookup
§  Many to Many
§  Hierarchical
25.Can we delete the user from salesforce?
Ans : As per now,Salesforce doesnot allow to delete any user,however we can deactivate the user.
26.How to create the Many to Many relationship between object?
Ans : Create one custom object,which should have autonumber as unique identification and create two Master-Detail relationships for this object. And this object is called as Junction object.
27.What is Cross Object Formula?
Ans : Cross object formulas can reference merge field from a master object if an object is on the detail side of a master-detail relationship.
we can reference fields from objects that are upto 10 relationships.
We can able to insert related Object data into a formula.
28.How to hide a Tab for an User?
Ans :
-  By profiles,we can hide a tab for a user.
-  Use “Tab Hidden” setting for tab hide.
29.What is an External ID?
Ans : External  ID’s are used when we interacting with an external systems.It will act as unique record identifier.we can define 3 external ID fields per object.
These are the data types of fields.
Ø  Number
Ø  Text
Ø  Email
30.How many ways we can do deployment?
Ans :
There are 3 ways to do deployment.
ü  By using Change sets
ü  By using force.com IDE tool (Eclipse)
ü  By using force.com migration toolkit
31.What is  the best practice your are using while coding?
Ans :
*      Bulkify your code: Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time. When we try to load the bulk of the records using the DataLoader, then we make sure that code will satisfy.
*      Avoid SOQL Queries inside FOR Loops: When queries are placed inside a for loop, a query is executed on each iteration and the governor limit is easily reached.Instead, move the SOQL query outside of the for loop and retrieve all the necessary data in a single query.
*      Avoid Multiple Triggers on the Same Object: Write the single trigger on the each object and write the logic in the classes and call that classes in the triggers.
*      Use of the limits Apex Methods to avoid Hitting Governor Limits
*      Avoid Hardcoding IDs.
32.What is the MVC design pattern in Salesforce.com?
Ans: Model View Controller(MVC) design pattern is the one of the most popular design pattern which contains 3 modules.
ü  Model
ü  View
ü  Controller
Model : What Schema and data does salesforce uses to represent the system completely.In Salesforce,we can say that sObjects are the model.
Ex: sObjects,Apex classes.

View: How the schema and data is represented.Visualforce is used to present the data to users.
Ex: Pages,Components.

Controller:  How the interface actions.Controllers are used to perform the actions whenever users interact with Visualforce.
Ex: Standard,Custom(Apex).
33.How many records we can display in the particular report?
Ans : Any number of records.
34.What are the Data Components in the Dashboards?
Ans: The following are the Data Components in the dashboards.
Ø  Horizontal Bar Chart
Ø  Vertical Bar Chart
Ø  Line Chart
Ø  Pie Chart
Ø  Donut Chart
Ø  Funnel Chart
Ø  Gauge Chart
Ø  Metric
Ø  Table
Note: The components of the dashboard that use the Grand Totals is Metric and Guage.
35.How to call method in the VF page?
Ans: We have a attribute called action in the <apex:commandbutton> tag in the VF page.
Ex:
<apex:commandButton action=”{!save}” value=”Save” id=”theButton”/>
36.How much code coverage we can do for a Test Classes?
Ans : 75%
37.What is Formula Field?
Ans: A read-only field that derives its value from a formula expression which we define.The Formula Field is updated when any of the source fields change.
38.Mention the names of Standard Controllers?
Ans : Accounts, Contacts, Opportunities, Leads…etc(all standard & custom objects).
39.Can we delete a record using the Workflow?
Ans:
No
40.What are the Actions in the Workflow?
Ans:    
Ø  Task
Ø  Email Alert
Ø  Field Update
Ø  Outbound Messages
41.What is the Validation Rule?
Ans: Validation Rules verify that the data a user enters in a record meets the standards we specify before the user can save the record.
Validation Rule also includes the errormessage to display to the user when the rule returns a value of true due to an invalid value.
42.If we don’t have 75% code coverage,can we move it from one sandbox to another sandbox?
Ans: Yes,we can move a class from one sandbox to another sandbox.But if we want to move a class from sandbox to production environment we need to have a Test Class with a minimum of code coverage should be 75%.
43.Can we have duplicates in the External ID?
Ans : No
44.Which method in custom settings returns list of records?
Ans: getAll()
45.What are the context variables in Triggers?
Ans: Trigger.new, Trigger.old
Trigger.NewMap, Trigger.OldMap
isInsert, isUpdate, isDelete, isBefore, is After, is Undelete.
46.What is the Bulk Triggers?
Ans: All the triggers are bulk triggers by default and can process multiple records at a time.we should always paln on processing more than one record at a time.
47.What is the difference between giving with sharing and without sharing while creating a class?
Ans: The class with sharing means we are enabling the access to the profiles.
The class without sharing means we are disabling the access to the profiles.
48.Can we put list in the Map?
Ans: Yes, we can put list in the Map.
Please find the code below:
Map<Id, List<Opportunity>> MapList=New Map<Id, List<Opportunity>>();
49. What is the Roll-up summary field?
Ans: A read-only field that displays the sum, minimum, maximum value of a field in a related list or the record count of all records listed in a related list.
  50. How can we implement a scheduler in Force.com?
Ans: In force.com, we have a concept of scheduling the apex. We can write a block of code which can be scheduled at particular point of time in a week.

51. What are the different types of the trigger events?
Ans: An event in a trigger refers to a situation when the trigger gets fired.
Before Insert: Before inserting the record into a database, the trigger will be fired.
Before Update:  Before updating a record which is fetched from database, the trigger will be fired.
Before Delete: Before deleting the record, trigger will be fired.
After Insert: After inserting a newly entered record into database, the trigger will be fired.
After Update: After updating/modifying the record and once it is saved to database, the trigger will be fired.
After Delete: After deleting a record, if user needs to perform any action, he can fire the trigger using this after delete event.
After Undelete: Once the record gets deleted, it will be sent to recycle bin, So, a trigger can be fired when user is moving back from recycle bin to its respective object and the transaction is done.
52. What are the Types of triggers?
Ans: These are two types of triggers.
Ø  Bulk triggers (see 46 Question )
Ø  Recursive triggers
Recursive Trigger: A trigger that creates a new record as part of its processing logic; however, that record may then cause another trigger to fire, which in turn causes another to fire and so on.
53. What is difference between render, re-render and render as?
Ans: Render: components in visual force page can show or hide by using render.
Rerender:  If we want to refresh partial page in Visual force page we have to use re-render.
RenderAs:  By using this, we can convert entire visual force into PDF.
Syntax:  Render as=”pdf”
54. What is difference between Trigger and Workflow?
Ans:  Workflow: Inbuilt functionality, used on single object.
Trigger: Used for complex business process in which multiple objects can handle.
Ex: Using workflow, Based on the criteria we mentioned on the parent record, we can do field update on the parent only but not on child object.
Using Triggers, Based on the criteria we mentioned on the parent record, we can do field update on child also.
55. How many characters we can enter in the formula field? What will happen if we exceed the characters limit?
Ans: we can enter up to 3900 characters in the formula field. If we exceed the limit, then it give the compilation error.
56. Can we include one formula field with in another formula field? What about the size?
Ans:
 Yes, we can include one field with in another formula field. It will calculate the formula field characters which we included in formula field.
57. What is the actionFunction in the Visual force pages?
Ans:
 A component that provides support for invoking controller action methods directly from javascript code using an Ajax request.
An <apex:actionFunction> component must be a child of an <apex:form> component.
Notes:
<apex:actionSupport>: this component is used for displaying different values depending on whether it is progress or completed.
<apex: actionSupport>: A component that adds AJAX support to another component,allowing the component to be refreshed asynchronously by the server when a particular event occurs , such as button click or mouseover.
<apex: actionPoller>: This component specifies a timer that sends an AJAX update request to Force.com according to a time interval that we specify.
58. What is difference between the ISBLANK() and ISNULL()?
Ans:
 Both determines if an expression has a value and returns TRUE if it does not.If it contains a value,this function returns FALSE.
ISBLANK(expression): The expression allows both number and text fields.
ISNULL(expression): Here the expression allows only number fields. 
59. What are the operations we can do using Data Loader?
Ans:
Ø  Insert
Ø  Update
Ø  Upsert
Ø  Delete
Ø  Export
60. What is the maximum size of the PDF generated on Visulaforce attribute renderAs?
Ans: The maximum response size when creating a PDF must be below 15 MB, before being rendered as a PDF.
61. What is the ORDER of Execution?
Ans: The order of execution gives what are the events that Sales force performs in order.
·         Executes all before triggers
·         System validations are performed
·         Custom validations are performed
·         Saves the record but doesn’t commit
·         Executes all after triggers
·         Executes the assignment rules
·         Executes the workflow rules
·         Commits to the database.
62. Can we change the datatype from Lookup relationship and Mater relationship?
Ans:
 Yes. We can change the look-up relationship to master relationship.
63. We cannot create master-detail relationships if records already exist on object? Then how to achieve this one?
Ans:
 First we have to create the lookup relationship.
 Next update the existing records with some value in the lookup field.
Now change the datatype from lookup to master-detail.

64. What is the difference between the Force.com and salesforce.com?
Ans:
 Force.com is the platform used to develop the applications in the salesforce.
Salesforce.com is keyword used to search anything.
65. What are the OWD’s?
Ans:
OWD’s is used for restrict the access. Organization-wide default sharing settings give you baseline level of access for each object and enable you to extend that level of access using hierarchies.
66. What is sharing rules?
Ans:
Sharing rules represent the exceptions to your organization-wide default settings.Using sharing rules we can extend the access for the records.
67. At profile level what are the permissions we must give for OWD’s does not work?
Ans:
 View all and modify all permissions.

68. What is the difference between Data Loader and Import Wizard?

Data Loader
Import Wizard
It supports all the standard objects and custom objects
It supports accounts/contacts, Leads, Solutions and Custom Objects
Supports upto 1 million records
Supports upto 50,000 records
Duplicates will be allowed
Duplicates will not be allowed
Have batch size
Don’t have any batch size

69. What is permission sets?
Ans:
 A permission set is a collection of settings and permissions that give users access to various tools and functions. The settings and permissions in permission sets are also found in profiles, but permission sets extend user’s functional access without changing their profiles.

No comments:

Post a Comment