Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free Salesforce Certified Platform Developer Plat-Dev-201 Exam Questions

Last updated: · 13 practice questions with answers and explanations

Page: 1 / 14 Total 204 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Developer Fundamentals

Skill tested: Choose Salesforce data-model relationships that preserve ownership and sharing behavior.

A logistics company tracks reusable shipping containers and individual inspection events. Each inspection belongs to exactly one container, and users should see an inspection whenever they can see its container. The company also needs inspections to retain a container reference only while the container exists; inspections have no independent lifecycle and should be deleted when a container is deleted. Which data-model design best meets these requirements?

Correct Answer: D. Create Inspection as a detail object in a master-detail relationship to Container.
Explanation:

A master-detail relationship fits a child record whose lifecycle and access should follow its parent. The inspection inherits the container's sharing, cannot exist without its parent, and is deleted when the container is deleted. A lookup does not provide the same cascade deletion and inherited record access, while independent ownership conflicts with the stated lifecycle. A junction object is unnecessary because each inspection has one parent, and duplicating container records would distort the data model.

Question 2

New Multiple answers

Topic: Developer Fundamentals

Skill tested: Trace Apex sharing behavior through execution context and explicit sharing declarations.

A service runs as an authenticated sales user and calls an Apex controller declared `with sharing`. The controller queries Opportunity records and then invokes a helper class declared `without sharing`; the helper performs a second query. The team wants both queries to respect the current user's record-level sharing, but does not want to redesign the call chain. Which two actions best meet the requirement? Select TWO.

Correct Answer: C. Declare the helper class `with sharing` so its queries enforce the caller's record-sharing access.; E. Declare the helper class `inherited sharing` so it uses the calling context's sharing behavior.
Explanation:

A class explicitly declared `with sharing` enforces record-level sharing for its operations. `inherited sharing` allows a helper to adopt the sharing mode of its caller, which is appropriate for a reusable helper in this call chain. A `without sharing` class does not become sharing-enforced merely because its caller is `with sharing`. Query security clauses address object and field permissions in supported contexts, not a replacement for record-sharing enforcement. Triggers run in system context and are not a way to inherit the initiating user's record sharing.

Question 3

New Single answer

Topic: Developer Fundamentals

Skill tested: Identify how Apex transactions and governor limits affect bulk record processing.

A nightly integration can insert as many as 8,000 custom records in one API request. An after-insert trigger calls a service that queries related configuration records and updates a status field on each inserted record. In testing, the service works for batches of 100 but fails for larger requests with a governor-limit exception. The team must preserve the single transaction and support bulk API loads without introducing asynchronous delay. What is the best implementation change?

Correct Answer: A. Make the service bulk-aware: collect relevant keys, query once outside loops, build updates in memory, and perform one DML operation.
Explanation:

Bulkification reduces SOQL and DML operations by collecting identifiers, querying the needed records in sets, and issuing DML on collections outside loops. That pattern supports a large trigger batch while retaining synchronous processing and the transaction. A per-record query worsens the limit problem; a query limit can omit required data and does not address the processing design; and governor-limit exceptions cannot be reliably handled as an ordinary recoverable error to continue the transaction.

Question 4

New Single answer

Topic: Developer Fundamentals

Skill tested: Distinguish record access controls from object and field permissions in Apex.

A custom Lightning page invokes an Apex controller to show a list of a user's Cases. The controller is declared `with sharing`, but users can still see a sensitive custom field they lack permission to view. The page must respect both record sharing and the user's object- and field-level permissions. The team wants a query-time safeguard rather than manually checking every field after querying. Which change is most appropriate?

Correct Answer: B. Keep `with sharing` and use a user-mode query, such as `WITH USER_MODE`, for the data operation.
Explanation:

`with sharing` controls record-level sharing, not object- or field-level permissions. A user-mode data operation enforces the running user's access, including applicable object and field permissions as well as record access, and is the direct query-time approach described. `inherited sharing` concerns record-sharing context and does not itself enforce field access. `WITH SECURITY_ENFORCED` is not a substitute for record-sharing declarations, and `without sharing` would move in the wrong direction for record access.

Question 5

New Multiple answers

Topic: Process Automation and Logic

Skill tested: Select before-save or after-save flow timing based on record-update requirements.

