Free sample · Plat-Dev-201

Platform Developer practice questions: 10 free, with answers

10 questions from the Platform Developer Practice Exams package, all from the Developer Fundamentals domain. Choose your answer, then open it to see whether you were right and why each option is right or wrong. The real Plat-Dev-201 exam has 60 questions in 105 minutes.

Reviewed by Nick Gorgotsias, Founder of ForceDigestEvery question is written by ForceDigest from the published exam outline. Nothing is copied from the real exam.

  1. Question 1

    A trigger on Contact works when a user saves one record in the browser, but a nightly load of 200 contacts fails with "Too many SOQL queries: 101". The trigger queries each contact's account inside a for loop. What should the developer change?

    1. Move the query into a future method so that each contact runs in its own transaction
    2. Query the accounts once with a set of IDs, and read them from a map
    3. Ask the administrator to raise the SOQL query limit for the integration user
    4. Wrap the query in a try/catch block so that the load continues past the error
    Show the answer

    Correct answer: B. Query the accounts once with a set of IDs, and read them from a map

    The trigger issues one query per record, so a batch of 200 records needs 200 queries. Querying once with a set of IDs and reading results from a map uses a single query however many records arrive. A limit breach throws a LimitException that can't be caught, administrators can't raise governor limits, and one future call per contact would run into the limit of 50 future calls per transaction.

  2. Question 2

    A trigger handler updates each opportunity's account inside a for loop, with one update statement per account. Bulk loads of 500 opportunities fail. Which change fixes the design?

    1. Replace each update statement with Database.update(account, false) instead
    2. Use a second trigger on Account to perform the same updates one at a time
    3. Add the accounts to a list in the loop, then update the list once
    4. Move the update statements into a before trigger on the Opportunity object instead
    Show the answer

    Correct answer: C. Add the accounts to a list in the loop, then update the list once

    Each update statement counts as one DML statement, and a transaction allows 150, so a loop over 200 records fails. Collecting the accounts and updating the list once uses a single DML statement. Database.update with partial success still issues one statement per call, and moving the statements to another trigger or context doesn't reduce their number.

  3. Question 3

    A synchronous transaction runs three SOQL queries that return 30,000, then 15,000, then 10,000 rows. What happens?

    1. The third fails, as the transaction exceeds 50,000 rows retrieved
    2. All three succeed, because the row limit applies to asynchronous Apex only
    3. All three succeed, because each individual query may return up to 50,000 rows
    4. The first query fails, because one query can return at most 10,000 rows
    Show the answer

    Correct answer: A. The third fails, as the transaction exceeds 50,000 rows retrieved

    The 50,000-row limit counts every record retrieved by SOQL across the whole transaction, not per query. After 45,000 rows, the third query pushes the total to 55,000 and fails. The 10,000 figure is the limit on rows changed by DML, and the row limit is the same for synchronous and asynchronous Apex.

  4. Question 4

    Where can a developer make a Lightning web component available to users? Choose 2.

    1. Inside a report, as the formula for a summary column
    2. Inside a validation rule, as the rule's error message
    3. Inside a formula field, as the value of the formula
    4. On a Lightning record page, placed with Lightning App Builder
    5. Inside a screen flow, as a custom screen component
    Show the answer

    Correct answers: D. On a Lightning record page, placed with Lightning App Builder · E. Inside a screen flow, as a custom screen component

    A component's configuration file lists its targets, such as record, app and home pages, flow screens, quick actions, the utility bar and Experience Cloud sites. Validation rules, formula fields and report formulas are declarative expressions; they can't host components.

  5. Question 5

    Ticket has a lookup relationship to Product. Each product must show how many open tickets it has. What should the developer use?

    1. A record-triggered flow or Apex trigger that recalculates the count
    2. A cross-object formula field on Product that counts its related tickets
    3. A roll-up summary field on Product that counts its open tickets
    4. A validation rule on Ticket that updates the related product
    Show the answer

    Correct answer: A. A record-triggered flow or Apex trigger that recalculates the count

    Roll-up summary fields need a master-detail relationship, so they aren't available over this lookup. Automation on Ticket, either a record-triggered flow or an Apex trigger, has to keep the count up to date when tickets are created, closed or deleted. Formula fields can't aggregate child records, and validation rules can't update records.

  6. Question 6

    A developer claims that moving query-heavy logic from an Apex trigger into a record-triggered flow will avoid the SOQL query limit. Is this correct?

    1. No. A flow's queries count against the same transaction limits as Apex
    2. Yes. Flows are exempt from the query limit whenever they run before the save
    3. No. Flows can't query records, so the logic can't be moved at all
    4. Yes. Flows run with their own separate set of governor limits
    Show the answer

    Correct answer: A. No. A flow's queries count against the same transaction limits as Apex

    Flows run in the same transaction as the triggers and other automation fired by a save, and their Get Records elements count as SOQL queries against the same limit. Moving the logic changes nothing about the limit; bulkifying it does. Flows can query records, and before-save flows aren't exempt.

  7. Question 7

    New cases that arrive from the web must have a Priority of Medium unless the web form supplies one. What's the simplest way to do this?

    1. Add a validation rule that requires a priority on each case
    2. Build an after-save flow that updates the priority field
    3. Write a before insert trigger that sets the priority value
    4. Set Medium as the default value of the Priority picklist
    Show the answer

    Correct answer: D. Set Medium as the default value of the Priority picklist

    A field's default value applies whenever a new record doesn't supply one, with no code or automation to maintain, which makes it the clicks-before-code answer. A trigger works but adds code and tests, an after-save flow adds an unnecessary second update, and a validation rule would reject web cases instead of filling the value.

  8. Question 8

    A developer inserts opportunities that must link to existing accounts. The source data has each account's ERP number, stored on Account in an External ID field, but not its Salesforce ID. What's the most efficient approach?

    1. Set each opportunity's AccountId field to the ERP number and insert the list
    2. Query each opportunity's account inside the loop to find its Salesforce record ID
    3. Set each opportunity's Account to an Account instance holding only the ERP number, then insert
    4. Insert the opportunities first, then update each one with the ID of its account
    Show the answer

    Correct answer: C. Set each opportunity's Account to an Account instance holding only the ERP number, then insert

    Apex can relate records through an External ID: assign the relationship field a new Account that sets only the External ID value, and the platform finds the matching account during the insert. That needs no queries and one DML statement. Querying in a loop breaks limits, inserting then updating doubles the DML, and AccountId only accepts a Salesforce ID.

  9. Question 9

    An Apex utility must list every field on any object passed to it, at run time. What should it use?

    1. A custom setting that stores a list of every object's field names
    2. Schema describe, such as getDescribe() on its SObjectType
    3. The Metadata API's deploy call, made inside the same transaction
    4. A dynamic SOQL query in the form SELECT * FROM the object that was passed in
    Show the answer

    Correct answer: B. Schema describe, such as getDescribe() on its SObjectType

    Schema describe methods return an object's fields and their properties at run time, so the code works for any object, including fields added later. SOQL has no SELECT *, the Metadata API deploys changes rather than reading schema in Apex, and a hand-maintained list goes out of date.

  10. Question 10

    A developer wants the code that Agentforce Vibes generates to use the org's real custom objects and fields instead of guessed names. What helps most?

    1. Connecting the Salesforce DX MCP server, so that it can read the org's metadata
    2. Turning off telemetry so that the assistant runs in a local-only mode
    3. Using a shorter prompt with fewer details, so that it guesses less
    4. Writing the prompt in the Developer Console rather than in VS Code
    Show the answer

    Correct answer: A. Connecting the Salesforce DX MCP server, so that it can read the org's metadata

    The Salesforce DX MCP server lets the assistant query the org's schema and metadata, so it can generate code that uses the actual objects, fields and conventions. Telemetry must stay on for the tool to work, it isn't available in the Developer Console, and less context produces worse results, not better.

Want the rest?

The full package has 250 questions across every exam domain, timed exams at the real length, a study guide, flashcards and a readiness check. The Developer Fundamentals chapter and the readiness check are free to try.

Or Lifetime Access: $79 once for every certification on ForceDigest.