KEMBAR78
SFDC Notes - Int Ques | PDF | Database Transaction | Encryption
0% found this document useful (0 votes)
10 views11 pages

SFDC Notes - Int Ques

Uploaded by

yyam24003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views11 pages

SFDC Notes - Int Ques

Uploaded by

yyam24003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Here are some common Salesforce 3.

What are the best practices for


Intermediate Developer interview writing efficient Apex code?
questions along with sample answers
Answer:
to help you prepare:
 Bulkify your code: Always use
1. What are Governor Limits in
collections (lists, maps, sets) to
Salesforce?
handle multiple records at once.
Answer: Governor limits are
 Avoid SOQL/DML inside
Salesforce's way of ensuring that
loops: Performing SOQL or DML
resources are fairly distributed across
operations inside a loop can
multiple tenants. For example, there's
easily cause governor limit
a limit on the number of SOQL queries,
violations.
DML statements, and heap size that
can be used in a transaction.  Use @future or Batch Apex:
Exceeding these limits will cause the For long-running or complex
transaction to fail. Some common operations, defer execution
limits are: using asynchronous processing
(e.g., future methods, batch
 100 SOQL queries per
Apex).
transaction.
 Query selective fields: Always
 150 DML statements per
query only the fields needed to
transaction.
improve performance.
 6MB synchronous heap size
 Test classes with >75%
limit.
coverage: Ensure your test
2. Explain the difference between classes have good coverage,
before and after triggers in including edge cases, and
Salesforce. handle bulk and single-record
scenarios.
Answer:
4. How would you implement a
 Before triggers are used to
trigger to handle both insert and
validate or modify data before it
update operations?
is saved to the database. It is
ideal for scenarios where you Answer: A trigger can handle multiple
need to make changes to the contexts (insert, update, delete) in the
same record being triggered. same block by using the
Trigger.isInsert and Trigger.isUpdate
 After triggers are executed
context variables. Here's an example:
after the record has been saved
to the database, and they're apex
often used to update related
Copy code
records or execute actions that
depend on the record's ID (e.g., trigger AccountTrigger on Account
sending an email or making an (before insert, before update) {
external call).
if (Trigger.isInsert) {
// Handle insert logic  SOSL (Salesforce Object
Search Language): Used to
}
search text across multiple
if (Trigger.isUpdate) { objects and fields. It's faster for
broad searches. Example: FIND
// Handle update logic 'Acme' IN ALL FIELDS
} RETURNING Account(Name),
Contact(Name)
}
7. Explain the role of
5. What is a Visualforce page, and Test.startTest() and
when would you use it over Test.stopTest() in unit tests.
Lightning components?
Answer:
Answer: Visualforce is a framework
for building custom user interfaces in  Test.startTest() and
Salesforce. It uses standard web Test.stopTest() are used to
technologies like HTML, CSS, and separate the test setup logic
JavaScript, but it's tied to Salesforce's from actual test execution in
server-side architecture. Salesforce unit tests.

 You might use Visualforce when  StartTest: Marks the beginning


you need to implement custom of the test and allows governor
UI that isn't supported by out-of- limits to be reset, so the code
the-box Salesforce functionality, within this block gets its own
or for older projects where governor limits.
Lightning Components haven’t  StopTest: Executes any
been adopted. asynchronous operations that
 Lightning Components, on were enqueued and marks the
