Salesforce Developer Interview Questions and Answers

by GangBoard Admin, November 26, 2018

In case you’re searching for Salesforce Developer Interview Questions and answers for Experienced or Freshers, you are at the correct place. There is parcel of chances from many presumed organizations on the planet. The Salesforce Developer advertise is relied upon to develop to more than $5 billion by 2020, from just $180 million, as per Salesforce Developer industry gauges. In this way, despite everything you have the chance to push forward in your vocation in Salesforce Developer Development. Gangboard offers Advanced Salesforce Developer Interview Questions and answers that assist you in splitting your Salesforce Developer interview and procure dream vocation as Salesforce Developer .

Best Salesforce Developer Interview Questions and Answers

Do you believe that you have the right stuff to be a section in the advancement of future Salesforce Developer, the GangBoard is here to control you to sustain your vocation. Various fortune 1000 organizations around the world are utilizing the innovation of Salesforce Developer to meet the necessities of their customers. Salesforce Developer is being utilized as a part of numerous businesses. To have a great development in Salesforce Developer work, our page furnishes you with nitty-gritty data as Salesforce Developer prospective employee meeting questions and answers. Salesforce Developer Interview Questions and answers are prepared by 10+ years experienced industry experts. Salesforce Developer Interview Questions and answers are very useful to the Fresher or Experienced person who is looking for the new challenging job from the reputed company. Our Salesforce Developer Questions and answers are very simple and have more examples for your better understanding.

By this Salesforce Developer Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our Salesforce Developer Interview Questions and answers to grow in your career.

Q1) Which tag is used for calling a controller Name

a. apex: field

b. apex:outputLabel

c. apex: controller

d. apex:form

Ans. C

Q2) What is the purpose of ShowHeader Tag

a. Showing a Record

b. Showing a Field

c. Showing a Content

d. Showing a Column Section

Ans. D

Q3) What is UI Interface

a. VisualForce

b. Apex

c. Soql

d. Ajax

Ans. A

Q4) How to be built, Sophisticated Model

a. MV

b. MC

c. M

d. MVC

Ans. D

Q5) Which Platform is Used to develop an App

a. Com Platform

b. Salesforce Platform

c. Force.Com Platform

d. Platform User

Ans. C

Q6) Advantage of Visual Force

a. Coding Support

b. Enhancing Process

c. Better UI

d. All the Above

Ans. D

Q7) How to define the Content in VF Pae

a. apex: define

b. apex: form

c. apex: include script

d. None of these

Ans. A

Q8) What are reRender Attribute Tag

a. apex: actionFunction

b. apex: command button

c. apex: actionPollar

d. All the Above

Ans. D

Q9) How to perform AJAX request in VF Page

a. apex: actionPollar

b. apex: actionRegion

c. apex: actionStatus

d. apex: form

Ans. B

Q10) apex: input field is used for what purpose

a. Input Field

b. Output Field

c. Output Label

d. None of these

Ans. A

Q11) apex: link is used for which purpose

a. Link to the Url

b. Purpose to Connect

c. Database Connection

d. None of these

Ans. A

Q12) How Exception is Catch in Programme

a. Try and Catch Block

b. Catch Block

c. Try Block

d. None of these

Ans. A

Q13) What is the Access modifier in the Programme

a. Public

b. Private

c. Virtual

d. All the Above

Ans. D

Q14) Private Class is used for

a. Complete Code

b. Declare Locally

c. Private Class

d.Global Class

Ans. C

Q15) Which Class is used for all the Code

a. Private

b. Public

c. Global

d. Abstract

Ans. B

Q16) What is the Use of Trigger Class

a. Batch Class.

b. Trigger Class

c. Invoked the Trigger

d. None of these

Ans. B

Q17) What is the operation that triggers performed

a. Insert

b. Update

c. Delete

d. All the Above

Ans. D

Q18) What Function in which trigger Performed

a. Before

b. After

c. Before and After

d. None of these

Ans. C

Q19) Which operation in which Undelete does not have

a. After

b. Before

c. Delete

d. None of these

Ans. B

Q20) What is the User Mode Process

a. Sharing

b. Without Sharing

c. None of these

d. Both a and b

Ans. A

Q21) What is the use of Blob Variable

a. Collection of Binary data

b. Binary Data

c. Bit Valued

d. Data is Analytics

Ans. A

Q22) What is the System Mode Process

a. Sharing

b. Without Sharing

c. None of these

d. Both a and b