A subscription team is consolidating automation on Subscription records. One requirement is to calculate a normalized region value from fields on the record being saved. A second requirement is to create a related Renewal Task after a subscription first enters the Active status. The record is saved through both the UI and bulk API, and the team wants efficient execution without causing recursive updates. Which two flow designs best meet these requirements? Select TWO.

Correct Answer: A. Use a before-save record-triggered flow to set the normalized region on the triggering Subscription.; D. Use an after-save record-triggered flow, configured to run when the status changes to Active, to create the related Renewal Task.
Explanation:

Before-save record-triggered flows are intended for fast updates to fields on the triggering record and avoid a separate record-update operation. Creating a related task requires an after-save flow, because the triggering record must be saved before the flow performs related-record actions. An after-save self-update adds unnecessary DML and can complicate recursion; a before-save flow cannot perform the required related-record creation in this design; and a scheduled path defers execution rather than creating the task immediately.

Question 6

New Single answer

Topic: Process Automation and Logic

Skill tested: Apply flow trigger-order values to control ordering among same-object record-triggered flows.

An organization has three before-save record-triggered flows on the same object and with the same triggering event. Flow Alpha sets a classification field, Flow Beta reads that field to set a routing field, and Flow Gamma sends a notification based on the final routing value. The flows are activated at different times, and administrators can set trigger-order values. No flow has a dependency on another object's automation. What is the best way to make the intended sequence deterministic?

Correct Answer: C. Set ascending trigger-order values for Alpha, Beta, and Gamma in that dependency order.
Explanation:

For record-triggered flows on the same object and trigger, lower trigger-order values run before higher values. Assigning values that place Alpha before Beta and Beta before Gamma makes the field dependencies explicit and independent of activation timing. Descending values reverse the intended sequence, and identical values do not establish a deliberate dependency order. After-save automation runs later in the save sequence, not before the before-save flows.

Question 7

New Multiple answers

Topic: Process Automation and Logic

Skill tested: Predict record-triggered flow execution relative to Apex triggers and workflow automation.

A support organization is diagnosing an update that changes a Case priority. A before-save flow sets a normalized priority field, a before-update Apex trigger reads that field, a workflow rule may field-update the Case, and an after-save flow creates a follow-up record. The team needs to reason about the standard save sequence and decide where the normalized value must be available. Which two statements are accurate? Select TWO.

Correct Answer: A. The before-save record-triggered flow runs before before-update Apex triggers in the save order.; E. An after-save record-triggered flow runs after the record has been saved and can create related records.
Explanation:

Before-save record-triggered flows run before before-trigger Apex in the record-save order, so the trigger can read the normalized value set by the flow. After-save flows execute after the record is saved and can perform actions such as creating related records. Workflow field updates occur later in the save process and can cause another update pass, but they do not simply rerun the original before-save flow as stated. The claim that the Apex trigger cannot see the flow's updated in-memory values is therefore incorrect.

Question 8

New Single answer

Topic: Process Automation and Logic

Skill tested: Choose flow entry criteria and update behavior to prevent unnecessary automation runs.

A compliance team has an after-save record-triggered flow on Vendor records that posts a notification when a vendor's risk rating becomes High. Later in the same transaction, another automation updates an unrelated description field. The notification can be sent only once when the rating transitions into High; existing High records should not generate another notification on unrelated edits. Which configuration most directly satisfies the requirement?

Correct Answer: C. Configure the flow to run only when the record is updated to meet the entry condition requirements, with entry criteria for a High rating.
Explanation:

The flow should use update entry behavior that runs only when the record transitions from not meeting the entry criteria to meeting them. With the High rating as the entry condition, unrelated edits to records that already have a High rating do not retrigger the notification. Checking only the current value in a decision would still evaluate on every qualifying update. Create-only execution misses later transitions, while a scheduled path adds delay and does not address duplicate entry behavior.

Question 9

New Single answer

Topic: User Interface

Skill tested: Select Lightning component technology based on reuse and platform compatibility requirements.

A sales operations team is modernizing a record page. The component must use standard Lightning data services, expose configurable properties in Lightning App Builder, and communicate with another component through a supported Lightning event mechanism. The team has no dependency on legacy Aura-only APIs and wants the current preferred component model. Which implementation should the developer choose?

