Courseiva

SALESFORCE-PD1 · domain

Developer Fundamentals

Developer Fundamentals covers Apex language basics, sObject and DML operations, SOQL/SOSL queries, and the Salesforce governor limits that govern them. Questions present short code scenarios and ask you to pick valid syntax, identify the limit or exception a snippet triggers, or choose the correct API method for a task.

76 questions25 easy26 medium25 hard

Focused practice

Practice Developer Fundamentals questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Developer Fundamentals

Be able to read Apex snippets and state whether they compile and which governor limit they hit. The single most important habit: keep SOQL and DML outside loops and use Database methods when partial success is required.

Apex primitive and collection types, including Date, Datetime, and Map iteration constructs

DML statements versus Database class methods and their all-or-nothing versus partial-success behavior

SOQL and SOSL syntax, relationship queries, and querying inside loops

Governor limits such as SOQL queries, DML statements, and CPU time per transaction

Watch out for

Common Developer Fundamentals exam traps

  • ▸Assuming Database.insert is all-or-nothing; it returns SaveResult objects and allows partial success unless allOrNone is set true.
  • ▸Placing SOQL or DML inside a for-loop, which breaches the 100-query or 150-statement limit quickly.
  • ▸Confusing Date with Datetime, or using a Map loop syntax that does not match the map's key or value types.

Question index

All Developer Fundamentals questions (76)

Click any question to see the full explanation, or start a practice session above.

1

What is the primary purpose of the Model-View-Controller (MVC) design pattern implementation in Lightning Web Components (LWC)?

Easy
2

Which THREE techniques help prevent hitting governor limits when writing SOQL queries in Apex? Choose 3 answers.

Hard
3

A developer is writing a trigger on the Contact object that needs to reference old field values during an update operation. In which trigger context variable are these previous values stored?

Hard
4

Which TWO statements about SOQL relationship queries are true? Choose 2 options.

Medium
5

An application uses a SOSL search to find records across multiple objects. Which return type must be used to capture the results in Apex?

Hard
6

A developer is building a custom Lightning Web Component and wants to communicate data from a child component up to its parent component. Which THREE steps are required? (Choose three.)

Medium
7

An Apex trigger needs to prevent records from being saved if a specific validation condition fails. How should the developer reject the DML operation on a specific record?

Hard
8

Which TWO methods are used to inspect sObject field metadata dynamically in Apex? Choose 2 options.

Easy
9

A developer is writing a batch Apex class. During the execute method, a record fails validation. The developer wants to ensure that successfully processed records in the same batch are committed while failing records are logged without aborting the entire batch. How should the DML be performed?

Hard
10

A developer needs to find all records across multiple objects (Contact, Lead, and Account) that contain the exact phrase 'Acme Corp'. Which feature should be used?

Medium
11

Which THREE best practices should a developer follow when implementing CRUD and FLS checks in Apex? Choose 3 answers.

Hard
12

A developer is writing code that processes untrusted data and wants to automatically strip fields and relationships that the current user cannot access, without throwing an exception. Which feature should be used?

Hard
13

Which Apex data type should a developer use to represent a precise geographic location with latitude and longitude coordinates?

Easy
14

Which collection type stores elements as key-value pairs in Apex?

Easy
15

An Apex trigger executes during a bulk insert of 300 records. To adhere to best practices regarding governor limits and bulkification, how should SOQL queries be written?

Hard
16

A developer is writing a SOQL query to find accounts where the billing country starts with 'United'. Which operator should be used?

Medium
17

Which SOQL aggregate function should a developer use to count the exact number of rows returned by a query without retrieving the records into memory?

Easy
18

Which TWO methods are available on the Database class for performing DML operations with partial success capability? Choose 2 options.

Easy
19

A developer needs to dynamically instantiate an sObject type based on a string variable representing the object name (e.g., 'Account'). Which method should be used?

Medium
20

A developer needs to ensure that an Apex class respects organization-wide defaults, role hierarchies, and sharing rules when querying custom objects. Which keyword should be added to the class definition?