Ans. B

Q23) How global function performed on Programme

a. global

b. Sharing

c. Without Sharing

d. None of these

Ans. A

Q24) What is the Use of Sharing Mode

a. User Permission

b. Profile Permission

c. Setting Permission

d. All the Above

Ans. D

Q25) Which tag is used for password protection

a. apex: inputSecreat

b. apex: inputHidden

c. apex: inputFiles

d. apex: inputFile

Ans. A

Q26) Combination of both Admin and Developer

a. Settings

b. Object Settings

c. Custom Settings

d. Data Settings

Ans. C

Q27) How to create a new Trigger

a. File – New – Class

b. File –New –Trigger

c. File-New –trigger- Object-Class Name

d. None of these

Ans. C

Q28) How SOSL Query to be Identified

a. From

b. Id

c. Where

d. None of these

Ans. C

Q29) How to Link to be passed in VF page

a. Input Text

b. HyperLink

c. URL Link

d. None of these

Ans. B

Q30) How to build Salesforce on Mobile Application

a. Salesforce 1 Classic

b. Mobile SDK

c. Mobile App Format

d. Android

Ans. B

Q31) What is the Collection Data Type

a. List

b. Map

c. Set

d. All the Above

Ans. D

Q32) What are the Primitive Data Type

a. Int

b. Double

c. Long

d. All the Above

Ans. D

Q33) How much bit for Integer

a. 32-bit

b. 64-bit

c. 128-bit

d. None of these

Ans. A

Q34) Where Time Variable is Using

a. Sharing

b. Static

c. Non Static

d. Without Sharing

Ans. B

Q35) Collection of Character

a. Char

b. String

c. Blob

d. Data

Ans. B

Q36) Which concept is used in Programming Language


b. Object Class

c. C-Language

d. .Net

Ans . A

Q37) What is the Purpose of Contain Method

a. Return of Data

b. Return of the SubString

c. Return of String.

d. None of these

Ans. B

Q38) How to ignore the Data Contain Same String

a. EqualIgnoreCase

b. EqualCase

c. Ignore Case

d. Ignore

Ans. A

Q39) How Array Contain data

a. Collection of Similar Data

b. Collection of Dissimilar Data

c. Both a and b

d. None of these

Ans. A

Q40) Which Process checking the if and Else Statement

a. Control Flow

b. Structural Flow

c. Decision-Making

d. All the Above

Ans. C

Q41) What data Wrapper Class Contain

a. Abstract Data Type

b. Collection Data Type

c. Structure Data Type

d. All the Above

Ans. D

Q42) How Virtual Method can be Called

a. Virtual

b. Global

c. Static

d. All the Above

Ans. A

Q43) Return Type is Mandatory for a Method

a. Yes

b. No

c. May Be

d. All of these

Ans. A

Q44) How Java-like loop works in Salesforce

a. A sequence of Statement Traditional

b. Looping Sequence

c. Statement Sequence

d. None of these

Ans. A

Q45) How Iteration Process to be carried

a. Looping

b. Control

c. Decision

d. Condition

Ans. A

Q46) How to define a Static Variable

a. Constant Keyword

b. Static Keyword

c. Variable Keyword

d. None of these

Ans. A

Q47) What is the bit variable for Long Statement

a. 32-bit

b. 64-bit

c. 128-bit

d. None of these

Ans. B

Q48) Apex Code Development Tools

a. Force. Com Developer Tools

b. Force. Com IDE

c. Code Editor

d. All of the Above

Ans. D

Q49) What like of Syntax does Apex Structure

a. C#

b. Java

c. VisualForce Page

d. None of these

Ans. B

Q50) Full Form of CRUD

a. Create, Read

b. Create, Read, Update, Delete

c. Create, Update

d. Create, Delete

Ans. B

Q51) Which Programming Language is used in Salesforce

  1. Apex
  2. Java
  3. C#
  4. C

Ans. A

Q52) Which concept is used in Programming Language

  1. OOPS
  2. Object Class
  3. C-Language
  4. .Net

Ans . A

Q53) Full Form of SOQL

  1. Salesforce Query Language
  2. Salesforce Object Language
  3. Salesforce Object Query Language
  4. Salesforce Language

Ans. C

Q54) Full Form of SOSL

  1. Salesforce Object Language
  2. Salesforce Object Search Language
  3. Salesforce Search Language
  4. Salesforce Language

Ans. B

