Salesforce · Free Practice Questions · Last reviewed May 2026
24real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
What is the maximum number of SOQL queries that can be issued in a single synchronous Apex transaction?
50
200
100
Synchronous transactions allow a maximum of 100 SOQL queries.
500
A developer needs to retrieve Account records along with their associated Contacts in a single query. Which query syntax is correct?
SELECT Id, Name, CONCAT(Contacts) FROM Account
SELECT Id, Name, (SELECT Id, LastName FROM Contact) FROM Account
SELECT Id, Name, Contacts__r FROM Account
SELECT Id, Name, (SELECT Id, LastName FROM Contacts) FROM Account
This is the correct syntax for a child subquery in SOQL.
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?
enforce sharing
with sharing
Enforces record-level security and sharing rules.
without sharing
inherited sharing
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?
System.Security
Schema.DescribeFieldResult
DescribeFieldResult provides methods to evaluate user access permissions on fields.
UserInfo
ApexPages.StandardController
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?
Execute the query using Database.queryWithBinds() with a restricted access modifier.
Use bind variables in the SOQL query instead of string concatenation.
Bind variables safely parameterize user input, neutralizing SOQL injection risks.
Use String.escapeSingleQuotes() on all user inputs before concatenating into the query string.
Enclose all dynamic parameters in single quotes within the dynamic SOQL query string.
Which Apex data type should a developer use to represent a precise geographic location with latitude and longitude coordinates?
Coordinate
Location
Location represents latitude and longitude coordinates.
Address
GeoPoint
Want more Developer Fundamentals practice?
Practice this domainA developer wants to test an asynchronous future method. Where must the developer place the asynchronous code execution so that it runs synchronously and within the test context?
Inside a System.runAs() block
Within a try-catch block
Inside a Database.executeBatch block
Between Test.startTest() and Test.stopTest()
Placing code between startTest and stopTest resets governor limits and forces async processing to complete.
A developer is analyzing a debug log and notices that it is truncated because it exceeded the maximum file size limit. Which action should the developer take to capture only the relevant Apex code execution details without exceeding the limit?
Increase the maximum log file size in company profile settings.
Adjust the Trace Flag log levels to reduce verbosity for unnecessary categories like Database and Workflow.
Reducing verbosity for unneeded categories keeps log sizes small enough to capture the critical execution path.
Disable all validation rules in the org temporarily.
Switch the debug log perspective to 'Development Harvester'.
A developer receives a System.LimitException: Too many SOQL queries: 101 when running a complex unit test. The test class inserts a large volume of test records that inadvertently cause a trigger to execute multiple queries inside a loop. What is the most effective way to reset the governor limits specifically for the code being tested?
Wrap the test assertion code between Test.startTest() and Test.stopTest().
Test.startTest and Test.stopTest reset governor limits so that heavy test setup data generation does not count against the tested code limits.
Mark the test method with @isTest(SeeAllData=true).
Wrap the trigger logic in a Database.setSavepoint() block.
Use Limits.getLimitQueries() inside the test method.
A developer is writing a unit test that executes under a specific user context to verify sharing rules. Which method should the developer use to specify the user for the subsequent test operations?
UserInfo.setUserId()
Database.setSavepoint()
Test.setCurrentUser()
System.runAs()
System.runAs allows block-level execution under a specified User instance to test sharing behavior.
A developer wants to view real-time debug log streaming in their local environment using the Salesforce CLI. Which command should the developer execute?
sf apex run test
sf project deploy start
sf org display
sf apex log tail
sf apex log tail streams logs in real-time to the command line.
A developer is writing a test method that performs a callout to an external REST service. Which interface must the developer implement to provide mock responses during the unit test execution?
InstallHandler
Schedulable
Database.Batchable
HttpCalloutMock
HttpCalloutMock must be implemented to return fake responses since actual callouts are not permitted in test methods.
Want more Testing Debugging And Deployment practice?
Practice this domainA developer needs to retrieve Salesforce data in a Lightning Web Component without writing imperative Apex. Which module should be imported to use the wire service for standard record data?
lightning/platformShowErrorToast
lightning/navigation
lightning/uiRecordApi
Contains wire adapters for standard record data manipulation.
lightning/apex
A developer creates a Visualforce page and wants to include standard Salesforce styling. Which attribute on the <apex:page> tag enables this?
lightningStylesheets="true"
standardStylesheets="true"
Includs standard Salesforce styles on the page.
applyHtmlTag="true"
sidebar="true"
A developer creates a custom LWC that wraps child components. The developer needs to pass styling from the parent component into specific slots of the child component. Which CSS selector should be used inside the child component to style content passed into a slot?
:content
:scope
:host
::slotted()
Applies styles to elements that are distributed into a slot.
A developer is writing an Aura component and needs to handle an event fired by a child component. Which attribute is required in the aura:handler tag on the parent component?
name
method
controller
event
Specifies the fully qualified name of the event.
A developer wants to style a Lightning Web Component using the Salesforce Lightning Design System (SLDS). What is the recommended way to include SLDS styling?
Use standard SLDS utility classes directly in the component's HTML template.
SLDS classes are available by default in Salesforce environments.
Import the full SLDS stylesheet explicitly as a static resource.
Apply standard Bootstrap classes to match Salesforce themes.
Use inline styles exclusively for all components.
A developer is building a Lightning Web Component and needs to execute code as soon as the component is inserted into the DOM. Which lifecycle hook should be used?
renderedCallback
constructor
connectedCallback
This hook is executed when the component is inserted into the DOM.
disconnectedCallback
Want more User Interface practice?
Practice this domainA developer wants to chain a second asynchronous job from within an executing Queueable Apex job. Which method should be used?
System.enqueueJob()
System.enqueueJob is called inside the Queueable execute method to chain jobs.
Database.executeBatch()
apexJob.schedule()
Future.runAsync()
A developer writes an Apex trigger that performs a SOQL query inside a standard for-loop processing Trigger.new. Which governor limit is most likely to be exceeded?
Total number of SQL queries issued (100)
Placing a SOQL query inside a loop causes a query to run for every record in the batch, hitting the 100 SOQL query limit.
Total heap size (6 MB)
Total number of records retrieved by SOQL queries (50,000)
Total CPU time (10,000 milliseconds)
In what order does Salesforce execute system validation rules relative to Before Triggers during an insert operation?
System validation rules run after Before Triggers but before custom validation rules.
System validation rules execute before Before Triggers.
Standard system validation rules (like required fields) run prior to the execution of Before Triggers.
Before Triggers execute before system validation rules.
Before Triggers and system validation rules run concurrently.
Which context variable should a developer use in an Apex trigger to determine if the trigger was fired by an update operation rather than an insert?
Trigger.isExecuting
Trigger.isBefore
Trigger.isInsert
Trigger.isUpdate
Trigger.isUpdate is the correct boolean context variable for update operations.
An asynchronous method needs to be invoked from a standard trigger to perform callouts to an external web service. Which annotation is required for this asynchronous method?
@TestSetup
@future(callout=true)
The @future annotation with callout=true allows asynchronous execution and external web service callouts.
@InvocableMethod
@ReadOnly
A developer implements a Schedulable class to run a daily cleanup job. What is the maximum number of scheduled Apex jobs that can be simultaneously active in an org?
500
50
100
Salesforce limits the number of scheduled Apex jobs in an org to 100.
250
Want more Process Automation And Logic practice?
Practice this domainThe SALESFORCE-PD1 exam has 200 questions and must be completed in 120 minutes. The passing score is 700/1000.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 4 domains: Developer Fundamentals, Testing Debugging And Deployment, User Interface, Process Automation And Logic. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official Salesforce SALESFORCE-PD1 exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.