Medium
21

Which TWO features are characteristics of SOSL (Salesforce Object Search Language) queries? Choose 2 answers.

Medium
22

Which Apex data type is best suited for storing monetary amounts with high precision?

Easy
23

What is the correct file extension for an Apex class created in Salesforce DX?

Easy
24

A developer wants to retrieve up to 5 recently viewed records of any object type using SOSL. Which SOSL clause specifies the maximum number of records to return?

Easy
25

A developer writes a SOQL query to aggregate total opportunity amounts grouped by stage name. Which SOQL clause is required?

Medium
26

Which TWO data types can be used as keys in an Apex Map? Choose 2 answers.

Medium
27

A developer is writing an Apex trigger and needs to optimize performance and prevent governor limit violations. Which TWO practices should the developer follow? (Choose two.)

Medium
28

A developer wants to define a constant value in an Apex class that can be accessed globally without instantiating the class. Which combination of keywords should be used?

Easy
29

Which TWO statements are true regarding the behavior of Apex triggers and context variables? Choose 2 answers.

Medium
30

Which THREE collections are available in Apex? (Choose three.)

Easy
31

An Apex trigger needs to prevent duplicate records from being inserted based on a custom external ID field. Which approach should the developer take to optimize query performance and respect governor limits?

Hard
32

Which THREE factors can cause an Apex CPU time limit exception in a synchronous transaction? Choose 3 answers.

Hard
33

A developer needs to assign a default value to a custom picklist field via Apex when creating a Lead record. What data type should be assigned to the picklist field in Apex?

Medium
34

Which THREE tools or contexts can be used to execute Anonymous Apex code? Choose 3 options.

Hard
35

A developer needs to store a collection of Account IDs where duplicates are automatically prevented and lookups are extremely fast. Which collection type should the developer use?

Easy
36

Which THREE operations can cause an automatic roll back of an entire Apex transaction? Choose 3 options.

Hard
37

A developer needs to convert a JSON string representing a list of Account objects into an actual Apex List of Accounts. Which method should be used?

Medium
38

A developer needs to check if a specific key exists in a Map<String, Decimal> before retrieving its value. Which Map method should be used?

Easy
39

An enterprise application requires Apex code to check whether the current user has read access to a specific custom field before displaying it in a custom Lightning Web Component. What is the most appropriate class to use?

Hard
40

Which tool or feature in Salesforce Developer Console allows a developer to inspect debug logs and filter them by category and level?

Easy
41

What is the maximum number of SOQL queries that can be issued in a single synchronous Apex transaction?

Easy
42

An Apex trigger invokes a helper method that performs a DML operation, but the developer wants to establish a rollback point so that prior changes can be reverted if a subsequent error occurs. Which feature should be used?

Hard
43

A developer is writing an Apex trigger on the Case object that updates the Case's Status field based on the Priority. The trigger must handle bulk updates and avoid recursion. Which approach should the developer take to prevent the trigger from firing again when the Case records are updated by the trigger itself?

Medium
44

A developer needs to convert a String variable containing a numeric value into an Integer in Apex. Which method should be used?

Medium
45

Which method is used to get the number of elements in an Apex List?

Easy
46

Which TWO primitive data types are natively supported in Apex? Choose 2 options.

Easy
47

Which TWO statements about SOSL (Salesforce Object Search Language) are true? Choose 2 options.

Medium
48

A developer needs to apply a custom discount to a list of Opportunity records and then persist the changes to Salesforce. The logic must be reusable both from an Apex trigger and from an Apex controller invoked by a Lightning web component. Which approach best satisfies the requirement while following Apex best practices?

Medium
49

Which TWO collection interfaces or classes are provided in Apex? Choose 2 options.

Easy
50

Which collection type in Apex stores elements as key-value pairs where each key maps to a single value?

Easy
51

An Apex trigger processes a list of Case records. The developer wants to group the cases by their AccountId. Which data structure is best suited for this grouping?