Q55) What is the Language is used for UI design

  1. VisualForce
  2. HTML
  3. .Net Framework
  4. WordPress

Ans. A

Q56) What is the Ajax behaviours in Visual Force Page

  1. Js Behaviour
  2. CSS Behaviour
  3. HTML
  4. None of these

Ans. A

Q57) What are the things external included to the Visual Force

  1. Js
  2. CSS
  3. Angular Js
  4. All the Above

Q58) What is the purpose of SOQL

  1. Class Query
  2. Record Query
  3. Object with Record Query
  4. None of these

Ans. C

Q59) What is the Purpose of SOSL

  1. Where – Condition
  2. From – Condition
  3. Select – Condition
  4. None of These

Ans. A

Q60) Full Form of MVC

  1. Model View Controller
  2. Model Visual Class
  3. Model View Class
  4. Model Visual Controller

Ans. A

Q61) Which Tag is used to display Message on VisualForce

  1. Message
  2. Add
  3. ApexPages
  4. Page

Ans. A

Q62) What is the Use of Try and Catch block

  1. To Catch Error Message
  2. To Catch the Error
  3. To Catch the Execution
  4. Message will Thrown

Ans. B

Q63) DML Stands For

  1. Dynamic Manipulating Language
  2. Database Multi Languge
  3. Database Manipulating Language
  4. None of These

Ans. C

Q64) What is the Code Coverage in Salesforce

  1. 65%
  2. 75%
  3. 55%
  4. 45%

Ans. B

Q65) sObject Creation means

  1. Standard Objects
  2. Custom Object
  3. Salesforce Object
  4. None of these

Ans. A

Q66) Which Tag is used for Creating a Button

  1. apex: commandbutton
  2. apex: commandlink
  3. apex: button
  4. None of these

Ans. A

Q67) Which Tag is used for Url Link

  1. apex: commandlink
  2. apex: command
  3. apex: commandbutton
  4. apex: SelectOption

Ans: A

Q68) Which output tag is used for linking a URL

  1. apex: outputLink
  2. apex: outputpanel
  3. apex: outputText
  4. apex: outputLabel

Ans: a

Q69) Which tag is used for password protection

  1. apex: inputSecreat
  2. apex: inputHidden
  3. apex: inputFiles
  4. apex: inputFile

Ans. A

Q70) Which tag is used for Container Form

  1. apex: form
  2. apex: field
  3. apex: actionReion
  4. apex: actionPollar

Ans: A

Q71) apex: StyleSheet tag is used for linking

  1. CSS
  2. Js
  3. Bootstrap Js
  4. Angular Js

Ans. A

Q72) What is the obligatory Outer Tag

  1. apex: page
  2. apex: form
  3. apex: inputtag
  4. apex: outputtag

Ans. A

Q73) What is the annotation is used for Test Class Creation

  1. @
  2. $
  3. *
  4. #

Ans. A

Q74) What is the class is used for scheduling a job

  1. Batch Class
  2. Test Class
  3. Controller Class
  4. Visual Force Class

Ans. A

Q75) How Batch Class is declared

  1. global
  2. Static
  3. Class
  4. None of these

Ans. A

Q76) Which tag is used for displaying a video in VF

  1. apex: flash
  2. apex: iframe
  3. apex: image
  4. apex: message

Ans. A

Q77) How to display a chatter feed Record

  1. chatter:feed
  2. chatter:follow
  3. chatter:follower
  4. chatter:feerwithfolower

Ans. A

Q78) What is the use of global Variable

  1. Referenced the general Information
  2. general Record
  3. Value Record
  4. None of these

Ans. A

Q79) $API is used for

  1. Session ID
  2. Record ID
  3. Value ID
  4. Custom ID

Ans. A

Q80) What is the Use of Trigger Class

  1. Batch Class.
  2. Trigger Class
  3. Invoked the Trigger
  4. None of these

Ans. B

Q81) What is the Used for the Listing of Object

  1. Map
  2. Batch
  3. String
  4. List

Ans. D

Q82) What are Methods Used in batch class

  1. Start, Execute, Finish
  2. Start, Execute
  3. Start
  4. Start, Finish

Ans. A

Q83) What is the Use of Custom Settings

  1. Wrapping a Custom Set of Data
  2. Set of Standard Data
  3. Custom Set of Data
  4. Data Analytics

Ans. A

Q84) Which Tag is used for creating a radio button

  1. apex: selectRadio
  2. apex: SelectList
  3. apex: SelectOption
  4. apex: SelectList

