wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Salesforce - Platform Developer 1 Master Cheat Sheet

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.

What is the correct order for exception handling syntax in Salesforce Apex?

a)

Generic to Specific

b)

Specific to Generic

2.

In the following code snippet, which block is executed regardless of whether an exception is thrown? try { } catch(DmlException e) { // DmlException handling code here. } catch(Exception e) { // Generic exception handling code here. } finally { // Final code goes here }

a)

try

b)

catch

c)

finally

3.

What does the getCause() method return in exception handling?

a)

The error message for the user

b)

The cause of the exception as an exception object

c)

The line number where the exception was thrown

d)

The stack trace as a string

4.

Which method returns the line number from where the exception was thrown?

a)

getMessage

b)

getLineNumber

c)

getStackTraceString

d)

getTypeName

5.

Fill in the blank: The getMessage() method returns the ______ that displays for the user.

a)

error message

b)

success message

c)

warning message

d)

confirmation message

6.

Which method returns the stack trace as a string?

a)

getTypeName

b)

getStackTraceString

c)

getDmlFieldNames

d)

getNumDml

7.

What does the getTypeName() method return?

a)

The number of failed records

b)

The type of exception

c)

The error message

d)

The ID of the failed record

8.

Fill in the blank: The getDmlFieldNames method returns the names of the fields that caused the ______ for the specified failed record.

a)

error

b)

update

c)

success

d)

rollback

9.

Which method returns the ID of the failed record that caused the error for the specified failed record?

a)

getDmlFieldNames

b)

getDmlId

c)

getDmlMessage

d)

getNumDml

10.

Fill in the blank: The getDmlMessage method returns the ______ for the specified failed record.

a)

error message

b)

record ID

c)

success status

d)

timestamp

11.

Which method returns the number of failed records?

a)

getDmlFieldNames

b)

getDmlId

c)

getNumDml

d)

getTypeName

12.

To create a custom exception in Salesforce, which class should you extend?

a)

A) Exception

b)

B) CustomException

c)

C) Error

d)

D) DmlException

13.

Which of the following is NOT a standard trigger event in Salesforce?

a)

before insert

b)

before update

c)

after undelete

d)

before undelete

14.

Fill in the blank: The syntax for a standard trigger in Salesforce is ___

a)

trigger TriggerName on ObjectName (trigger_events) { code_block }

b)

TriggerName trigger on ObjectName (trigger_events) { code_block }

c)

on ObjectName trigger TriggerName (trigger_events) { code_block }

d)

trigger on ObjectName TriggerName (trigger_events) { code_block }

15.

You can use addError(errorMessage) on the Trigger object lists to add an error.

a)

True

b)

False

16.

Which annotation is used to indicate that a class is a test class in Salesforce?

a)

@TestClass

b)

@isTest

c)

@TestMethod

d)

@Test

17.

Fill in the blank: Minimum ____% test coverage is required to deploy to production in Salesforce.

a)

75

b)

50

c)

60

d)

90

18.

All tests must pass in order to deploy to production in Salesforce.

a)

True

b)

False

19.

Which of the following statements is correct about test methods in Salesforce?

a)

Test methods can be non-static

b)

Test methods must be static

c)

Test methods must use the @Test annotation

d)

Test methods must use the @TestClass annotation

20.

Fill in the blank: The test classes don't count towards the ____ org code size limit in Salesforce.

a)

3MB

b)

1MB

c)

5MB

d)

10MB

21.

The tests can have only one Test.startTest() and Test.stopTest() block in Salesforce.

a)

True

b)

False

22.

What is the purpose of using the Schedulable interface in Apex?

a)

To process batches asynchronously

b)

To run Apex code at specific times

c)

To implement triggers

d)

To create custom objects

23.

Which method is required to be implemented when using the Schedulable interface in Apex?

a)

execute

b)

start

c)

run

d)

process

24.

What is the maximum number of classes that can be scheduled at one time using the Schedulable interface in Apex?

a)

100

b)

50

c)

200

d)

500

25.

What does the following CRON expression represent? '0 0 0 15 3 ? 2022;'

a)

Midnight on March 15, 2022

b)

Noon on March 15, 2022

c)

Midnight on January 1, 2022

d)

Noon on January 1, 2022

26.

When Test.StartTest() is used, the job runs immediately instead of waiting for Cron time.

a)

