Sign in
Home/Salesforce/Salesforce Certified Platform Developer I (CRT-450)/Free questions

Salesforce Certified Platform Developer I (CRT-450) — Free Practice Questions

10 free sample questions from a bank of 484, with the correct answers and explanations. No signup required — start practising right now.

1Which statement results in an Apex compiler error?
  • Map lmap = new Map ([Select ID from Lead Limit 8]);
  • Date d1 = Date.Today(), d2 = Date.ValueOf('2018-01-01');
  • Integer a=5, b=6, c, d = 7;
  • List s = List {'a','b','c');
Answer: D

The short version

D — Mismatched list delimiters plus raw typing cause the compiler error. The line opens with List but closes with a parenthesis while mixing set literal braces, so Apex cannot parse it.

Key concepts in this question

  • Apex collection literals: list literals use square brackets or the List prefix with matching delimiters, set literals use curly braces consistently.
  • Raw versus typed collections: modern Apex expects parameterized types such as List of String, while raw List usage invites conversion and compilation problems.
  • Map construction from SOQL: assigning a query result directly to a Map keyed by Id is an accepted pattern, not an error here.
  • Multiple variable declaration: Apex permits comma-separated declarations with partial initialization on one line.
  • Date factory methods: Today and ValueOf with a valid date string are standard, compilable calls.

Why D is correct

D is correct because List s equals List open-brace with quoted elements but close-parenthesis breaks every Apex grammar rule for generics and literals. The compiler expects matching brackets and a parameterized type, so it reports an error at this line. That single malformed statement contrasts with the three legal patterns in the other options and matches the settled key.

Why the others are wrong

  • A. Assigning a Lead query to a Map is an accepted Id-keyed map initialization pattern and compiles cleanly.
  • B. Declaring two dates with Today and ValueOf uses valid factories and comma declaration syntax, so it compiles.
  • C. Declaring integers with mixed initialization on one line is legal Apex and produces no compiler error.

CRT-450 exam tip

For CRT-450 syntax, check brackets first: mixed brace and parenthesis plus missing type parameter means compiler error.

2A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage. Production data is not required for the integration testing. Which two environments meet the requirements for testing? (Choose two.)
  • Developer Sandbox
  • Full Sandbox
  • Developer Edition
  • Partial Sandbox
  • Developer Pro Sandbox
Answer: B, D

The short version

BD — Full plus Partial sandboxes support 2 GB integration testing without production data. Both offer multi-gigabyte storage and templates or full copies suitable for volume testing, unlike small developer environments.

Key concepts in this question

  • Full Sandbox: a production replica with full data and the largest storage allowance, suitable for performance and integration volume tests.
  • Partial Sandbox: a sampled-data sandbox with 5 GB storage and templated records, enough for 2 GB testing without full production.
  • Developer and Developer Pro: lightweight code-only sandboxes with 200 MB to 1 GB limits, insufficient for 2 GB data needs.
  • Developer Edition: a personal free org with tight storage caps, not intended for multi-gigabyte integration validation.
  • Production data requirement: the stem explicitly says production data is not required, so a template-based Partial copy is acceptable.

Why BD is correct

BD is correct because only Full and Partial exceed the 2 GB threshold while supporting realistic integration flows. Full provides a complete replica when needed, while Partial provides sampled production schema plus 5 GB capacity, satisfying volume without mandating a full copy. Their storage and template characteristics directly meet the stated test-data estimate.

Why the others are wrong

  • A. Developer Sandbox is limited to about 200 MB and carries no production data, so it cannot hold 2 GB.
  • C. Developer Edition has minimal storage for personal development, far below the 2 GB integration requirement.
  • E. Developer Pro Sandbox raises limits to about 1 GB but still falls short of the estimated 2 GB volume.

CRT-450 exam tip

Memorize sandbox storage for CRT-450: Developer 200 MB, Pro 1 GB, Partial 5 GB, Full mirrors production.

3A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a Visualforce page for shoppers. Which field type should the developer choose to ensure that the description will be searchable in the custom Apex SOQL queries that are written?
  • Text Area
  • Text
  • Text Area (Long)
  • Text Area (Rich)
Answer: A

The short version

A — Plain Text Area preserves multiline input and remains SOQL-searchable. It allows line breaks for product setup while supporting WHERE filters, unlike long or rich variants.