Ans. A

Q85) How to change the Lightning Resources

  1. Standard Application
  2. Custom Application
  3. Customize Application
  4. None of these

Ans: C

Q86) How to perform SOQL and SOSL Query

  1. API Enabled
  2. API Disabled
  3. Data Integration
  4. Data Joining

Ans. A

Q87) What is the Use of Debug Log

  1. To Check the Object Flow
  2. Catch the Process
  3. Catch the Exception
  4. Throw a Error

Ans. C

Q88) What is Variable Declaration

  1. Strongly Typed Language
  2. Variable Data Type
  3. Data Type
  4. All the Above

Ans: D

Q89) What is the use of Blob Variable

  1. Collection of Binary data
  2. Binary Data
  3. Bit Value
  4. Data is Analytics

Ans. A

Q90) What is the need of if – else Statement

  1. Looping Statement
  2. Decision Making Statement
  3. Structured Staement
  4. None of These

Ans. B

Q91) What is the use of Access Modifier

  1. It define the Permission
  2. It will provide the Accessibility
  3. Class Permission
  4. All the Above

Q92) What is the Use of Public Class

  1. The Variable cannot be accessed
  2. Variable can be accessed
  3. Class definition
  4. Constructor Definition

Ans. B

Q93) What is the purpose of Abstract Method

  1. Actual Value
  2. Declare a Class
  3. Contain the Signature of Method
  4. Not have the Actual Implementation

Ans. C

Q94) The Sequence of the parameter

  1. Return data Type
  2. Method Name
  3. Square Bracket
  4. All the Above

Ans. D

Q95) What is the Variable is used for access all the variable

  1. Global
  2. Public
  3. Private
  4. None of these

Ans. A

Q96) How Constructor can be Invoked

  1. When Class is called
  2. When Object is Invoked on Class
  3. It will differ from Class Name
  4. None of theses

Ans. B

Q97) What is the Use of Wrapping Class

  1. Wrapping All the Data
  2. Wrapping a Class
  3. Wrapping a Structure
  4. Wrapping the Value

Ans. A

Q98) How Batch Class to be executed

  1. By Debug log
  2. By Open Execute Anonymous Window
  3. By Test Class
  4. By Batch Class

Ans. B

Q99) What is the Purpose of Execute Method

  1. Executing a Set of data
  2. Wrapping a Record
  3. Execute a data
  4. Value of the Record

Ans. A

Q100) What is the need of Trigger

  1. Invoked a Record
  2. Invoked a Process
  3. Invoked a Object
  4. Invoked a Value

Ans. B

Q101)What is Standard List Controller?

Ans. Standard list controllers allow you to create a Visualforce pages that can display or act on a set of records.

Q102)How do we associate or define a Standard List Controller?

Ans. We can associate a standard list controller by using a recordSetVar attribute of <apex:page> as same as: <apex:page standardController=“Contact” recordSetVar=“contacts”>

 Q103)What is record SetVar in Standard List Controller?

Ans.This attribute is used on Visualforce Page with <apex:page> VF component. The value of the attribute indicates the name of the set of records passed to the page meAns. the list of records. This record set can be used in the expressions to return the list of values to display on the page or to perform actions on set of records.

 Q104)What is Custom Controller?

Ans.Custom Controller is a class written in Apex which is used to implement the logic of VisualForce page without leveraging the standard functionality.

Q105)How we associate a custom controller with a Visualforce Page?

Ans.Syntax to use Custom Controller in Visualforce Page is: <apex:page controller=“myfirstclass” >

where “myfirstclass” is the class written in Apex.

Q106)What is Controller Extensions?

Ans. A controller extension is a class written in Apex that extends the functionality(data model) of a standard or custom controller. When a developer wants to leverage the built-in functionality of a controller  but override one or more actions, such as edit, view, save, or delete. Objective is to add new custom actions in your extensions controller.

Q107)How we associate a  Controller Extension with a Visualforce Page?

Ans. Syntax to use Controller Extension in your Visualforce Page is to use an extensions attribute


<apex:page standardController=“Account” extensions=“ApexClassName”>

<apex:page standardController=“Account” extensions=“ApexClass1, ApexClass2,..”>

<apex:page controller=“MYControllerName” extensions=“ApexClass1, ApexClass2,..”>

Q108)Can we reference Standard Controller and Controller attribute at the same time?

