0% found this document useful (0 votes)
21 views4 pages

Qand A

The document contains a series of multiple-choice questions related to Salesforce development practices, including test class setup, data insertion, trigger behavior, multi-tenant considerations, PDF generation, user input sanitization, performance optimization, and executing anonymous Apex code. Each question presents scenarios and asks for the best practices or correct methods to achieve desired outcomes in Salesforce. The questions cover a range of topics essential for Salesforce developers to understand and apply in their work.

Uploaded by

eashwarguru
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)
21 views4 pages

Qand A

The document contains a series of multiple-choice questions related to Salesforce development practices, including test class setup, data insertion, trigger behavior, multi-tenant considerations, PDF generation, user input sanitization, performance optimization, and executing anonymous Apex code. Each question presents scenarios and asks for the best practices or correct methods to achieve desired outcomes in Salesforce. The questions cover a range of topics essential for Salesforce developers to understand and apply in their work.

Uploaded by

eashwarguru
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/ 4

1.

Question

A developer wishes to streamline the setting up of data for their test class. How could this be
achieved? (Select 2)

A. Create a class specifically to create data for test methods


B. Utilise the @isTest(SeeAllData=true) annotation
C. Add a @TestSetup annotated method to the class
D. Use the @isTest(isParallel=true) annotation

2. Question

An integration is to be built which inserts Leads into your company’s Salesforce instance in bulk from
its website daily. Some of the records are spam and do not contain valid field data. Which of the
following statements would facilitate this?

A. insert leads false;


B. Database.insert(leads, false);
C. Database.insert(leads, true);
D. Database.insertPartial (leads, false);

None of the above

3. Question

A developer wishes to write a test for a private method within a class, how can this be best
achieved?

A. Write a test which executes the public method which calls the private method to be tested
B. Annotate the private method with @TestVisible
C. Annotate the test class with @Istest(seePrivate=true)
D. Change the access modifier to be public

4. Question

Which of the following snippets can be used to obtain the Stage picklist values on the Opportunity
object?

A. Opportunity.StageName.getDescribe().getPicklistValues();
B. Opportunity.StageName.getMetadata().getPicklistMetadata();
C. Opportunity.StageName.getDescribe().getPicklistDescribe ();
D. Opportunity.StageName.getDescribe().getPicklistOptions();

5. Question

What is the maximum number of records that can be processed by a trigger at a time?

A. 100
B. 200
C. 1000
D. 2000
E. Unlimited
6. Question

A Lead has been converted to a Contact and Account, which triggers are fired?

A. Only triggers on Contact


B. Only triggers on Account
C. Only triggers on Lead
D. Triggers on Lead, Contact and Account
E. Triggers on Contact and Account

7. Question

What considerations must a developer make when working in a multi-tenant environment?

1. Data must be encrypted to prevent other tenants from reading it

2. Apex code must be optimised to be performant

3. Running processes can be terminated by the platform if they exceed governor limits

1 and 2

2 and 3

8. Question

You have been requested to generate a simple PDF displaying line items for an Opportunity. How
can you best achieve this?

A. Search for an App on the AppExchange


B. Create a Visualforce page with ‘renderAs=”pdf”’
C. Create a Lightning Web Component and call the renderAsPdf() method
D. Use a third party API

9. Question

You have an @AuraEnabled method which accepts an SObject from a Lightning Component which
will be inserted, how can you easily sanitise the user’s input?

A. There is no need, @AuraEnabled method automatically enforce FLS


B. Use the Database.insertSecure() method
C. Use the DescribeSObjectResult to check the user permissions for each populated field on the
SObject
D. Use the Security.stripInaccessible() method
9. Question

You have an @AuraEnabled method which accepts an SObject from a Lightning Component which
will be inserted, how can you easily sanitise the user’s input?

1. There is no need, @AuraEnabled method automatically enforce FLS


2. Use the Database.insertSecure() method
3. Use the DescribeSObjectResult to check the user permissions for each populated field on the
SObject
4. Use the Security.stripInaccessible() method

10. Question

A developer has an @AuraEnabled method that is frequently used in several Lightning Web
Components. It performs some complex calculations based on data stored within custom metadata.
Unless these values change, this method will always return the same result. How can the developer
improve the runtime performance of Lightning Components utilising this method?

A. Use the Platform Cache to store the computed value


B. Modify the method to be @AuraEnabled(cacheable=true)
C. Create an ECMAScript Module component to manage calling and caching the response
D. Before calling the apex method in the LWC, call “.setStorable()” on it

11. Question

You are working for a server installation provider and have been requested that whenever an
Opportunity is created with a value over £10000 to enforce that there has been a Site Review record
created before allowing the Opportunity stage to be set to Closed Won. How best can this be
achieved?

A. Use an Apex trigger and use the setError() method if the criteria hasn’t been met
B. Use an Apex trigger and use the addError() method if the criteria hasn’t been met
C. Use a validation rule which is trigger if the criteria hasn’t been met
D. Use a record triggered Flow with the “Add Error” action

12. Question

How can a developer execute an anonymous block of Apex code? (Choose 3)

A. Use the “Execute Anonymous” functionality of the Developer Console


B. Use the “Execute Anonymous” functionality within the Setup area
C. Utilise the REST API “executeAnonymous” endpoint
D. Use the Salesforce CLI “force:apex:execute” command
E. Use the Salesforce CLI “force:apex:execute:anonymous” command
F. Write a class with the @Anonymous annotation
13. Question

What is the result if the following trigger is executed for 50 records?

A. The records are updated to have the MyField__c value of “TRUE”


B. The first record is updated to have the MyField__c value of “TRUE”
C. A runtime exception is thrown
D. The code will not compile

14. Question

Which of the following statements should be added to the following for loop to exit the loop – on
line 10 – when a matching record is first found?

A. break;
B. exit;
C. continue;
D. goto start;

You might also like