10 free sample questions from a bank of 484, with the correct answers and explanations. No signup required — start practising right now.
1Which statement results in an Apex compiler error?
Map lmap = new Map ([Select ID from Lead Limit 8]);
Date d1 = Date.Today(), d2 = Date.ValueOf('2018-01-01');
Integer a=5, b=6, c, d = 7;
List s = List {'a','b','c');
Answer: D
2A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage. Production data is not required for the integration testing.
Which two environments meet the requirements for testing? (Choose two.)
Developer Sandbox
Full Sandbox
Developer Edition
Partial Sandbox
Developer Pro Sandbox
Answer: B, D
3A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a Visualforce page for shoppers.
Which field type should the developer choose to ensure that the description will be searchable in the custom Apex SOQL queries that are written?
Text Area
Text
Text Area (Long)
Text Area (Rich)
Answer: A
4A developer wants multiple test classes to use the same set of test data.
How should the developer create the test data?
Reference a test utility class in each test class.
Define variables for test records in each test class.
Create a Test Setup method for each test class.
Use the SeeAllData=true annotation in each test class.
Answer: A
5A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a
Visualforce page.
Which two actions should the developer perform to get the available picklist values and record types in the controller? (Choose two.)
Use Schema.RecordTypeInfo returned by Opportunity.SObjectType.getDescribe().getRecordTypeInfos().
Use Schema.PicklistEntry returned by Opportunity.SObjectType.getDescribe().getPicklistValues ().
Use Schema.RecordTypeInfo returned by RecordType.SObjectType.getDescribe().getRecordTypeInfos().
Use Schema.PicklistEntry returned by Opportunity.StageName.getDescribe().getPicklistValues ().
Answer: A, D
6In order to override a standard action with a Visualforce page, which attribute must be defined in the tag?
pageReference
override
controller
standardController
Answer: D
7Which feature allows a developer to create test records for use in test classes?
Documents
WebServiceTests
HttpCalloutMocks
Static Resources
Answer: D
8How many levels of child records can be returned in a single SOQL query from one parent object?
1
3
5
7
Answer: C
9Which two declarative process automation features can be directly invoked when a field value changes on a record? (Choose two.)
Cloud Flow Designer flows
Process Builder processes
Validation rules
Workflow rules
Answer: B, D
10How can a developer warn users of SOQL governor limit violations in a trigger?
Use Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit.
Use PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of SOQL queries exceeds the limit.
Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.
Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit.