SF-PD2 Advanced Developer Fundamentals Practice Question
A developer wants to create a custom setting that can be accessed globally within Apex code without performing a SOQL query. Which type of custom setting is most appropriate if the data varies per user profile?
⚠ Common exam trap
Candidates frequently confuse List Custom Settings with Hierarchy Custom Settings, assuming both support profile-level data variance, which leads to incorrect architectural selections for user-specific configurations.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Hierarchy Custom Setting.
Custom Settings are categorized into List and Hierarchy types. Hierarchy Custom Settings allow developers to define values at the Organization, Profile, or User level. This provides a flexible mechanism to retrieve environment-specific configurations without the overhead of SOQL queries, which count against governor limits. For per-profile configuration, the Hierarchy type is the standard architectural choice in Salesforce development.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
List Custom Setting.
Why it's wrong here
List Custom Settings provide a static set of data that is accessible application-wide. They do not support hierarchical overrides based on profile or user, making them unsuitable for scenarios where different profiles require distinct configuration values for the same logic settings within the application's runtime context.
- ✓
Hierarchy Custom Setting.
Why this is correct
Hierarchy Custom Settings allow for data to be defined at the Organization, Profile, and User levels. When accessed in Apex, the system automatically retrieves the most specific value for the running user, making it ideal for profile-specific configurations without requiring complex logic or database queries to fetch data.
- ✗
Custom Metadata Type.
Why it's wrong here
Custom Metadata Types are excellent for deployment-related settings, but they do not support user-based or profile-based hierarchical overrides natively. They are intended for data that defines application behavior across all users and environments, rather than settings that vary based on the identity or profile of the authenticated user.
- ✗
Custom Object with a lookup to User.
Why it's wrong here
Using a Custom Object for configuration requires a SOQL query to retrieve the data. This consumes governor limits and is less performant than Custom Settings, which are cached in memory. Furthermore, querying for every configuration check adds unnecessary latency and potential for performance bottlenecks in high-traffic applications.
About these practice questions
This SF-PD2 question is part of Courseiva's 226-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.