Key concepts in this question

  • Text Area: a 255-character multiline field that stores line breaks and can be used in SOQL WHERE clauses for searching.
  • Text: a single-line field limited in length and unsuitable for separate-line product descriptions.
  • Text Area Long: a large multiline field up to 131072 characters that cannot be used in SOQL WHERE filtering.
  • Text Area Rich: a formatted field with images and markup that is also non-filterable and non-searchable in SOQL.
  • Visualforce display: all multiline types render line breaks, so searchability becomes the deciding requirement.

Why A is correct

A is correct because only plain Text Area satisfies both stem conditions at once. It accepts user-entered separate lines during product setup and displays them on Visualforce, while remaining filterable in custom Apex SOQL queries. Long and Rich areas fail the searchability clause despite larger capacity, making plain Text Area the settled answer.

Why the others are wrong

  • B. Text is single-line and too short for multiline product descriptions entered on separate lines.
  • C. Text Area Long supports long multiline input but cannot appear in SOQL WHERE clauses, violating the search need.
  • D. Text Area Rich adds formatting but is likewise excluded from SOQL filtering and adds unneeded markup.

CRT-450 exam tip

For CRT-450 fields, link searchable plus multiline to plain Text Area, and link large or formatted to non-searchable Long and Rich.

4A developer wants multiple test classes to use the same set of test data. How should the developer create the test data?
  • Reference a test utility class in each test class.
  • Define variables for test records in each test class.
  • Create a Test Setup method for each test class.
  • Use the SeeAllData=true annotation in each test class.
Answer: A

The short version

A — A shared test utility class centralizes reusable test data creation. Multiple test classes call its factory methods, ensuring consistent records without duplicating setup logic.

Key concepts in this question

  • Test utility class: a public helper marked for testing that builds accounts, contacts or custom objects for any caller.
  • Test Setup methods: per-class fixtures annotated for setup that do not automatically share across different test classes.
  • Per-class variables: duplicated record creation in each class, brittle and wasteful when many classes need the same data.
  • SeeAllData true: a legacy escape hatch exposing org data to tests, harming isolation and portability.
  • Test isolation principles: Salesforce runs tests without org data by default, favoring programmatic factories for repeatability.

Why A is correct

A is correct because referencing one utility class gives every test class the same creation logic, field defaults and relationships. Changes happen once in the helper rather than in every class, and governor-efficient bulk creation can be reused widely. That reuse and consistency is the documented pattern for sharing test data across test classes.

Why the others are wrong

  • B. Defining variables separately in each class duplicates code and diverges over time, the opposite of sharing.
  • C. Creating a Test Setup method per class still scopes data to that class and repeats logic across the suite.
  • D. Using SeeAllData true couples tests to org contents, breaking isolation and deployment reliability.

CRT-450 exam tip

On CRT-450, when the stem says multiple test classes plus same data, immediately choose test utility class.

5A developer wants to display all of the picklist entries for the Opportunity StageName field and all of the available record types for the Opportunity object on a Visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? (Choose two.)
  • Use Schema.RecordTypeInfo returned by Opportunity.SObjectType.getDescribe().getRecordTypeInfos().
  • Use Schema.PicklistEntry returned by Opportunity.SObjectType.getDescribe().getPicklistValues ().
  • Use Schema.RecordTypeInfo returned by RecordType.SObjectType.getDescribe().getRecordTypeInfos().
  • Use Schema.PicklistEntry returned by Opportunity.StageName.getDescribe().getPicklistValues ().
Answer: A, D

The short version

AD — RecordTypeInfos from Opportunity plus StageName picklist entries supply both lists. One describe call exposes record types while the field describe exposes StageName values.

Key concepts in this question

  • Schema describe: runtime metadata access revealing object and field characteristics for dynamic Visualforce controllers.
  • RecordTypeInfo collection: returned by Opportunity SObjectType describe getRecordTypeInfos, listing available record types for that object.
  • PicklistEntry collection: returned by Opportunity StageName field describe getPicklistValues, listing StageName choices.
  • Object-level getPicklistValues: no such valid describe path exists on the SObject describe itself for a specific field.
  • RecordType SObject confusion: querying RecordType object metadata does not yield Opportunity-scoped availability for the page.

Why AD is correct