Ans. No, We cannot reference both attributes i.e Standard Controller and Controller at the same Visualforce Page. The best way to reference Standard Controller with your Custom Controller is to use extensions attribute.

<apex:page standardController=“Account” controller=“myapexclass”>  //Wrong syntax

<apex:page standardController=“Account” extensions=“ApexClass1, ApexClass2,..”> //Correct syntax

<apex:page controller=“myapexclass” extensions=“ApexClass1, ApexClass2,..”>   //Correct syntax

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

Ans. To hide a Header and Sidebar on Visualforce Page, we use an attribute showheader=”false” to hide the header and sidebar=”false” to hide the sidebar. showheader and sidebar is an attribute of  VF component <apex:page>, the attribute contains a Boolean value. Below is the code to hide.

<apex:page showHeader=”false” sidebar=”false” > </apex:page>

 Q110)Why we enable Development Mode and How to Enable it?

Ans. Enabling a Development Mode allows the Page Editor to be embedded in your browser that finds easy for you to see the code & preview the output of the page at the same time. If its disable, you will not be able to edit the code from the page directly.

Q111)What are List in Collections?

Ans. A list (also called an array) is a variable representing an ordered collection of elements which are distinguised by their indices. The index of a list is numeric, and starts at 0  always. This meAns. that if you have one item in your list, then that item’s index is 0. If you have two items, the first item’s index is 0, and the second item’s index is 1.

Primitives Date Type:

For example, List<String>  myListOfStrings could be used to represent a collection of strings. Therefore, in order to declare a list variable, you would type list, followed by the type collected within < >.


For example, if you wanted to have a list of your Account records, you will do something as below

List<Account> acts=[select Name, Type from Account where Industry=‘Insurance’];

It will fetch all records of Industry, It will put in acts

Q112)What are Set in Collections?

Ans. A set is a collection of unordered elements of primitives or sObjects, and you cannot use an index to retrieve an element like you can with a list. Also, when iterating through the elements in a set, you should not rely on the order being the same. Also, they cannot contain any duplicate elements.

Set can be represented as:

Set <String> s=new Set<String>{‘India’, ‘Pakistan’, ‘Sri Lanka’, ‘Bangladesh’};

Q113)What is the difference between Visualforce Page & Visualforce Component?

Ans. Visualforce Page is the page that must be wrapped inside a single page component tag i.e




and within the <apex:page>, we use the Visualforce Component. A Visualforce component is either a predefined like <apex:pageBlock>,<apex:pageBlockSection>,<apex:column> etc. i.e standard component library or custom component that determines the user interface behaviours.

Q114)What are Global variables explain with examples?

Ans. Global variables are the variables that can be referenced using Visualforce expression for example, {!$User.FirstName} is a type of merge field that yields information about the organization or the current user of the platform. Each global variable starts with a dollar sign “$”.

Below are the list of global variables:

$Action $Api $Component $ComponentLabel
$CurrentPage $Label $Label.Site $ObjectType
$Organization $Page $Profile $Resource
$Setup $Site $User $UserRole
$System.OriginDateTime $ User.UITheme $User.UIThemeDisplayed

 Q115)What is Developer Console?

Ans. The Developer Console is an integrated development environment provided by salesforce with a collection of tools where you can use to create, debug, and test applications in your Salesforce org.

Q116)What is an attribute? What is reRender attribute in Salesforce?

Ans. An attribute is the properties of a Visualforce Component. Every Visualforce Component in Salesforce has its own attribute. For e.g. <apex:CommandLink> is the one of the Visualforce Component. Its one of the important attribute is reRender.

The “rerender” attribute specifies a list of elements that should be dynamically updated using Visualforce’s AJAX library. That meAns. , the entire page will no longer refresh, When a “rerender” attribute is specified, but only a portion of the page identified by the elements named in the “rerender” attribute.

<apex:CommandLink reRender=“myblock”>

Q117)What is Apex Trigger?

Ans. Triggers in Salesforce are programmatic event handlers which is an Apex Code that gets executed when a DML operation occurs on an sObject record. Apex Triggers runs on server side, not on client side.

or A trigger is the Apex code that executes before or after the subsequent kinds of operations:

  • before insert
  • after insert.
  • before update
  • after update
  • before delete
  • after delete
  • after undelete

Q118)What are the different types of trigger in Salesforce?

Ans. The two different types of trigger in Salesforce are:

  1. Before Trigger: Before trigger get executed to validate the record values before they are saved to the database.
  2. After Trigger: After trigger get executed to validate the record values after they are saved to the database.