the other hand, are the end of the test.
preferred choice in modern 8. What are sharing rules, and
Salesforce development due to how do they differ from object
their client-side architecture, permissions?
flexibility, and performance.
Answer:
6. What is the difference between
SOQL and SOSL?  Object permissions define the
baseline access level for a user
Answer: to objects (View, Edit, Delete,
 SOQL (Salesforce Object etc.).
Query Language): Used to  Sharing rules extend the
fetch data from a single object access for individual records to
or multiple related objects. It is specific users or groups,
similar to SQL. Example: overriding the object-level
SELECT Id, Name FROM Account permissions. This is useful for
WHERE Name = 'Acme' scenarios where certain records
should be shared with users
who otherwise wouldn't have  Batch Apex: Processes large
access based on object data sets asynchronously, in
permissions. chunks.
9. What is a wrapper class, and  Queueable Apex: Similar to
how is it used in Salesforce? future methods but provides
more flexibility and allows
Answer: A wrapper class is a custom
chaining of jobs.
class that encapsulates multiple types
of data. It is often used to group  Scheduled Apex: Used to
related objects or data that aren’t schedule a class to run at a
related through the Salesforce data specific time.
model but are needed together in
These questions cover a broad range
some operation. Example:
of topics, and practicing your answers
apex will help prepare you for an
intermediate-level Salesforce
Copy code
developer interview.
public class MyWrapper {
4o
public Account acc { get; set; }
You said:
public Boolean isChecked { get; set;
salesforce admin interview questions
}
ans intermediate
public MyWrapper(Account a,
ChatGPT said:
Boolean check) {
ChatGPT
acc = a;
Here are some Salesforce
isChecked = check;
Intermediate Admin interview
} questions along with sample answers
to help you prepare:
}
1. What is the difference between
10. Explain what asynchronous a Profile and a Role in Salesforce?
Apex is and give examples.
Answer:
Answer: Asynchronous Apex allows
you to run processes in the  Profile: Controls what users
background without holding up the can do within Salesforce (e.g.,
execution of a transaction. It’s useful object permissions, field-level
for long-running operations or security, page layouts, etc.).
operations that need to run Every user is assigned one
independently. profile.

 @future methods: Run in a  Role: Controls the visibility of


separate thread and can be records within an organization’s
used to make callouts or hierarchy. It helps define what
perform heavy computations. records users can see based on
their role in the hierarchy,
particularly when sharing within the same Salesforce org that
settings are set to "Private." need to capture different information
for the same object. Example: Sales
2. Explain the use of Permission
and Support teams might need
Sets and when to use them.
different fields or layouts on the
Answer: Permission Sets are used to Account object. Using record types,
extend permissions to individual users you can show the Sales team one
or groups of users without changing layout and the Support team another.
their profiles. Use them when you
5. Explain the difference between
want to grant additional permissions
Workflow Rules and Process
for specific tasks or objects without
Builder.
modifying the profile, such as giving
access to an app or field to specific Answer:
users.
 Workflow Rules: They
3. What are Organization-Wide automate standard internal
Defaults (OWD) and how do they processes in Salesforce with
work? limited actions (field update,
email alert, task creation, and
Answer: OWD settings define the
outbound message). They are
baseline level of access that all users
older and more basic.
have to records. These settings are
configured per object, and they  Process Builder: It provides
determine if records are visible to more functionality and can
other users. The levels are: automate more complex
processes. It allows multiple
 Private: Users can only view
actions in a single process,
and edit records they own.
supports time-based actions,
 Public Read Only: Users can and can update related records,
view all records but only edit invoke flows, and trigger
their own. approval processes. Example:
With Process Builder, you can
 Public Read/Write: Users can update multiple child records,
view and edit all records. OWD whereas Workflow Rules only
settings can be adjusted to support updating the current
more restrictive or open record or its parent.
depending on the organization’s
data-sharing policies. 6. What is a Sharing Rule, and
when would you use one?
4. What are Record Types, and
why would you use them? Answer: Sharing rules are used to
open up access to records based on
Answer: Record Types allow you to record ownership or specific field
offer different business processes, criteria. They provide a way to grant
picklist values, and page layouts to access to groups of users or roles who
different users based on their profiles. otherwise wouldn’t have access due to
They are commonly used when there OWD settings. Example: If OWD is set
are different divisions or departments to "Private" for Opportunities, but you
want certain users to have access to parent is deleted, the child
all opportunities in a specific region, remains intact.
you could use a sharing rule to grant
 Master-Detail Relationship:
this access.
A tightly coupled relationship
7. What is a Junction Object, and where the child record is
when would you use it? dependent on the parent. If the
parent is deleted, the child
Answer: A Junction Object is a custom
record is also deleted (cascade
object used to create many-to-many
delete). Example: An
relationships between two objects. It
Opportunity might have a
has two master-detail relationships,
lookup relationship to a Contact,
typically connecting two objects to
but a Master-Detail relationship
allow for more complex data
with Opportunity Line Items.
relationships. Example: In a
recruitment application, you could 10. How do you set up a
have a Job object and a Candidate Delegated Administrator, and
object, and a junction object called Job what are they used for?
Application that connects multiple jobs
Answer: Delegated Administrators
to multiple candidates.
are users who are assigned to perform
8. How do you control Field-Level certain administrative tasks without
Security in Salesforce? being full Salesforce administrators.
You can configure them by:
Answer: Field-Level Security controls
user access to individual fields. It can  Creating a Delegated
be configured at both the profile and Administration Group.
permission set levels to determine
 Assigning specific roles and
whether a user can view or edit a
users to the group.
particular field on an object.
 Defining what administrative
 Visibility: You can make fields
tasks they can perform, such as
visible or hidden.
creating users, managing
 Editability: You can allow users custom objects, or resetting
to edit certain fields or make passwords. This helps to
them read-only. distribute administrative tasks
among trusted users without
9. What is the difference between
granting them full admin
a Lookup Relationship and a
privileges.
Master-Detail Relationship?
11. What are Validation Rules, and
Answer:
when would you use them?
 Lookup Relationship: A
Answer: Validation Rules ensure data
loosely coupled relationship
integrity by preventing users from
between two objects where the
saving records that do not meet
child object may or may not be
certain criteria. They evaluate the
dependent on the parent. If the
data entered into a record and return
an error if the criteria are not met.
Example: If a user enters a negative sharing. They help simplify the process
value for a discount field, you can use of granting access to records or
a validation rule to prevent the record resources to a defined set of users
from being saved with an error without the need to assign
message like “Discount cannot be permissions individually.
negative.”
15. What is the Recycle Bin in
12. What is a Flow in Salesforce, Salesforce, and how does it work?
and when would you use it?
Answer: The Recycle Bin in Salesforce
Answer: Flows are a powerful holds deleted records for 15 days (for
automation tool in Salesforce that standard users) or 30 days (for
allows you to collect data, update admins). During this time, records can
records, create new records, and more be restored. After this period, records
via a user interface or behind the are permanently deleted and cannot
scenes. Flows can handle complex be recovered. It is useful for undoing
processes that require user input or accidental deletions of important data.
automate processes without the need
These questions touch on key
for coding. Example: You can use a
administrative tasks, data
Flow to guide users through a multi-
management, security, automation,
step data entry process (e.g., creating
and record management skills
a new account and associated
required of an intermediate Salesforce
contacts) or automate a complex
Admin. Preparing for these will help
approval process.
you demonstrate your understanding
13. What are Dynamic Forms, and of the platform and its features during
how do they differ from traditional an interview.
page layouts?
4o
Answer: Dynamic Forms allow you to
How do you troubleshoot and
customize the layout of record pages
resolve Record Access issues in
by placing fields and sections
Salesforce?
anywhere on the page. Unlike
traditional page layouts, which are Answer: Troubleshooting record
static and assigned at the record type access issues involves investigating
and profile level, Dynamic Forms several key areas:
provide more flexibility by allowing
visibility rules to control which fields  Profile settings: Check object-
and sections are displayed based on level permissions to ensure the
criteria like user role, profile, or field user has at least Read access.
values.  Record ownership: Verify
14. What is a Public Group, and whether the user owns the
how can it be used in Salesforce? record or falls under the role
hierarchy where they should
Answer: A Public Group is a collection have access.
of users, roles, and other groups that
you can use for sharing settings,  Sharing settings: Review
reporting, and folder or list view Organization-Wide Defaults
(OWD) to ensure the record records with other users or
visibility aligns with user groups, provided the sharing
expectations. If OWD is too settings allow it.
restrictive, you may need to
 Apex Sharing: Developers can
apply sharing rules.
use Apex code to dynamically
 Manual sharing: Check if any share records.
