Platform Developer 1 Practice Questions

These questions are taken from the Platform Developer 1 Certification prep module on Trailhead.  I find that the way the questions are laid out make it a tad hard for studying.

Fundamentals and Database Modeling

  1. What is a correct pattern to follow when programming in Apex on a multi-tenant platform?

A) Use the with sharing keyword when declaring an Apex class to prevent access from other server tenants

B) Use queries to select the fewest fields and records possible to avoid exceeding governor limits

C) Create Apex code in a separate environment from the schema to reduce deployment errors

D) Run Data Manipulation Language (DML) on one record at a time to avoid possible data concurrency issues

Answer: B

2. Which two types of code represent the controller in model-view-controller (MCV) architecture on the Lightning Platform (select two answers)

A) StandardController system methods that are referred by Visualforce

B) JavaScript that is used to make a menu item display itself

C) A static resource that contains Cascading Style Sheets (CSS) and images

D) Custom Apex and JavaScript code that is used to manipulate data

Answers: A, D

3. A developer wants to list all of the tasks for each account on the Record home page.  When a task is created for a contact, what does the developer need to do to ensure the task displays on the related account record?

A) Create a workflow rule to relate the task to the contact’s account

B) Create an account formula field that displays the task information

C) Nothing.  The task is automatically displayed on the Account page

D) Nothing. The task cannot be related to an account and a contact

Answer: C

4. A developer needs to provide a Visualforce page that lets users enter product specific details during a sales cycle.  Which two ways can the developer accomplish this? (Select two answers)

A) Copy the standard page and then make a new Visualforce page for product data entry

B) Create a new Visualforce page and an Apex Controller to provide product data entry

C) Download a managed package from the AppExchange that provides a custom Visualforce page to modify

D) Download an unmanaged package from the AppExchange that provides a custom Visualforce page to modify

Answers: B, D

5. The sales management team requires that users populate the Lead Source field of a lead record when they convert a lead.  What should a developer create to ensure that users do this?

A) A process in Process Builder

B) A validation rule

C) A formula field

D)  A workflow rule

Answer: B

6. The sales management team hires a new intern.  The intern is not allowed to view opportunities, but needs to see the most recent closed date of all child opportunities when viewing an account record.  What should a developer do to meet this requirement?

A) Create a workflow rule on the Opportunity object that updates a field on the parent account

B) Create a roll-up summary field on the Account object that performs a MAX on the Opportunity Close Date field

C) Create a formula field on the Account object that performs a MAX on the Opportunity Close Date field

D) Create a trigger on the Account object that queries the close date of the most recent opportunities

Answer: B

Logic and Process Automation

  1. What three statements are true regarding cross-object formula fields? (Select three answers)

A) Formula fields can reference fields from master-detail or lookup parent fields

B) Formula fields can reference fields in a collection of records from a child relationship

C) Formula fields can expose data the user does not have access to in a record

D) Formula fields can reference fields from objects that are up to 10 relationships away

E) Formula fields can be used in three roll-up summaries per object

Answers: A, C, D

2. In an organization that has enabled multiple currencies, a developer needs to aggregate the sum of the Estimated_Value__c currency field from the CampaignMember object using a roll-up summary field called Total_Estimated_Value__c on Campaign.  How is the currency of the Total_Estimated_Value__c roll-up summary field determined?

A) The values of CampaignMember.Estimated_Value__c are converted intot he currency on the majority of the CampaignMember records and the sum is displayed using that currency.

B) The values in CampaignMember.Estimated_Value__c are converted into the currency of the current user, and the sum is displayed using the currency on the Campaign record

C) The values in CampaignMember.Estimated_Value__c are converted into the currency of the Campaign record, and the sum is displayed using the currency on the Campaign record

D) The values in CampaignMember.Estimated_Value__c are  summed up and the resulting Total_Estimated_Value__c field is displayed as a numeric field on the Campaign record.

Answer: C

3. In which three locations can you create custom roll-up summary fields using Standard Object relationships? (Select three answers)

A) On account using opportunity records

B) On Quote using order records

C) On Campaign using campaign member records

D) On Account using case records

E) On Opportunity using opportunity product records

Answers: A, C and E

4. An sObject named Application__c has a lookup relationship to another sObject named Position__c.  Both Application__c and Position__c have a picklist field named Status__c.  When the Status__c field on Position__c is updated, the Status__c field on Application__c needs to be populated automatically with the same value, and execute a workflow rule on Application__c.

How can a developer accomplish this?

A) By using an Apex trigger with a DML operation

B) By configuring a cross-object field update with a workflow

C) By changing Application__c.Status__c into a formula field

D) By changing Application__c.Status__c into a roll-up summary field

Answer: A

5. What should a developer do to update a picklist field on related opportunity records when a modification to the associated account record is detected?

A) Create a workflow rule with a field update

B) Create a Visualforce page

C) Create a Lightning Component

D) Create a process with Process Builder

Answer: D

6. When the number of records in a recordset is unknown, which control statement should a developer use to implement a set of code that executes for every record in the recordset, without performing a .size() or .length() method call?

A) do{…} while(condition)

B) while(condition) {…}

C) for(init_stmt; exit_condition; increment_stmt){…}

D) for(variable : list_or_set){…}

Answer: D

7. A developer needs to create records for the object Property__c.  The developer creates the following code block

01 List<property__c> propertiesToCreate = helperClass.createProperties();

02 try{

03

04 }  catch(Exception exp) {

05 // Exception handling

056}

Which line of code should the developer insert at line 03 to ensure that at least some records are created, even if a few have failed

A) insert propertiesToCreate;

B) Database.insert(propertiesToCreate, false);

C) Database.insert(propertiesToCreate,System.ALLOW_PARTIAL);

D) Database.insert(propertiesToCreate);

Answer: B

8. A developer in a Salesforce org with 100 accounts executes the following code using the Developer Console.

Account myAccount = new Account(Name=’MyAccount’);

insert(myAccount);

for(Integer x = 0; x < 150; x++)

{

Account newAccount = new Account(Name=’myAccount’ + x);

try{

insert newAccount;

} catch(Exception ex) {

System.debug(ex);

}

}

insert new Account(Name=’MyAccount’);

How many accounts are in the org after this code is run?

A) 100

B) 101

C) 102

D) 252

Answer: A

9. Which two statements should a developer avoid using inside procedural loops? (Select two answers)

A) List<Contact> contacts = [SELECT id, salutation, firstname, lastname, email from COTNACT where accountId = :a.Id];

B) update contactList;

C) if(o.accountid == a.id)

D) System.debug(‘Amount of CPU time (in ms) used so far: ‘ + Limits.getCpuTime());

Answers: A,B

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.