Q119)What is the syntax of trigger in Salesforce?

trigger trigger_name on ObjectName (trigger_events){
//code block
trigger mytrigger on Account (before insert, after insert){
//code block

Apex Trigger always start with a keyword trigger, before insert and after insert are the events in trigger that meAns. when the trigger will get executed and when it validate. More that one trigger event we can declare in one trigger, but each should be separated by comma.

Q120)What is Test Class? What is the minimum test coverage is required for deployment of the Apex Code?

Ans. Test class is  used to test the business functionality by using some dummy data in the code. It will show you the no. of lines covered. At least 75% of test coverage is required for the Apex Code to deploy.

Q121)What is Sandbox?

Ans. Sandboxes create copies of your Salesforce org in separate environments that are used for development, testing, and training.  Sandboxes are isolated from your production org, In simple words, they both are independent.

Q122) How many Types of Sandbox?

Ans. There are four types of Sandbox:

  • Developer Sandbox
  • Developer Pro Sandbox
  • Partial Copy Sandbox

Full Sandbox

Q123)What is Change Set?

Ans. A change set by which one organization can send customizations to another organization.

Q124)What is true about Change Sets?


  • There are two types of change sets, Inbound and Outbound.
  • Change sets can be only be sent between organizations affiliated with a production organization.
  • Any two sandboxes that belong to the same Production organization.
  • There is a deployment connection between the two orgs.

Q125)What is Asynchronous Apex?

Ans. Asynchronous Apex is used to run processes in at a later time that are scheduled.

Q126)What are the different types of Asynchronous Apex?

Ans. There are four types of Asynchronous Apex:

  • Future Methods.
  • Batch Apex.
  • Queueable Apex
  • Schedules Apex.

Q127)What is Exception?

Ans. A code, that stops the normal flow of the program execution when something bad happens then the program shows exception.

Q128)What is Packages?

Ans. A package contains components such as apps, objects, reports, email templates.

Q129)How many types of Packages are there?

Ans.There are two types of Packages:

  • Managed Packages
  • Unmanaged Packages

Q130)What is Managed Packages?

Ans. Managed Packages are the ones where the Code is Hidden from the user and which be easily Upgraded or Pushed with new updates to the code.

Q131)What is Unmanaged Packages?

Ans. Unmanaged Packages have the Code visible to the user that can be edited by the Org in which it has been Installed. This Package cannot be Upgraded or Pushed ,they are like one time coded.

Q132)How many assignment rules can you active in a lead/ case?

Ans. Only one assignment  rule can be active at a time.

Q133)What are the ways of deployment the metadata in Salesforce?

Ans. You can deploy the metadata in Salesforce using the following ways:

  • Change Sets
  • Eclipse with Force.com IDE
  • com Migration Tool – ANT/Java based
  • Salesforce Package

Q134)What is Trigger.new?

Ans.Triger.new is a context variable which returns the list of records that have been added recently to the sObjects.

Q135)What’s the difference between Salesforce.com & Force.com?

Ans.Salesforce.com is SaaS product i.e Software-as-a-Service while Force.com is a PaaS product i.e Platform-as-a-Service. Salesforce.com has a selection of prepackaged solutions such as the Sales & Service Cloud that are designed for a specific business purpose. While Force.com allows the developers to build the customize applications. Salesforce.com is built on the Force.com platform.

Q136)Why and When we should Apex be used over Workflow rules or Process Builder?

Ans. There are several reasons why you should use Apex over declarative automation tools:

Workflow rules and Process Builder automation tool sometimes have feature limitations that can be overcome with Apex. For example, pulling information from an external system.

While dealing with certain or large sets of data, Apex can be more efficient than declarative options due to less limitations.

Q137)Distinguish between SOQL and SOSL?

Ans. Below is the difference between SOQL and SOSL:

  SOQL:(Salesforce Object Query Language) SOSL:(Salesforce Object Search Language)
1. Only one sobject at a time can be searched. Many Object can be searched at a time.
2. SOQL retrives  the records from the database  by using “SELECT” keyword. SOSL retrives  the records from the database  by using the “FIND” keyword.
3. We can query on only one table. We can query on multiple tables.
4. Perform DML Operation on query results.
For example, you can return a list of accounts, contacts, opportunities, and cases that begin with the phrase sum:
DML Operation cannot be performed on search results.
For example,A SOQL query is enclosed between square brackets the following query retrieves a record from the database that has the name field value equal to “Kumar” and stores in variable l1