records have been manually
 Teams (Account,
shared with the user or group.
Opportunity, Case Teams):
 Sharing rules: Investigate any Teams can be added to specific
sharing rules that may grant or records (like opportunities or
restrict access. cases), granting access to users
within that team.
 Teams and Groups: Examine if
the user is part of an account,  Territory Management:
opportunity, or case team, Grants access based on the
which could grant access. territory assignment for users
when territory models are used
 Permission sets: Check if any
in Salesforce.
permission sets or permission
set groups have been assigned What are the best practices for
to the user to give specific managing Profiles and Permission
access. Sets in Salesforce?
2. What are the different ways to Answer:
grant record-level access in
 Profiles: Assign one profile per
Salesforce? Can you explain each
user, focusing on the baseline
in detail?
access they need. Avoid
Answer: creating excessive profiles and
stick to using standard profiles
 Organization-Wide Defaults
when possible.
(OWD): Baseline access levels
(Private, Public Read Only,  Permission Sets: Use
Public Read/Write) applied to all permission sets to grant specific
users for a particular object. additional access without
altering profiles. For example, if
 Role Hierarchy: Grants record
one group of users needs
access to users higher in the
access to a specific app or
role hierarchy. This typically
object, grant it through a
applies to users’ subordinates.
permission set rather than
 Sharing Rules: Used to grant creating a new profile.
additional access to groups of
 Permission Set Groups:
users (e.g., based on ownership
Leverage permission set groups
or certain criteria) when OWD
to bundle multiple permission
settings are restrictive.
sets and assign them to users.
 Manual Sharing: Users can This reduces the administrative
manually share individual
burden of managing many  Mass Data Update Tools: Use
individual permission sets. Mass Data Update tools like
Data Loader, third-party
 Field-Level Security: Apply
applications, or the Salesforce
field-level security at the profile
Bulk API to perform bulk
or permission set level rather
updates, deletions, or inserts of
than on page layouts to
records efficiently.
maintain a clean configuration.
 Archiving Data: Implement a
 Least Privilege: Follow the
strategy for archiving or
principle of least privilege—
deleting old or unnecessary
grant the minimal access
data, either through built-in
necessary to perform tasks and
tools or third-party archiving
add permissions only as
solutions.
needed.
 Data Cleansing Tools:
How do you approach Data
Leverage tools like Salesforce
Management in Salesforce, and
Optimizer, Cloudingo, or
what tools do you use to ensure
DemandTools for data
data quality?
deduplication, cleaning, and
Answer: Data management is critical maintaining data quality.
for maintaining the integrity of
6. Explain the difference between
Salesforce records:
a Workflow Rule, Process Builder,
 Data Import Wizard vs. Data and Flow Builder. When would you
Loader: Use Data Import choose one over the other?
Wizard for small, standard
Answer:
object imports, and Data Loader
for large volumes of data or  Workflow Rules: Simple
when importing custom objects. automation for standard tasks
like field updates, email alerts,
 Duplicate Management:
or task creation. They are
Implement Duplicate Rules and
limited in functionality and can
Matching Rules to detect and
only handle one action at a
prevent duplicate records
time.
during data entry or import.
o When to use: Legacy
 Validation Rules: Use
automation and for very
Validation Rules to enforce data
simple use cases.
integrity at the point of entry,
ensuring data complies with  Process Builder: More
business rules. advanced than Workflow Rules,
allowing for multiple criteria and
 Field History Tracking:
multiple actions. It can update
Enable field history tracking on
related records, trigger flows,
key fields to audit changes and
invoke Apex, and handle more
maintain a log of data
complex processes.
modifications.
o When to use: For most mask sensitive data in non-
use cases where multiple production environments (e.g.,
criteria and actions are sandboxes).
required, and you need to
 Audit Trail: Enable audit trails,
perform actions across
field history tracking, and event
related objects.
monitoring to log user activity
 Flow Builder: The most and changes made to sensitive
powerful automation tool in data.
Salesforce, allowing for complex
 Two-Factor Authentication