True

b)

False

27.

Which setup item can be used to find currently scheduled jobs in Salesforce?

a)

The Scheduled Jobs setup item

b)

The Workflow Rules setup item

c)

The Data Import Wizard setup item

d)

The Email Templates setup item

28.

What is the default batch size for Apex Batch Processing?

a)

200

b)

100

c)

500

d)

1000

29.

Each batch in Apex Batch Processing is a ______ transaction.

a)

discrete

b)

continuous

c)

shared

d)

dependent

30.

A batch class in Apex must implement which interface?

a)

Database.Batchable

b)

Schedulable

c)

Iterable

d)

Cloneable

31.

What is the maximum number of records that can be returned in the Database.QueryLocator object?

a)

5 million

b)

50 million

c)

500,000

d)

1 million

32.

Batches of records are guaranteed to execute in the order they are received from the start method.

a)

True

b)

False

33.

Fill in the blank: Test methods can execute only ____ batch.

a)

one

b)

two

c)

multiple

d)

zero

34.

Which method is used to execute a batch job in Salesforce Apex?

a)

Database.runBatch

b)

Database.executeBatch

c)

Database.startBatch

d)

Database.processBatch

35.

In the provided code example, what is the purpose of the finish method in the batch class?

a)

The finish method is called after all batches are processed and is used to send confirmation emails or execute post-processing operations.

b)

The finish method is used to initialize the batch class before processing starts.

c)

The finish method is responsible for dividing records into smaller batches.

d)

The finish method is used to handle errors that occur during batch processing.

36.

Which annotation is used to identify methods that run asynchronously in Apex?

a)

@future

b)

@async

c)

@later

d)

@thread

37.

Future Methods in Apex must be static.

a)

True

b)

False

38.

What type can Future Methods return?

a)

String

b)

Integer

c)

Void

d)

Boolean

39.

Fill in the blank: You can't call one ______ method from another in Apex.

a)

future

b)

static

c)

test

d)

private

40.

Which types of arguments are typically used for Future Methods in Apex?

a)

Custom Objects

b)

ID or List

c)

String

d)

Boolean

41.

Future Methods are typically used for ______ to external Web services, Non-Immediate Resource intensive operations.

a)

Callouts

b)

Triggers

c)

Validation Rules

d)

Reports

42.

Queueable Apex is similar to Future Methods but with some extra features. To use Queueable Apex, you must implement the ______ interface.

a)

Queueable

b)

Schedulable

c)

Batchable

d)

Iterable

43.

Your Queueable class can contain member variables of non-primitive data types, such as sObjects or custom Apex types.

a)

True

b)

False

44.

Queueable Apex returns an Id similar to Batch Apex to monitor the ______ Apex Job.

a)

Async

b)

Synchronous

c)

Scheduled

d)

Immediate

45.

Can you chain a Queueable Apex from another Queueable Apex?

a)

Yes

b)

No

46.

Which annotation is used to create a REST resource in Salesforce?

a)

@RestResource

b)

@RestAPI

c)

@Restful

d)

@Resource

47.

What is the base URL for Salesforce REST resources?

a)

https://instance.salesforce.com/services/restapi/

b)

https://instance.salesforce.com/services/apexrest/

c)

https://salesforce.com/api/

d)

https://instance.salesforce.com/rest/

48.

Fill in the blank: In Salesforce, the class must be ______ and the methods must be ______ ______ to create a REST resource.

a)

global, global static

b)

public, public static

c)

private, private static

d)

protected, protected static

49.

In the provided code example, what is the value of 'inventory' in the input JSON?

a)

100

b)

1000

c)

10

d)

750

50.

The workbench can be used to test REST APIs in Salesforce.

a)

True

b)

False

51.

In order to use a Standard List controller, which attribute must be added to the tag?

a)

recordSetVar

b)

tabStyle

c)

rerender

d)

pageMessages

52.

Which tags create user interface elements that match the standard UI style in Visualforce?

a)

and

b)

c)

d)

53.

The pageBlockSection tag has a ______ element which lets you set the number of columns in the section.

a)

columns

b)

rows

c)

header

d)

footer

54.

What does the tag add to the page?

a)

A standard visualforce table

b)

A button

c)

A link

d)

A template

55.

The column tag creates a ______ in the table.

a)

column

b)

row

c)

cell

d)

border

56.