List<List<sObject>> searchList = [FIND ‘sum*’ IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Case];


List<sObject> l1= [select FirstName FROM contact where LastName = ‘Kumar’];

 Note: SOSL queries are only supported in Apex classes and anonymous code blocks. SOSL query cannot be used in a trigger.

Q138)What is Asynchronous Apex? What are the four different types of Asynchronous operations?

Ans. Asynchronous Apex is used to run processes in at a later time that are scheduled.

The four different types of Asynchronous Operations are:

  • Scheduled Apex.
  • Batch Apex
  • Queueable Apex
  • Future Methods

Q139)What are the three methods of batch Apex class?

Ans. To write a Batch Class, A Class must implement the Database.Batchable interface contains the below three methods:

Start method:

global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) {


Execute method:

global void execute(Database.BatchableContext BC, list<P>){

// process each batch of records


Finish method:

global void finish(Database.BatchableContext BC){

// execute any post-processing operations


Q140)What are Collections?

Ans. The collection is the type variables which can store multiple numbers of records into a single variable. The collection types available in Apex are List, Set, and Map.

Q141) Compare Apex Class with Java and Database Stored Procedure?

Ans. Apex class syntax is like Java and it acts like database stored procedure.

Q142) Explain about sObject datatype?

Ans. Subject datatype is specific to salesforce. It is divided into generic subject type(subject) or specific subject(Account,contact). Generic subject type can hold any object records. Specific subject variable can hold only records of that specific type.

Q143)Give two example of Definition Modifier?

Ans. Virual, Abstract is the two definition modifier.

Q144)Why salesforce imposes governor limit?

Ans. Salesforce is following Multitenant architecture. So in order to avoid monopolizing resource by the single org saleforce implemented governor limit. It keeps the performance at the optimum level.

Q145)Where we can see entire data model of object and relationship?

Ans. By using schema builder, we can see all objects and relationship and objects’s fields at one place.

Q146)Why we use Execute anonymous window?

Ans. Execute anonymous window is used to executed the specific methods of class or running apex code for testing purpose. Code inside the Execute anonymous window is executed in user mode. It obeys all user permissions.

Q147)Can we perform DML operation directly on the result of SOSL query?

Ans. We cannot perform dm operation directly on the result of SOSL. Because sosl returns list of list subject records.

Q148)How many DML statement can be issued in single transaction?

Ans. In single Transaction 150 DML statement can be issued. If it crosses the limit, it will throw limit exception.

Q149)What are the context variable that is available in trigger?

Ans. Context variable is used to get the information related to the records that caused the trigger to execute. Context variable: isexecuting, isinsert, isupdate, isdelete, isundelete, isbefore, isafter, new, old, newMap, oldMap, size.

Q150)How to avoid recursive trigger execution?

Ans. By using the static variable, we can avoid recursive trigger.

Q151)What are the log levels available?


Q152)Why we are writing test classes in salesforce?

Ans. Test class is for maintaining the quality of code, long term success in the code development, for covering overall code coverage of 75%.

Q153)What is the purpose of calling asynchronous method inside Test.starttest() and Test.stoptest() method?

Ans. Test.stoptest() method ensure all the code present before this will get executed in synchronous mode. Even though we call asynchronous methods, it will get executed in synchronous mode. And also, code inside the Test.starttest() and test.stoptest() will get executed in different thread.

Q154)Can test created by one test method available to the another test method?

Ans. No. Test data created in one test method is not available to other test method. We have to create it again.

Q155)What is rowcause in the Apex Managed Sharing?

Ans. Rowcause is having information about why and for what purpose sharing rule is created. So that any other can understand about this purpose.

Q156)How many sendemail() method can be used in single transaction?

Ans. Only 10 time we can call sendemail() method in single transaction. In order to avoid hitting the limit, we can use list.

Q157)How to get picklist values dynamically in Apex?

Ans. First get describefieldresult by using this code: Schema.DescribeFieldResult dfr = Schema.sObjectType.Account.fields.status;

Then, get picklist values by suing this code: getPicklistValues() methods available in Schema.DescribeFieldResult object.

Q158)When one visualforce page is associated with multiple extension controller. Which will get executed first?

Ans. First controller is executed first.

Q159)How to pass value from Visual force page field to Apex Class variable?

Ans. By using setter method we can set value from field to variable in apex class.

