Questions Flashcards

1
Q

When should developers use the “with sharing” keyword in Apex classes?
A When they want to bypass sharing rules for the current user
B When they want to enforce CRUD access
C When they want to specify inhereted sharing for the current user
D when they want to determine execution context and enforce permissions, field-level security, and sharing rules

Apex

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

What does the “without sharing” keyword do in the context of Apex classes?
A Enforces sharing rules for current user
B Bypasses sharing rules for current user
C Specifies inherited sharing for current user
D Enforces CRUD access

Apex

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can SOQL injection occur in a Salesforce application?
A By Executing DML Operation
B By using WITH SECURITY_ENFORCED clause in SOQL
C By trusting user input and incorectly halndling it in SOQL
D By Chaning multiple queries together

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What technique is recommended to prevent SOQL injection attacks when using dynamic queries?
A Static queries with bind variables
B Replacing characters in the user input
C Escaping single quotes using string.escapeSingleQuotes()
D Implementing allowlisting for user input

SOQL

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can developers prevent CSRF attacks in their Salesforce Lightning applications?
A By avoiding use of POST and PUT requests
B By relying solely on default Salesforce CSRF tokens
C By usingHTTP GET requests with state changing parameter
D By validation origin header and inmplemeting anti-CSRF tokens

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When is a Lightning page vulnerable to CSRF?
A When it uses of POST and PUT requests
B When server-side DML operations are executed automatically on page-loading events
C When it doesn’t include anti-CSRF tokens in XMLHttpRequests
D When it doesn’t implement allowlisting for Lightning components

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can developers prevent SSRF attacks in Salesforce Lightning applications?
A By avoiding state-changing POST and PUT requests
B Allowing unrestricted access to Internal resources
C Ignoring input validations for user provided values
D Allowlisting permitted URLs for outgoing requests

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which two use cases require a partial copy or full sandbox?
Choose two answers
A. Scalability Testing
B. Development Testing
C. Quality Assurance Testing
D. Batch Data Testing

A

A. Scalability Testing
D. Batch Data Testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In the Lightning Component framework, where is client-side controller logic contained?
Choose one answer
A. Apex
B. Visualforce
C. HTML
D. JavaScript

A

D. JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A developer creates a method in an Apex class and needs to ensure that errors are
handled properly. Which three should the developer use?
Choose three answers
A. ApexPages.addErrorMessage()
B. A custom exception
C. .addError()
D. Database.handleException()
E. A try/catch construct

A

B. A custom exception
C. .addError()
E. A try/catch construct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which two are valid in the where clause of a SOQL query?
Choose two answers
A. A geolocation field
B. An encrypted field
C. An aggregate function
D. An alias notation

A

A. A geolocation field
D. An alias notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the correct way to describe how Model-View-Controller (MVC) architecture is
implemented on the Salesforce platform?
Choose one answer
A. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: sControls
B. Model: Schema Builder; View: List Views; Controller: Setup Console
C. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: Apex
Code
D. Model: Apex Code; View: List Views; Controller: Setup Console

A

C. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: Apex
Code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In which of the following environments can Developers write code? Select all that apply.
Developer edition production org
Enterprise edition production org
Enterprise edition Sandbox org
Professional edition Sandbox org

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can a developer avoid exceeding Governor Limits when using an Apex Trigger? Select all that apply.
By using a helper class that can be invoked from multiple triggers
By using Maps to hold data from query results
By using the Database class to handle DML transactions
By performing DML transactions on lists of Objects

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of these is an accurate statement about “with sharing” keywords? Select all that apply.
Inner classes inherit the sharing setting from the container class
Either inner classes or outer classes can be declared as “with sharing”, but not both
Inner classes do not inherit the sharing setting from the container class
Both inner classes and outer classes can be declared as “with sharing”

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which standard field mandatorily needs to be populated when a developer inserts new Contact records programmatically?
Name
LastName
AccountId
FirstName

A
16
Q

In the given code, from where does the Boolean inherit its value? _x000D_Boolean b = true;
Class
Object
Enum
String

A
17
Q

Which of these is a characteristic of the Lightning Component framework? Select all that apply.
It has an event-driven architecture.
It works with the existing Visualforce pages.
It uses XML as its data format.
It includes responsive components.

A
18
Q

Visualforce components are similar to which type of tag library containing tag namespace prefixes?
ASP tag library
JSP tag library
ASP log file
DL JSP log file

A
19
Q

A developer wants to display all of the available record types for a Case object. The developer also wants to display the picklist values for the Case.Status field. The Case object and the Case.Status field are on a custom Visualforce page. What action can the developer perform to get the record types and picklist values in the controller? Select all that apply.
Use Schema.PickListEntry returned by Case.Status.getDescribe().getPicklistValues()
Use Schema.RecordTypeInfo returned by Case.SObjectType.GetDescribe().getRecordTypeInfos()
Use SOQL to query Case records in the org to get all the RecordType values available for Case
Use SOQL to query case records in the org to get all values for the Status picklist field

A
20
Q

On a Visualforce page with a custom controller, by using an ID parameter that is passed in the URL, how should a developer retrieve a record? Select all that apply.
Use the constructor method for the controller
Use the $Action.View method in the Visualforce page
Use the <apex:detail> tag in the Visualforce page
Create a new PageReference object with the Id</apex:detail>

A
21
Q

A Visualforce page has a standard controller for an object that has a lookup relationship to a parent object. How can a developer display data from the parent record on the page?
By adding a second standard controller to the page for the parent record
By using a roll-up summary field on the child record to include data from the parent record
By using SOQL on the Visualforce page to query for data from the parent record
By using merge field syntax to retrieve data from the parent record

