Salesforce

Certified Platform Developer II practice test

Practice with 15 free Testara sample questions, or choose paid access to the full 173-question bank.

Provider
Salesforce
Question bank
173
Free sample
15 questions
Publisher
Testara

About this practice material

This page covers Testara's practice question bank for Certified Platform Developer II, a certification listed under Salesforce. Questions use original, exam-style scenarios and are not questions from the official certification exam.

Testara is an independent practice platform and is not affiliated with, endorsed by, or authorized by Salesforce. The certification credential is issued by Salesforce, not Testara. Certification and provider names belong to their respective owners.

Start practicing

The guest demo does not save an attempt. Sign in before buying access.

Try 15 questions free

Available without signing in

Free sample questions

These 15 questions and their explanations are server-rendered so you can inspect the material before opening the interactive demo.

  1. Question 1 · 1

    A company's support process dictates that any time a Case is closed with a Status of 'Could not fix', an Engineering Review custom object record should be created and populated with information from the Case, the Contact, and any of the Products associated with the Case. What is the correct way to automate this using an Apex trigger?

    Choose one answer.

    • An after update trigger that creates the Engineering Review record and inserts it
    • A before update trigger that creates the Engineering Review record and inserts it
    • An after upsert trigger that creates the Engineering Review record and inserts it
    • A before upsert trigger that creates the Engineering Review record and inserts it
  2. Question 2 · 1

    Which statement is true regarding the use of user input as part of a dynamic SOQL query?

    Choose one answer.

    • Free text input should not be allowed, to avoid SOQL injection
    • The String.format() method should be used to prevent injection
    • Quotes should be escaped to protect against SOQL injection
    • The string should be URL encoded by the input form to prevent errors
  3. Question 3 · 1

    A developer needs to design a custom object that will be integrated into a back-end system. What should the developer do to ensure good data quality and to ensure that data imports, integrations, and searches perform well? (Choose two.)

    Choose all answers that apply.

    • Configure a custom field as unique
    • Configure a custom field as indexed
    • Configure a custom field as external ID
    • Configure a custom field as Salesforce ID
  4. Question 4 · 1

    A developer encounters an error that states that the Apex heap size is exceeded. Which technique may reduce heap size?

    Choose one answer.

    • Add the transient keyword to the variable definition
    • Move the variable definition inside the scope of the function
    • Use static variables instead of instance variables
    • Use SOQL for loops instead of standard SOQL queries
  5. Question 5 · 1

    A developer has a Debug method within a class, which is invoked hundreds of times. What is the optimal functionality in the Developer Console to count the number of calls made to the method?

    Choose one answer.

    • The "Execution Log" Panel
    • The "Execution Stack" Panel
    • The "Executed Units" tab under the Execution Overview Panel
    • The "Execution Tree" tab under the Stack Tree Panel
  6. Question 6 · 1

    A custom field Exec_Count_c of type Number is created on an Account object. An account record with value of "1" for a: Exec_Count_c is saved. A workflow field update is defined on the Exec_Count_c field, to increment its value every time an account record is created or updated. The following trigger is defined on the account: trigger ExecOrderTrigger on Account (before insert, before update, after insert, after update){ for (Account accountInstance: Trigger.New){ if (Trigger . isBefore){ accountInstance Exec_Count_c += 1; } System. debug (accountInstance.Exec_Count_c); } }

    Choose one answer.

    • 1, 2, 3, 3
    • 1, 2, 3, 4
    • 2, 2, 4, 4
    • 2, 2, 3, 3
  7. Question 7 · 1

    A company processes Orders within their Salesforce instance. When an Order's status changes to 'Paid' it must notify the company's order management system (OMS). The OMS exposes SOAP web service endpoints to listen for when to retrieve the data from Salesforce. What is the optimal method to implement this?

    Choose one answer.

    • Generate the Enterprise WSDL and use it to make a callout to the OMS.
    • Generate the Partner WSDL and use it to make a callout to the OMS.
    • Create an Outbound Message that contains the session ID and send it to the OMS.
    • Create an Apex trigger and make a callout to the OMS from the trigger.
  8. Question 8 · 1

    A developer is building a Visualforce page that interacts with external services. Which interface should the developer implement to test this functionality? (Choose two.)

    Choose all answers that apply.

    • HTTPCalloutMock
    • HTTPRequestMock
    • HTTPResponseMock
    • StaticResourceCalloutMock
  9. Question 9 · 1

    A developer needs to create a Lightning page for entering Order Information. An error message should be displayed if the zip code entered as part of the Order's shipping address is not numeric. What is a recommended way for the error message be displayed to the end user?

    Choose one answer.

    • Use the apex:message tag to display errors
    • Use the aura:component tag to display errors
    • Use the ui:outputText tag to display errors
    • Use the ui:inputDefaultError tag to display errors
  10. Question 10 · 1

    A developer is writing unit tests for the following method: public static Boolean isFreezing(String celsiusTemp){ if(String.isNotBlank(celsiusTemp) && celsiusTemp.isNumeric()) { return Decimal.valueof(celsiusTemp) <= 0; } return null; } Which assertion would be used in a negative test case?

    Choose one answer.

    • System.assertEquals(true, isFreezing(null))
    • System.assertEquals (true, isFreezing('0')
    • System.assertEquals(null, isFreezing('asdf'))
    • System.assertEquals(true, isFreezing('IOO'))
  11. Question 11 · 1

    A developer needs to create a service that will process an email sent to it and create an account and contact using the contents of the email as data for the records. How might a developer accomplish this requirement?

    Choose one answer.

    • Use the Apex Inbound Email Handler
    • Use the Fuel API with Email Data Extensions
    • Use Heroku Data Clips to Process Email
    • Use Auto-launched Flow and Process Builder
  12. Question 12 · 1

    How can Apex be used with Visual Workflow?

    Choose one answer.

    • To set the version of a Flow being run
    • To start a Flow automatically
    • To add custom styling to a Flow
    • To control access to a Flow
  13. Question 13 · 1

    An integration user makes a successful login() call via the SOAP API. What can be used in the SOAP header to provide server authorization for subsequent API requests?

    Choose one answer.

    • Named Credentials
    • Session ID
    • OAuth access token
    • Security token
  14. Question 14 · 1

    A customer has a single Visualforce page that allows each user to input up to 1500 sales forecasts and instantly view pivoted forecast calculations. Users are complaining that the page is loading slowly, and they are seeing error messages regarding heap and view state limits. What are three recommendations to optimize page performance? (Choose three.)

    Choose all answers that apply.

    • Segregate calculation functionality from input functionality
    • Specify the list of sales forecasts as transient
    • Implement pagination and reduce records per page
    • Create formula fields to compute pivoted forecast calculations
    • Use JavaScript Remoting instead of controller actions
  15. Question 15 · 1

    A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup. What are three actions to enable this functionality? (Choose three.)

    Choose all answers that apply.

    • Surround the callout with Test.startTest(), Test.stopTest()
    • Surround the data insertion with Test.startTest(), Test.stopTest()
    • Implement the WebServiceMock interface
    • Update code to call Test.setMock()
    • Implement the HttpCalloutMock interface

Each purchase applies to this certification. Prices are one-time payments, not monthly subscriptions.

Starter

$29 USD one time

Full access to one certification's question bank in standard practice mode for 60 days.

  • Full question bank for one certification
  • 60 days of access
  • Standard practice mode
  • Question notes and community discussions
  • Attempt scores and answer review

Professional

$49 USD one time

Full access to one certification's question bank, custom test controls and advanced analytics for 60 days.

  • Custom test builder
  • Timers and question selection
  • Randomized question and answer order
  • Advanced performance and weak-question analytics
  • Priority customer support
Try 15 questions free