Q160)How to hide header and sidebar in visual force page?

Ans. By using page component attribute sidebar=”false” and showheader=”false”.

Q161)How to implement the pagination in VF Page?

Ans. Standardlistcontroller is used to implement the pagination.

Q162)Can we have standard controller and custom controller for same VF Page?

Ans. We can’t have standard and custom controller for single VF page. But it can have standard controller and extension controller.

Q163)What are the ways to call the Controller Methods from VF Page?

Ans. VF Page action components, from JavaScript function via Action function or javascript remoting.

Q164)Give me one some example of action components in VF Page?

Ans. <apex:commandbutton>. It shows button in the UI. When user click button, it calls apex method.

Q165)Can we override visual force page to Standard button and link in salesforce?

Ans. Yes we can override.

Q166)What is the different between virtual and abstract class?

Ans. Both abstract and virtual class is used to extend the parent or base class.

In abstract, extended class has to implement all the methods of abstract keyword in parent class.

In virtual, extended class don’t need to implement all the methods of virtual keyword in parent class.

In order to use override keyword in the extended class, then parent class method must have defined with virtual keyword.

Q167)How to lock records using SOQL?

Ans. FOR UPDATE clause is used to lock the records using SOQL query.

Q168)How to cover catch block in Apex Class during code coverage?

Ans. Cover the catch block by passing the information that will cause exception to occur. This exception can be handled in test class.

Q169)How to display more than 1000 records in visual force page?

Ans. By setting readonly=”true” in <apex:page> component.

Q170)How to add error message using Trigger that will be displayed in Standard UI?

Ans. addError() method is used to add error in Object and Field.

Q171)What is the extension for standard and custom sharing object in salesforce?


Standard object = Example : contactshare

Custom object = Example: student__share

Q172)What is the object that we use for storing the callout information?

Ans. Httprequest object is used to have request information during callout to thirdparty system.

Q173)How many number of callout we can make from salesforce in single transaction?

Ans. We can make 100 Callout in single Apex Transaction.

Q174)How to filter logs that is captured by using system.debug() method?

Ans. By filtering using USER_DEBUG keyword, we can filter out the logs that got captured by system.debug() method.

Q175)In SOQL query what is the aggregate function that we use to find average amount in opportunity?


AVE() function is used for averaging the result based on particular field.

SELECT AVG(Amount)AmountAverage FROM Opportunity

Q176)How many number of records that can be returned by SOQL query in Apex Class?

Ans. 50,000 records can be returned by SOQL Query in Apex Class.

Q177)Give me any example of exception that cannot be caught by try and catch block?

Ans. LimitException that is occurred when transaction reaches the governor limit.

Q178)What are not counted as part of code coverage?

Ans. System.debug() statement, if open and closed curly braces comes in separate line, commented line.

Q179)What is the annotation that is used for making method to be called by process builder?

Ans. @invocableMethod

Q180)How to get record from recyclebin when we run SOQL Query?

Ans. By using IN ALL ROWS clause at end of the soql query.

Q181)Is Save point and rollback count againt dml statement?

Ans. Yes each counts again one DML statement.

Q182)Explain about @future annotation?

Ans. Future annotation declares method as asynchronous method. Code inside the method will get executed in asynchronous mode.

Q183)Why we need to avoid using DML and SOQL inside the for loop?

Ans. For avoiding from hitting governor limits.

Q184)When we go for Hierarchical custom setting?

Ans. Hierarchical custom setting is used in the scenario where we need to access different data based on profile and user for same purpose.

Q185)List out the fields that is automatically indexed in salesforce?

Ans. Fields: RecordTypeId, Division, CreatedDate

Systemmodstamp (LastModifiedDate),Name, Email (Contacts,leads), Foreign key(lookups and master-detail), Salesforce record ID

Q186)What are the methods available in Batch Class?

Ans. Start, execute, finish method is available in batch class.

Q187)How to schedule apex class programmatically?

Ans. By using system.schedule() method, we can schedule apex class that got implemented with schedulable interface.

Q188)Can we call Trigger methods from the Apex Class?

Ans. No we can’t call trigger methods form apex class. So we need to avoid implementing much business logic in trigger. We can create and utilize handler classes.

Q189)What are the iterable component available in VF Page?

Ans. Pageblocktabel, datatable, repeat component.

Related Post

No Comments

Leave a Reply

Your email address will not be published Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Online Training Quick Enquiry

Get Free Online training