A
22
Q

What is the preferred way to reference web content such as images, stylesheets, JavaScript, and other libraries that is used in Visualforce pages?
Uploading the content as a Static Resource
Accessing the content from a third-party CDN
Uploading the content in the Documents tab
Accessing the content from Chatter Files

A
23
Q

The Review__c object has a lookup relationship with the Job_Application__c object. The Job_Application__c object has a master-detail relationship with the Position__c object. The relationship field names are based on the auto-populated defaults. What is the recommended way to display field data from the related Review__c records on a Visualforce page for a single Position__c record?
A Utilize the Standard Controller for Position__c and expression syntax in the Page to display related Review__c data through the Job_Application__c object
B Utilize the Standard Controller for Position__c and cross-object Formula Fields on the Job_Application__c object to display Review__c data
C Utilize the Standard Controller for Position__c and cross-object Formula Fields on the Review__c object to display Review__c data
D Utilize the Standard Controller for Position__c and a Controller Extension to query for Review__c data

A
24
Q

Which of these statements are true about the “view state” inspector? Select all that apply.
Shows components contributing to view state
Must be enabled on a user profile
Is displayed only when using <apex: form>
Is controlled by the Role Hierarchy

A
25
Q

What type of a programming language is Apex? Select all that apply.
Object-oriented
On-Demand
Water-Fall
Declarative-Specific

A
26
Q

A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for this object. What happens when a user updates the record?
No changes are made to the data.
The Workflow Rule is fired more than once.
Both the Apex Trigger and Workflow Rule are fired only once.
The Apex Trigger is fired more than once.

A
27
Q

A developer needs to automatically populate the ReportsTo field in a Contact record based on the values of the related Account and Department fields in the record. Which type of Trigger would the developer create? Select all that apply.
Before insert
After update
After insert
Before update

A
28
Q

Object B has a Master-Detail relationship to Object A, therefore A is parent of B. You goal is to display the picklist field “Type” that is on A, into B. What is the best way to do that?
A Using Formula Field on Object A
B Using Formula Field on Object B
C Using Roll-up Summery field on Object A
D Using Roll-up Summery field on Object B

A

B

29
Q

How can you describe the MVC (Model-View-Controller) design pattern use in Salesforce?
A:
Model the Object Page Layout that is used to build the model of the page
View: the page displaying these Objects’ fields
Controller: the Object setup menu page responsible of setting up the Object
B:
Model: Schema Builder that is used to edit and create Objects
View: the List View present on each Object landing page
Controller: the List view setup page
C:
Model the Object in question
View: the List View present on each Object landing page
Controller: the List view setup page
D:
Model: Standard and Custom Objects
View: the page displaying these Objects’ fields
Controller: the Apex code responsible of getting Object data to the display page and setting Object data

A

D

30
Q

Cross-Object Formula Fields can:
A Reference fields from Parent Objects set through a Master-Detail relationship only
B Reference fields from Parent Objects set through a Lookup relationship only
C Reference fields from Parent Objects set through either a Master-Detail or a Lookup relationship.
D Reference fields from the same Object only

A

C

31
Q

Your Manager asked you to deploy a full-fledged quoting and pricing Salesforce functionality that includes Discounts, Margins…etc. What is the best way to achieve this?
A Use the Process Builder to build this
B Search for such App in the AppExchange
C Use Visual Workflow to build this
D Use the built-in Products and Quote Objects

A

B

32
Q

What are the implications of Salesforce use of multitenant environment?
A You should avoid using Salesforce in peak time as it is slower than usual because everybody is using it
B There are Governor Limits imposed by Salesforce on each Org to prevent consuming the Instance resources
C Resources are added to the Instance whenever needed, so you should not worry about resource consumption
D Multitenant means that your Org gets its own Instance with all of its resources dedicated to your Org

A

B

33
Q

In Salesforce’s multitenant environment:
A You Org shares a Salesforce Instance with thousands of other Orgs
B You Org has its own Salesforce Instance
C Your Org shares a Salesforce Instance with no more than 10 other Orgs
D All Salesforce Orgs use the same Salesforce Instance

A

A

34
Q

A Formula Field is set:
A Once every hour
B Once every 24 hours
C Only when you write the record in question
D Every time you read the record in question

A

D

35
Q

How should you build a Managed Package?
A In Salesforce Developer’s Edition Sandbox
B In Developer’s Edition Salesforce Org
C In Salesforce’s Org Sandbox
D In Enterprace Edition Salesforce Org

A

B

36
Q

Your Manager asks you to create a workflow that automates any Leave Request. There should be 2 level of acceptance before a Leave is marked as “Accepted”: Direct Manager acceptance, and then HR Manager acceptance. How can you do that?
A Flow
B Workflow Rule
C Process Builder
D Approval Process

A

D

37
Q

Your Manager asked you to build an App to be sold in the AppExchange. The App should be controlled, and its source code should remain closed. What should you do?
A Build Managed Package In Salesforce Developer’s Edition Sandbox
B Build Unmanaged Package In Salesforce Developer’s Edition Sandbox
C Build Unmanaged Package In Salesforce Developer Edition
D Build Managed Package In Salesforce Developer Edition

A

D

38
Q

In Salesforce’s multitenant environment, what is an Instance?
A. An Instance is is an environment type of your Org: Production or Sandbox
B. An Instance is you Org that is identified by Org Id
C. An Instance is a Salesforce server, storage and network that are responsible of running your Org
D. An Instance is a group of all your related Orgs

A

C