Sample Questions of Notes & Interview Questions
Comprehensive Coverage – This guide includes detailed notes and
expert-crafted interview Q&A on key Salesforce topics like SOQL vs SOSL,
LWC, Apex, and REST & SOAP APIs.
Scenario-Based Questions – Real-world company-wise scenarios to help
you crack technical rounds confidently.
Asynchronous Apex & Triggers – Master complex topics with structured
explanations and hands-on examples.
Admin & Developer Topics – Covers both Salesforce Admin and
Developer interview Q&A, making it a one-stop solution for job
preparation.
Practical Insights – Get industry-relevant knowledge, best practices, and
pro tips for acing your Salesforce interviews.
📌 Buy It Now! [https://trailheadtitans.com/product/salesforce-notes/]
Q1.What is the difference between Force.com and Salesforce.com?
Force.com is the PaaS vertical that forms the foundation for the code,
database fetching and UI development. Salesforce.com, being a superset is the
SaaS vertical referring to the CRM functionality (Sales, Services & Marketing).
Q2.What is the difference between IsNull and IsBlank?
IsBlank () is a function that checks if an expression has a value or not. It returns
TRUE if there is no value else False. It supports all fields’ type including Text.
IsNull () delivers similar functionality with a difference it supports Number
fields only.
Q3.Explain different relationships in SFDC.
Lookup Relationship Lookup relationship links up two objects and up to 25
such objects can be linked. Parent fields are not mandatory here and they can
be multiple layers deep. Addition to it there is no impact on security or
deletion.
Master-Detail Relationship Master-Detail Relationship has to be a Parent-Child
relationship only where Master denotes the Parent and Detail as the child. It
can link up to 2 objects and deleting a Parent field automatically deletes Child
field. A child in one relationship can’t be the parent in any other relationship.
Q4.What is the difference between SOQL and SOSL?
SOQL – Salesforce Object Query Language
Can search one object at a time only
Can be used in Triggers and Classes
DML operations can be performed
All types of fields included
SOSL – Salesforce Object Search Language
Can search multiple objects at a time
Can’t be used with Triggers
DML operations can’t be performed
Works only for email, text and phone types
Q5.How many reports types are there in Salesforce?
There are 4 types of reports in Salesforce that are used to summarize object
information
Tabular Report – for displaying grand total in Table format
Matrix Report – Grouping based on Rows and Columns
Summary Report – Grouping done based on Columns only
Joined Reports – Joining two or more reports
Q6. What is Audit Trail?
Audit Trail is a function that helps track all the changes performed by different
administrators to the Organization in the past 6 months. It covers details such
as Date of changes made Username that made the changes Details of the
changes made
Q7.What Workflow actions can be performed in Salesforce?
Following actions can be performed
Email Alert – Email alerts can be triggered through a template developed by
the Workflow rule and thus send out a list of recipients.
Field Update – Workflow actions to automatically update the value of a field.
This could be a calculated value, blank or populate a specific value. Task –
Allows assigning a task to a user specifying Subject, Status, Priority and Due
Date.
Outbound message – It triggers a specific information or message shooting to
external services via SOAP messages.
Data Security in Salesforce
What is Data Security?
Data security is concerned with protecting the sensitive information you and
your company store or share with others. Data security is important to every
organisation, and especially critical in regulated industries, such as financial
services, healthcare, and retail. That said, data security isnʼt only about
security measures or tools; itʼs also a state of mind.
To enforce data layers of security at a personal and organizational level,
Salesforce uses three levels of security:
1) Object-level security
2) Field-level security
3) Record-level security
Layer 1: Object-level-security
Before allowing a user access, Salesforce first verifies that the user has
permissions to see objects of that type. Object-level access can be managed
through two configurations, profiles and permission sets.
Important notes
Object level Security (OLS)
In OLS when for particular profile like sales order profile when we give custom
object permission as read it will show only the particular object name not show
any new edit or delete option in that object if we give READ, CREATE, EDIT and
DELETE option for particular profile of the user can able to delete only the
record created by them not able to delete the other user created one like
admin created things.
Apex Trigger: Concepts and Notes
Trigger is piece of code that is executes before and after a record is
Inserted/Updated/Deleted from the force.com database.
Triggers are written in Apex, a programming language developed by Salesforce.
Key Concepts of Apex Triggers
1. Trigger Events: Triggers can execute at specific points in the lifecycle of a
record.
There are two categories of trigger events:
o Before Triggers: Used to update or validate record values before they
are saved to the database.
o After Triggers: Used to perform operations (like sending emails or
making changes to related records) after the record has been saved
Types of Triggers:
o Before Insert
o After Insert
o Before Update
o After Update
o Before Delete
o After Delete
o After Undelete
Before Insert?
We can execute the complex business logics and Complex validation rules
before inserrting the record into the object, which can be fired based on
"Before Insert" event.
Ex: Validation Rules, etc.
After Insert?
By using this event, we can fire the actions which contains the business logic to
be performed after inserting a new record.
Ex: Sending Email Notifications, etc
Collection (List, Set, Map) in Apex
List --> It is basically ordered list and it contain duplicate values and we can
access the element using index.
Example --> There are different ways of adding the value in List
Syntax of creating a list in apex
List<Integer> exampleList = new List<Integer>();
List<String> exampleList = new List<String>{‘a’,’b’,’c’};
A). Add the element in list with simple way
Example of List of integer
List<Integer> intList = new List<Integer>{1, 2,3,4,5};
system.debug('Integer List'+ intList);
Example of List of String
List<String> strList = new List<String>{'Sales Cloud', 'Service Cloud',
'Experience Cloud', 'Data Cloud', 'Financial Service Cloud'};
system.debug('String List'+ strList);
Salesforce Interview Questions and Answers Related to Batch Apex,
Queueable Apex, Scheduled Apex, and Future Methods:
Batch Apex:
1. What is Batch Apex in Salesforce?
- Batch Apex is used to process large sets of data asynchronously in smaller
batches to avoid governor limits.
2. When would you use Batch Apex instead of other Apex methods?
Batch Apex is used when you need to process large data sets (over 50,000
records) and need to bypass the synchronous execution time limits.
3. Explain the execution flow of Batch Apex.
- The execute method is called for each batch of records, and the finish
method is called after all batches are processed.
4. How do you specify the batch size in Batch Apex?
- The batch size is automatically determined by Salesforce, but you can specify
the batch size using the optional "scope" parameter in the
Database.executeBatch method.
5. How can you handle errors in Batch Apex?
- You can implement the Database.RaisesException interface and handle
exceptions using try-catch blocks in the execute method.
Queueable Apex:
6. What is Queueable Apex in Salesforce?
- Queueable Apex is used to perform asynchronous processing of complex or
long running operations by adding them to the Apex job queue.
7. What are the advantages of Queueable Apex over Batch Apex?
Queueable Apex has a more flexible execution flow, doesn't have limitations
on the number of records, and can be chained for complex processes
Difference between with sharing and without sharing?
• "with sharing" keyword in apex class so that it will enforce only sharing rules
of current user but not, object permissions, field level permissions
• But “without sharing” will not enforce only sharing rules of current user.
does it mean it will enforce current user object and field level permissions.
Can we show error message using future method?
• No you cannot show error message using future method, however you can
store error response in a field or can send email
We have two team service team and sales team, and we have 15 fields in
Account object and want to show 10 fields to service team and 5 fields to
sales team, how will you do this?
To achieve this in Salesforce, you can use Field-Level Security (FLS) and Page
Layouts. Here's a step-by step approach:
• Create Field Sets:
• Create two field sets, one for the Service Team and one for the Sales Team.
Include the fields that you want to display for each team.
• Set Field-Level Security:
• Go to Setup -> Object Manager -> Account -> Fields & Relationships.
• Set the Field-Level Security for each field to be visible/editable by the
appropriate profiles (Service Team and Sales Team).
• Create Page Layouts:
Go to Setup -> Object Manager -> Account -> Page Layouts.
Create two page layouts, one for the Service Team and one for the Sales Team.
Assign the appropriate field sets to each page layout.
Assign Page Layouts:
Go to Setup -> Object Manager -> Account -> Page Layout Assignments.
Assign the Service Team page layout to profiles belonging to the Service Team.
Assign the Sales Team page layout to profiles belonging to the Sales Team.
By following this approach, you can control which fields are displayed for each
team based on their page layouts and field-level security settings. This allows
you to tailor the Account object's view for the Service
Team and Sales Team according to their specific needs.
Q1. Can you explain the key differences between Aura components and
Lightning Web Components (LWC)?
A1. Aura components are built on the Aura framework, while LWC is built on
modern web standards such as JavaScript and Shadow DOM. LWC offers better
performance, smaller bundle sizes, and enhanced developer productivity.
Unlike Aura, LWC follows a lightweight, standards-based approach, making it
easier to learn and develop with.
Q2. How do you define a Lightning Web Component? What are its main
components?
A2. A Lightning Web Component is a custom element in the HTML DOM tree
that encapsulates reusable UI elements and behavior. It consists of three main
components: the HTML template, JavaScript class, and optional CSS styles. The
template defines the structure and layout, the JavaScript class handles the
component's behavior and data, and the CSS styles define the component's
appearance.
Example:
//html
<
template>
<
p>Hello, Lightning Web Component!</p>
<
/template>
JavaScript class:
import { LightningElement } from 'lwc';
export default class MyComponent extends LightningElement {
// Component logic goes here
}
Q3. What is the role of the XML file (metadata file) in a Lightning Web
Component?
A3. The XML file, also known as the metadata file, defines the configuration
and metadata for a Lightning Web Component. It contains information like the
component's name, description, target config, and access settings. The
metadata file plays a crucial role in deploying and managing the component in
a Salesforce org.
Q4. How do you communicate between Lightning Web Components using
events?
A4. LWC uses events for inter-component communication. Components can
fire events that other components can listen to and respond accordingly.
There are two types of events:
Component events and custom events.
Component events are fired by standard components, while custom events are
specific to your Lightning
Web Component.
Example:
Parent Component:
//html
<template>
</template>
c-child-component oncustomclick={handleCustomClick}></c-child-component>
Child Component:
//html
<
template>
<
<
lightning-button label="Click Me" onclick={handleButtonClick}></lightning-
button>
/template>
JavaScript class of Child Component:
import { LightningElement } from 'lwc';
export default class ChildComponent extends LightningElement {
handleButtonClick() {
const customEvent = new CustomEvent('customclick');
this.dispatchEvent(customEvent);
}
}
```
Q5. What is the purpose of the @api decorator in LWC? How is it used?
A5. The @api decorator exposes properties and methods of a Lightning Web
Component to other components. It allows the properties to be set or
accessed externally, promoting component composition and reusability. Other
components can access the public properties using the dot notation or curly
braces in the markup.
Example:
//html
<!-- Parent Component -->
<template>
</template>
<c-child-component message="Hello"></c-child-component>
<!-- Child Component -->
<template>
<p>{message}, World!</p>
</template>
JavaScript class of Child Component:
import { LightningElement, api } from 'lwc';
export default class ChildComponent extends LightningElement {
@
api message;
}
SOQL in Salesforce
SOQL (Salesforce Object Query Language) is a query language used in
Salesforce to retrieve data from the Salesforce platform's relational database.
Similar to SQL (Structured Query Language) but specifically designed for
Salesforce objects, SOQL allows developers and administrators to query, filter,
and retrieve data stored within Salesforce objects and their fields.
In this , we are gonna discuss Salesforce SOQL Relationship Queries on
standard and custom object.
Introduction relationship Queries.
SOQL Syntax.
SELECT Field List FROM objectname Simple Query
SELECT id ,Name From ACCOUNT
[where conditions] ————- it is used to filter the records in object
Group by fieldname]———→we can group the field by particular name
[order by fieldname s{ASC|DEC we can order the record from
highest to lower
Limit no of record]——————we can limit how much record we want like
first 10 records offset no of record to skip]———————→if we have 100
record ,but we need from 50th record we can use offset
1. There are two types of relationship queries:
1. Parent To Child Relationship
2. Child To Parent Relationship
Q: What is SOQL Query?
A: SOQL (Salesforce Object Query Language) is a query language used to search
and retrieve records from Salesforce objects. It is similar to SQL (Structured
Query Language) and is specifically designed for querying data within the
Salesforce platform.
Q: How can you retrieve all fields from a Salesforce object using SOQL?
A: To retrieve all fields from a Salesforce object using SOQL, you can use the
asterisk (*) symbol in your query. For example, the query "SELECT * FROM
Account" will retrieve all fields from the Account object.
Q: Can you explain the difference between SOQL and SOSL?
A: SOQL (Salesforce Object Query Language) is used to search and retrieve
records from a single Salesforce object at a time. It is similar to SQL and allows
you to perform queries like SELECT, UPDATE, and DELETE on individual objects.
On the other hand, SOSL (Salesforce Object Search Language) is used to
perform text-based searches across multiple objects simultaneously. It allows
you to search for a specific term or phrase across different object types and
returns a list of records that match the search criteria.
Q: How can you filter records based on a specific condition in SOQL?
A: You can filter records based on a specific condition in SOQL by using the
WHERE clause in your query.
The WHERE clause allows you to specify the conditions that must be met for a
record to be returned in the query results. For example, the query "SELECT
Name FROM Account WHERE Industry = 'Technology'" will retrieve the names
of all accounts in the Technology industry.
Q. What is Single Sign On?
Ans -- > Single sign-on (SSO) allows users to access multiple applications with a
single set of credentials. They do not need to remember separate user
ID/password for each application.
Salesforce offers various options for configuring single sign-on. This also
includes:
• Federated Authentication using SAML
• Delegated Authentication
• OpenID Connect
Q. What is Identity Provider?
We need to enable SAML in single sign on setting
Ans--> IdP stands for Identity Provider and SP stands for Service Provider.IdP is
the system that authenticates user by validating the username and password
and then subsequently all other applications trust IdP and allow user to access
the application if the IdP asserts that the user is a valid user. IdP is the system
that stores user’s login name and password.
Q. What is Service Provider?
Ans --> A service provider is a website that hosts apps. A Service Provider (SP)
is the entity providing the service, typically in the form of an application.Let
suppose we are accessing the google’s credential to login salesforce org so
Salesforce will be the Service Provider and Google will be the Identity provider
because Google will validate the user and salesforce will give the service for
doing work.
Q. What is Salesforce Integration?
Ans--> Salesforce Integration is a process of connecting two or more
applications.
Q. What are the Salesforce Integration Direction?
Ans--> Integration can be two direction inbound integration or outbound
Integration.
Inbound Integration: An external system initiates contact with Salesforce.
Outbound Integration: Salesforce initiates contact with an external system.
Q. What is outbound and inbound Integration in Salesforce?
Ans - >
Inbound Web Service:
Inbound web service is when Salesforce exposes SOAP/REST web service, and
any external/third party application consume it to get data from your
Salesforce org. It is an Inbound call to Salesforce, but outbound call to the
external system. Here, Salesforce is the publisher and external system is the
consumer of web services.
Outbound Web Service:
Outbound web service is when Salesforce consume any external/third party
application web service, a call needs to send to the external system. It is an
Inbound call to the external system, but outbound call to Salesforce. Here,
external system is the publisher of web services and Salesforce is the consumer