Correct Answer: A. Build a Lightning Web Component and use the supported Lightning component communication mechanisms for its context.
Explanation:

Lightning Web Components support Lightning App Builder exposure through component metadata and integrate with platform capabilities such as Lightning Data Service. They are the preferred choice when the requirements do not depend on legacy Aura-only functionality. Aura remains valid for specific compatibility needs, but the claim that LWC cannot be configured in App Builder is false. Visualforce embedding and a standalone page would not meet the requested component model and native configuration expectations.

Question 10

New Multiple answers

Topic: User Interface

Skill tested: Secure Lightning component data access using Apex sharing and field-level permission enforcement.

A Lightning Web Component calls an Apex method to retrieve custom Invoice records and display selected fields. The result must respect users' record sharing, object permissions, and field-level security. The method should return only records the user can access, and the team wants an explicit security posture rather than relying on UI visibility alone. Which two implementation choices are appropriate? Select TWO.

Correct Answer: A. Declare the Apex class `with sharing` or `inherited sharing` to enforce record-level sharing.; E. Use a user-mode query for the Apex data operation so object and field permissions are enforced.
Explanation:

A sharing declaration such as `with sharing` or `inherited sharing` enforces record-level access for the Apex class. A user-mode query adds enforcement of the running user's object and field permissions for the data operation. Hiding a field in a client template does not secure data already returned to the browser, and `without sharing` bypasses record-sharing enforcement. `@AuraEnabled` exposes a method to Lightning but does not by itself enforce all data permissions.

Question 11

New Single answer

Topic: User Interface

Skill tested: Diagnose Visualforce view-state growth and select an appropriate stateless interaction pattern.

A Visualforce page used by a service team displays several hundred read-only history rows. Its view state has grown beyond the platform limit, and most of the page consists of data that does not need to be submitted back to the server. Users still need to filter the displayed history, but the team wants to retain Visualforce and avoid removing useful fields. Which change is the best first step?

Correct Answer: C. Mark read-only controller properties as transient where appropriate and render the history using a stateless, read-only approach.
Explanation:

Visualforce view state includes serialized page and controller state needed for postbacks. Marking data that need not survive a postback as `transient`, together with a read-only rendering pattern where appropriate, can reduce that serialized state while preserving the page's useful content. Static variables do not persist across requests in the needed way and are not a reliable view-state solution. Read-only inputs do not remove all controller state, and the platform view-state limit is not raised through a page setting.

Question 12

New Single answer

Topic: User Interface

Skill tested: Use Lightning component events and public APIs for appropriate component communication.

A Lightning page contains a parent component that owns a selected Account and a child component that displays related metrics. The parent must pass the selected Account identifier down, and the child must notify the parent when a user selects a different metric. The components are nested in the same page, and there is no need for unrelated components elsewhere in the application to receive the event. Which communication design is most appropriate for a Lightning Web Components implementation?

Correct Answer: D. Pass the Account identifier to the child through a public `@api` property and have the child dispatch a custom event that the parent handles.
Explanation:

For directly nested LWCs, a public property provides a clear parent-to-child data path, while a custom event provides the child-to-parent notification path. This keeps ownership of the selected Account in the parent and avoids unnecessary application-wide messaging. A child cannot directly access a parent's private JavaScript state. Lightning Message Service is useful for communication across separate component hierarchies or broader scopes, but is unnecessary for this direct relationship. Browser cookies add unrelated state and polling.

Question 13

New Single answer

Topic: Testing, Debugging, and Deployment

Skill tested: Write isolated Apex tests with controlled data and assertions for trigger behavior.

A developer changes a trigger that updates an Account summary field when related Work Orders are inserted. The current test passes only when the sandbox already contains Accounts with a particular name, and it asserts only that no exception occurs. The team needs a reliable regression test that can run in an isolated deployment validation and verify the business result. What should the developer do?

Correct Answer: D. Create the required Account and Work Order records in the test, execute the operation, and assert the resulting Account summary value.
Explanation:

A robust Apex test creates its own data, exercises the relevant operation, and asserts the expected business outcome. This makes the test independent of org-specific records and verifies behavior rather than merely confirming that execution completed. Querying a named existing Account remains fragile and can fail when data changes. Disabling the trigger defeats the test's purpose, and `SeeAllData=true` introduces an unnecessary dependency on mutable organization data.