The tabStyle attribute of will make sure that the tab is displayed as the Object Name when a ______ is not used.

a)

standardController

b)

customController

c)

recordType

d)

actionFunction

57.

The $User variable is used to:

a)

Access user details

b)

Display errors

c)

Create templates

d)

Link to another page

58.

Which tag is used to display the standard view page for a record?

a)

b)

c)

d)

59.

The relatedList tag is used to display ______ lists.

a)

related

b)

custom

c)

static

d)

primary

60.

The rerender attribute is used on certain tags to ______ a section.

a)

re-render

b)

remove

c)

refresh

d)

hide

61.

Which of the following is NOT a way to display visualforce?

a)

Override Standard Pages

b)

Embed a page in a standard layout

c)

Create a button that links to a VF page

d)

Use to show errors

62.

$Page.pageName is used to get a link reference to ______.

a)

another page

b)

an image

c)

a database

d)

a stylesheet

63.

Which tag is used to show errors in Visualforce?

a)

b)

c)

d)

64.

To insert a placeholder in a template, which tag is used?

a)

b)

c)

d)

65.

Which tag is used to include a page in another page in Salesforce Visualforce?

a)

b)

c)

d)

66.

What is the purpose of the $Resource variable in Salesforce?

a)

To access static resources

b)

To define a page

c)

To invoke a remote action

d)

To format output text

67.

Fill in the blank: Use VisualForce.remoting.Manager.invokeAction('{!$RemoteAction.ClassName.MethodName}') to ________.

a)

invoke a remote action

b)

create a new VisualForce page

c)

delete a record

d)

refresh the browser

68.

Which of the following is used to format an output text in currency format in Salesforce Visualforce?

a)

b)

c)

d)

69.

Which of the following is NOT a step in the typical Development Lifecycle for Developing in Production?

a)

A) Plan functional requirements

b)

B) Create a development environment

c)

C) Update profiles to reveal your changes

d)

D) Notify end users of changes

70.

List two ways of migrating changes between Sandboxes and Production in Salesforce.

a)

Change Sets, ANT Migration Toolkit

b)

Data Loader, Reports

c)

Workflow Rules, Validation Rules

d)

Apex Triggers, Visualforce Pages

e)

Custom Objects, Profiles

71.

What does a Developer sandbox copy in Salesforce?

a)

A Developer sandbox copies customization (metadata), but doesn't copy production data, into a separate environment for coding and testing.

b)

A Developer sandbox copies both customization (metadata) and production data into the same environment.

c)

A Developer sandbox only copies production data and ignores customization (metadata).

d)

A Developer sandbox copies user profiles and permissions, but not customization (metadata) or production data.

72.

What is the main difference between a Developer sandbox and a Developer Pro sandbox in Salesforce?

a)

Developer Pro sandboxes have more storage than Developer sandboxes and may include a number of Developer sandboxes, depending on the edition of your production organization.

b)

Developer sandboxes have more storage than Developer Pro sandboxes and may include a number of Developer Pro sandboxes, depending on the edition of your production organization.

c)

Developer Pro sandboxes have less storage than Developer sandboxes and do not include any Developer sandboxes.

d)

There is no difference between Developer sandbox and Developer Pro sandbox in terms of storage or features.

73.

What does a Partial Copy sandbox include in Salesforce?

a)

A Partial Copy sandbox is a Developer sandbox plus the data that you define in a sandbox template.

b)

A Partial Copy sandbox includes only metadata and no data.

c)

A Partial Copy sandbox is a Full sandbox with all data and attachments.

d)

A Partial Copy sandbox contains only standard Salesforce objects.

74.

What does a Full Copy sandbox copy in Salesforce?

a)

A Full Copy sandbox copies your entire production organization and all its data, including standard and custom object records.

b)

A Full Copy sandbox only copies the metadata and no data from production.

c)

A Full Copy sandbox copies only custom object records, not standard object records.

d)

A Full Copy sandbox copies only user accounts and profiles, excluding other data.

75.

What type of sandbox should be used for production debugging?

a)

Full Copy Sandbox

b)

Developer Sandbox

c)

Partial Copy Sandbox

d)

Developer Pro Sandbox

76.

Which sandbox is best for testing external integrations when an external system expects full production data to be present?

a)

Full sandbox

b)

Developer sandbox

c)

Partial Copy sandbox

