Certified Platform Developer II Practice Test

Certified Platform Developer II Practice Test practice questions, page 15 of 17, with answer review and explanations.

Question 71

What is a best practice when unit testing a controller? (Choose two.)

  1. Simulate user interaction by leveraging Test.setMock()
  2. Verify correct references by using getURL()
  3. Access test data by using seeAllData=true
  4. Set query parameters by using getParameters().put

Question 72

What Visualforce tag can be used to display custom messages in pages using the Salesforce UI styling for errors, warnings, and other types of messages?

  1. <apex:customMessage>
  2. <apex:error>
  3. <apex:message>
  4. <apex:pageMessage>

Question 73

A developer is working on code that requires a call to an external web service from a batch. How should the developer enable this functionality?

  1. Implement a custom System.CalloutException class
  2. Include Database.AllowCallout() in the class definition
  3. Implement an @future method for the callout, and invoke it from the batch
  4. Specify "callout=true" in the batch implementation

Question 74

A developer must create a custom pagination solution for accessing approximately 2000 records and displaying 50 records on each page. Data from Salesforce will be accessed via an API and not via Apex. How can the developer meet these requirements? (Choose two.)

  1. Use a StandardSetController
  2. Use CURSOR 50 in SOQL queries
  3. Use OFFSET in SOQL queries
  4. Use LIMIT 50 in SOQL queries

Question 75

A developer must create a way for external partners to submit millions of leads into Salesforce per day. How should the developer meet this requirement?

  1. Publicly expose a Visualforce page via Force.com Sites
  2. Create a web service on Heroku that uses Heroku Connect
  3. Host a Web-to-Lead form on the company website
  4. Publicly expose an Apex Web Service via Force.com Sites