AD is correct because the two documented describe paths complement each other exactly. Opportunity SObjectType getDescribe getRecordTypeInfos returns Schema RecordTypeInfo for Opportunity availability, while Opportunity StageName getDescribe getPicklistValues returns Schema PicklistEntry for StageName. Together they let the controller display both sets on Visualforce as the stem requires.

Why the others are wrong

  • B. Calling getPicklistValues on the Opportunity SObject describe is not the valid field-level describe pattern for StageName.
  • C. Describing the generic RecordType SObject misses Opportunity-specific availability needed for this Visualforce page.

CRT-450 exam tip

Remember the pair for CRT-450: record types from SObject describe, picklist values from field describe.

6In order to override a standard action with a Visualforce page, which attribute must be defined in the tag?
  • pageReference
  • override
  • controller
  • standardController
Answer: D

The short version

D — standardController binds a Visualforce page to a standard action for override. Without that attribute the page has no record context and cannot replace view, edit or delete behavior.

Key concepts in this question

  • Standard action override: replacing Salesforce view, new, edit or delete with custom Visualforce while preserving record context.
  • standardController attribute: set to the object name on the page tag so the controller loads the current record automatically.
  • Custom controller attribute: used for fully custom logic without standard-action binding, insufficient for overrides alone.
  • Override and pageReference ideas: procedural or navigation concepts, not page-tag attributes that establish override context.
  • Visualforce page tag contract: Salesforce validates the presence of standardController before allowing override assignment in setup.

Why D is correct

D is correct because Salesforce requires standardController on the apex page tag to expose the standard record, its fields and its actions to the page. That binding lets administrators assign the page as the override target for that object. No other attribute creates the standard record context the override mechanism depends upon.

Why the others are wrong

  • A. pageReference is an Apex navigation return type, not a page-tag attribute enabling standard overrides.
  • B. override is the conceptual action being performed, not the attribute name defined on the tag.
  • C. controller points to a custom Apex class and alone does not provide standard-action record binding.

CRT-450 exam tip

For CRT-450 overrides, memorize that standardController on the page tag is mandatory for standard-action replacement.

7Which feature allows a developer to create test records for use in test classes?
  • Documents
  • WebServiceTests
  • HttpCalloutMocks
  • Static Resources
Answer: D

The short version

D — Static Resources with Test dot loadData create repeatable test records. CSV data stored as a resource is loaded into test context without depending on org data.

Key concepts in this question

  • Static Resources: deployable files including CSV datasets that tests can read deterministically in any org.
  • Test dot loadData: the API that inserts CSV resource rows as sObjects for use inside test methods.
  • Documents: legacy file storage for user content, not a test-data factory mechanism.
  • WebServiceTests and HttpCalloutMocks: callout-testing utilities for mocking external responses, not for seeding records.
  • Isolated test data: Salesforce best practice favors resource-driven creation over SeeAllData for portability.

Why D is correct

D is correct because the settled pattern pairs a CSV Static Resource with Test dot loadData to insert standard or custom object rows during tests. Developers author the spreadsheet once, deploy it as metadata and load it wherever needed. That gives versioned, org-independent test records exactly as the stem asks.

Why the others are wrong

  • A. Documents store user-facing files and offer no test-loading API for record creation.
  • B. WebServiceTests relate to legacy SOAP test scaffolding, not general record seeding for test classes.
  • C. HttpCalloutMocks simulate HTTP responses for callout tests, they do not insert persistent test records.

CRT-450 exam tip

Link test records on CRT-450 to Static Resources plus Test dot loadData, and link callouts to mocks instead.

8How many levels of child records can be returned in a single SOQL query from one parent object?
  • 1
  • 3
  • 5
  • 7
Answer: C

The short version

C — Five levels of child records is the settled SOQL parent-to-child limit. One parent query can nest child subqueries down through five relationship levels in this bank.

Key concepts in this question

  • Parent-to-child subquery: a nested SELECT on a child relationship inside a parent query, using the relationship name.
  • Child relationship levels: successive one-to-many traversals downward from the queried parent object.
  • Governor and complexity controls: Salesforce caps nesting depth to protect performance and result size.
  • Single-level versus deep queries: shallow queries stay efficient while deeper nesting multiplies rows and processing cost.
  • Settled-bank discipline: this item tests recall of the stated limit rather than derivation from first principles.