Hard
52

Which component of the MVC design pattern in Salesforce Lightning Web Components (LWC) represents the data model and business logic layer?

Easy
53

A developer writes an Apex method that executes a SOQL query inside a for-loop over a list of 200 Account records. Which governor limit is most likely to be immediately breached?

Hard
54

An application has complex business logic where an Apex class called from a trigger needs to know whether it was invoked from an insert or update trigger context. How can the developer determine this?

Hard
55

A developer writes an Apex method with the 'inherited sharing' keyword. What is the behavior of this class when invoked from a class declared with 'with sharing'?

Hard
56

A developer writes a SOQL query to fetch Account records and wants to bind a list of strings called 'targetNames' as filter criteria. Which syntax is correct?

Medium
57

Which TWO types of triggers can be defined in Apex? Choose 2 options.

Medium
58

Which THREE statements are accurate regarding Apex transaction control and database savepoints? Choose 3 answers.

Hard
59

A developer writes a SOQL query using the FORMAT() keyword. What is the purpose of this keyword?

Medium
60

An Apex trigger executes a query inside a for-loop to fetch related child records for every parent Account in Trigger.new. The developer notices that when a data load of 200 accounts occurs, the governor limit for total SOQL queries issued is exceeded. How should the developer refactor the code?

Hard
61

Which THREE data types are primitive data types supported in Apex? (Choose three.)

Easy
62

A developer is writing a test class for an Apex trigger and needs to insert test Account records. Best practices recommend bypassing hardcoded IDs. Which annotation should be placed on the test setup method to create common test data efficiently?

Medium
63

A developer wants to ensure that a custom Apex controller method can be invoked securely from a Lightning Web Component. Which annotation must be applied to the method?

Medium
64

A developer needs to implement a custom logging framework. Which Apex data type should be used to represent a variable that can store any primitive value, sObject, or collection dynamically?

Hard
65

A developer needs to store a collection of unique customer email addresses in Apex and check for existence efficiently. Which collection type should the developer use?

Easy
66

An Apex trigger needs to check whether the current user has read access to the 'AnnualRevenue' field on the Account object before performing a calculation. Which method should the developer use?

Medium
67

Which THREE design patterns or tools help ensure secure coding practices regarding CRUD and FLS in Apex? Choose 3 options.

Hard
68

Which type of Apex trigger context variable returns a list of new versions of the sObject records?

Easy
69

An Apex trigger processes a large volume of Opportunity updates. The developer uses Database.update(opps, false) to allow partial success. How should the developer inspect the results to handle any failures?

Hard
70

A developer writes an Apex method that executes a SOQL query using user-supplied search parameters. How can the developer protect against SOQL injection vulnerabilities?

Hard
71

A developer needs to execute a dynamic SOQL query where the object name and fields are determined at runtime. Which method should be used?

Medium
72

Which primitive data type in Apex can represent a specific point in time, including both date and time values?

Easy
73

A developer needs to iterate over a map of Account IDs to Account sObjects and perform processing on each value. Which loop construct is valid Apex?

Hard
74

A developer is writing an Apex method and needs to store a collection of unique email addresses while maintaining fast lookup times. Which collection should the developer choose?

Easy
75

A developer needs to query all Contact records, including those that have been deleted from the database via the Recycle Bin. Which SOQL clause must be added?

Medium
76

A developer needs to query all Contact records, including those that have been moved to the Recycle Bin. Which SOQL keyword should be used?

Medium

Frequently asked questions

What does the Developer Fundamentals domain cover on the SALESFORCE-PD1 exam?
Be able to read Apex snippets and state whether they compile and which governor limit they hit. The single most important habit: keep SOQL and DML outside loops and use Database methods when partial success is required.
How many questions are in this domain?
This page lists all 76 Developer Fundamentals questions in the SALESFORCE-PD1 question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Developer Fundamentals questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Salesforce Certified Platform Developer I (SALESFORCE-PD1) Developer Fundamentals Practice Questions