logic, user interaction (via
(2FA): Implement 2FA for login
screens), and deep automation
to enhance security.
capabilities like loops, decision
trees, and more. It can perform  Role-Based Access Control:
almost anything Process Builder Use role hierarchies and sharing
and Workflow can, plus a lot settings to ensure that access
more. to records is aligned with user
roles and job responsibilities.
o When to use: For
complex processes that  Compliance Features:
involve user input, Leverage features like Shield’s
complex branching, or Event Monitoring and Platform
when you need to update Encryption to ensure your
multiple objects at once. organization meets regulatory
compliance standards (e.g.,
How would you implement Data
GDPR, CCPA).
Security and Compliance in
Salesforce, especially with respect 8. How would you design a
to sensitive information? complex Approval Process in
Salesforce, and what
Answer: To secure sensitive data and
considerations would you take
maintain compliance:
into account?
 Field-Level Security: Apply
Answer: Designing a complex
field-level security on sensitive
approval process involves:
fields (e.g., Social Security
Number, salary) so only  Define Entry Criteria:
authorized users can view or Determine the specific criteria
edit them. that must be met for a record to
enter the approval process.
 Encrypted Fields: Use
encrypted fields to store  Multi-Step Approvals:
sensitive information. Salesforce Configure multi-step approvals
Shield offers Platform if needed. For example, a Sales
Encryption to encrypt data at Order might require approval
rest and in transit. from a manager, then finance,
and finally legal.
 Data Masking: Use tools like
Salesforce Shield Data Mask to
 Parallel Approval: If multiple  Named Credentials: Use
people can approve or reject at Named Credentials to store
the same stage, set up parallel authentication settings for
approval steps. callouts to external systems,
reducing the need for managing
 Escalation Rules: Establish
sensitive authentication data.
escalation rules to forward
approvals to higher authorities  Shield Platform Encryption:
if no action is taken within a Use encryption to secure
certain time frame. sensitive data transferred
between systems.
 Automated Actions: Set up
actions for approval or rejection  API Rate Limits: Monitor and
(e.g., email notifications, field control API usage to prevent
updates, tasks). overloading or abuse of
Salesforce resources.
 Permissions: Ensure only
authorized users have the  Connected Apps: Implement
ability to submit records for connected apps with
approval or approve/reject appropriate security settings
requests. (e.g., refresh tokens, session
timeouts) to integrate with
 Delegated Approvers: Set up
third-party applications
delegated approvers to handle
securely.
approvals when a primary
approver is unavailable.  Salesforce Shield: Use
Salesforce Shield for
 Email Templates: Create and
monitoring, encryption, and
assign email templates to notify
ensuring compliance for data
users of approval requests and
flowing in and out of Salesforce.
decisions.
10. Can you explain the Salesforce
9. What steps would you take to
Governor Limits and how they
secure integrations between
affect your administrative tasks?
Salesforce and external systems?
Answer: Governor Limits are
Answer: Securing integrations
Salesforce's way of ensuring efficient
involves several key steps:
multi-tenant environment usage. They
 OAuth 2.0: Use OAuth 2.0 for apply to various system resources to
secure authentication between prevent any single user or org from
Salesforce and external monopolizing shared resources:
systems, avoiding the need to
 SOQL Query Limits: You can
store user credentials.
only perform a certain number
 IP Whitelisting: Restrict of SOQL queries per transaction.
access to Salesforce APIs by For example, there is a limit of
whitelisting trusted IP 100 SOQL queries in a
addresses. synchronous transaction.
 DML Statement Limits: There
is a limit of 150 DML operations
in a single transaction.
 Field History Tracking: You
can track up to 20 fields per
object for historical changes.
 Bulk Data Operations: Bulk
updates, deletes, and imports
have governor limits like the
total number of records
processed and batch size limits.
Impact: As an admin, you need
to be mindful of how
automation (e.g., Process
Builder, Flows) and data loads
can hit these limits. When
designing automations or
loading large datasets, it’s
important to ensure the solution
is optimized to stay within these
limits.

You might also like