Questions Flashcards
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
D
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
B
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
C
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
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
D
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
B
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
D
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. Scalability Testing
D. Batch Data Testing
In the Lightning Component framework, where is client-side controller logic contained?
Choose one answer
A. Apex
B. Visualforce
C. HTML
D. JavaScript
D. JavaScript
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
B. A custom exception
C. .addError()
E. A try/catch construct
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 geolocation field
D. An alias notation
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
C. Model: Standard and Custom Objects; View: Visualforce Pages; Controller: Apex
Code
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
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
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”