Why C is correct

C is correct because the settled answer key defines five as the maximum number of child levels returnable from one parent object in a single SOQL query. Candidates must apply that stated boundary when designing queries and avoid deeper nesting that would fail at runtime. The key therefore points to five as the governing depth for this exam bank.

Why the others are wrong

  • A. One level understates the settled multi-level capability and would unnecessarily force extra queries.
  • B. Three levels is a plausible governor number elsewhere but does not match the settled five-level key here.
  • D. Seven levels exceeds the settled boundary and would breach the depth protection the limit is meant to enforce.

CRT-450 exam tip

For CRT-450 recall, lock in five child levels for this question and validate depth before adding nested subqueries.

9Which two declarative process automation features can be directly invoked when a field value changes on a record? (Choose two.)
  • Cloud Flow Designer flows
  • Process Builder processes
  • Validation rules
  • Workflow rules
Answer: B, D

The short version

BD — Process Builder plus Workflow rules fire directly on field-value change. Both are declarative automation tools whose evaluation criteria listen for record saves with changed values.

Key concepts in this question

  • Process Builder processes: criteria-based automation that can start when a record is created or edited and conditions are met.
  • Workflow rules: rule-plus-action automation with evaluation options including created and every time edited to subsequently meet criteria.
  • Cloud Flow Designer flows: a legacy canvas concept, not the event-driven engine invoked directly by field changes in this taxonomy.
  • Validation rules: data-quality guards that block saves but do not perform invoked process automation on change.
  • Direct invocation meaning: the feature itself starts from the save event rather than requiring manual launch or scheduled batch.

Why BD is correct

BD is correct because both Process Builder and Workflow rules register on the object save event and evaluate field-change criteria immediately. A field edit on the record triggers their criteria checks and runs associated actions without code. That direct field-change invocation matches the stem and the settled pair.

Why the others are wrong

  • A. Cloud Flow Designer flows as named here are not the field-change-triggered declarative pair tested by the settled key.
  • C. Validation rules enforce correctness and prevent bad saves, they do not execute invoked automation when values change.

CRT-450 exam tip

On CRT-450, pair field changes with Process Builder and Workflow rules, and pair complex logic with Flow separately.

10How can a developer warn users of SOQL governor limit violations in a trigger?
  • Use Messaging.SendEmail() to continue the transaction and send an alert to the user after the number of SOQL queries exceeds the limit.
  • Use PageReference.setRedirect() to redirect the user to a custom Visualforce page before the number of SOQL queries exceeds the limit.
  • Use Limits.getQueries() and display an error message before the number of SOQL queries exceeds the limit.
  • Use ApexMessage.Message() to display an error message after the number of SOQL queries exceeds the limit.
Answer: C

The short version

C — Limits dot getQueries plus a preemptive error warns before hitting SOQL caps. Checking consumption inside the trigger lets the developer surface a friendly message while the transaction can still be guided.

Key concepts in this question

  • SOQL governor limits: a hard cap of 100 synchronous queries per transaction that aborts execution when exceeded.
  • Limits class: provides getQueries and getLimitQueries so code can measure consumption before breaching the cap.
  • Trigger context: bulk record processing where loops easily multiply queries and need early warning logic.
  • Post-limit handling impossibility: once the limit is exceeded the transaction throws and cannot continue to send mail or redirect.
  • User-facing errors: addError or page messages added before breach guide users instead of an unhandled governor exception.

Why C is correct

C is correct because only proactive Limits checking can warn before violation. By comparing getQueries against the limit inside trigger logic, the developer detects pressure early and displays an error message in time. After-the-fact mail, redirect or messaging cannot run once Salesforce has already thrown the LimitException.

Why the others are wrong

  • A. Messaging dot SendEmail after exceeding the limit cannot execute because the transaction has already been terminated.
  • B. PageReference redirect before breach sounds proactive but does not measure usage and cannot run from a trigger context reliably.
  • D. ApexMessage display after exceeding the limit is too late, since governor failure aborts further handling.

CRT-450 exam tip

For CRT-450 governor warnings, always check Limits dot getQueries first and fail gracefully before the cap hits.

Want the full bank of 484 questions for Salesforce Certified Platform Developer I (CRT-450)? See all practice exams.