d)

Developer Pro sandbox

77.

For unit tests and Apex tests, which sandboxes can be used?

a)

Developer or Developer Pro sandbox

b)

Partial Copy sandbox

c)

Full sandbox

d)

Production environment

78.

When should you use web-based importing in Salesforce?

a)

When you are loading less than 50,000 records, the object is supported by import wizards, or you want to prevent duplicates by uploading records according to account name and site, contact email address, or lead email address.

b)

When you are importing more than 100,000 records and need advanced data transformation.

c)

When you want to update records using external IDs only.

d)

When you need to schedule regular imports automatically.

79.

When should you use Data Loader in Salesforce?

a)

When you need to load 50,000 to 5,000,000 records, need to load into an object not supported by import wizards, want to schedule regular data loads, or want to export your data for backup purposes.

b)

When you need to update a single record manually.

c)

When you want to customize the Salesforce user interface.

d)

When you need to create reports and dashboards.

80.

What is the maximum number of records supported by Data Loader for loading?

a)

5,000,000 records

b)

500,000 records

c)

1,000,000 records

d)

10,000,000 records

81.

What should you plan your release around in the process of developing applications in a release train?

a)

Salesforce upgrades

b)

Team vacations

c)

Budget reviews

d)

Customer feedback sessions

82.

Which of the following determines the best index from which to drive the query, if possible, based on filters in the query?

a)

Skinny Tables

b)

Force.com query optimizer

c)

Indexes

d)

Custom objects

83.

Fill in the blank: Skinny Tables are copies of the data for a table with a limited number of fields (____ columns).

a)

100

b)

10

c)

50

d)

200

84.

Which of the following statements about Skinny Tables is TRUE?

a)

They are not kept in sync with the source data

b)

They help in fast data access

c)

They can contain fields from multiple objects

d)

They do not need to be enabled by support

85.

Fill in the blank: Custom indexes can be created to optimize ________.

a)

performance

b)

security

c)

storage

d)

design

86.

Which indexes are created by default in Salesforce?

a)

RecordTypeId, Division, CreatedDate, Name, Email

b)

AccountId, OpportunityId, LastModifiedDate, Phone, Address

c)

LeadSource, OwnerId, Status, Industry, Website

d)

ContactId, CaseNumber, Priority, Description, Type

87.

Skinny Tables can only contain fields from the base object.

a)

True

b)

False

88.

Which of the following is NOT a function of the Force.com query optimizer?

a)

Updates statistics

b)

Determines how to order the remaining tables to minimize cost

c)

Creates custom indexes

d)

Injects custom foreign key value tables as needed to create efficient join paths

89.

Fill in the blank: The Force.com query optimizer influences the execution plan for the remaining joins, including sharing joins, to minimize database ________.

a)

input/output (I/O)

b)

latency

c)

bandwidth

d)

storage

90.

Indexes for External Id are created by default.

a)

True

b)

False

91.

By default, nulls are not considered in the index.

a)

True

b)

False

92.

If a where clause narrows down the criteria to ___% for Standard fields or ___% for Custom fields, the index is used.

a)

30% for Standard fields, 10% for Custom fields

b)

50% for Standard fields, 20% for Custom fields

c)

40% for Standard fields, 15% for Custom fields

d)

25% for Standard fields, 5% for Custom fields

93.

Formula fields which are deterministic are indexed.

a)

True

b)

False

94.

A formula field is deterministic if it does not use TODAY(), NOW(), etc.

a)

True

b)

False

95.

A formula field is deterministic if it does not refer to a different object.

a)

True

b)

False

96.

Two column indexes can be created for supporting search + sort. These are more efficient than 2 indexes.

a)

True

b)

False

97.

Divisions can be used to partition huge volumes of data by ________.

a)

business unit

b)

color code

c)

alphabetical order

d)

random selection

98.

What is the maximum number of triggers that can be defined on a single object in Salesforce?

a)

50

b)

20

c)

Unlimited

d)

10

99.

Which context variable provides the list of records that are being processed in a trigger?

a)

Trigger.isInsert

b)

Trigger.isUpdate

c)

Trigger.new

d)

Trigger.old

100.

What is the purpose of the 'after' trigger in Apex?

a)

To prevent record deletion

b)

To validate data before saving

c)

To perform actions after the record is saved

d)

To perform actions before the record is saved