{"id":2600,"date":"2026-11-12T09:00:00","date_gmt":"2026-11-12T03:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/"},"modified":"2026-11-22T11:17:50","modified_gmt":"2026-11-22T05:47:50","slug":"custom-metadata-interview-questions","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/","title":{"rendered":"Custom Metadata Interview Questions and Config Driven Apex"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">Custom Metadata Interview Questions sound like an admin topic until an interviewer asks why your Apex has a hard coded discount rate in it. The answer they want is that rules belong in configuration, not in code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Last reviewed for the Winter &#8217;27 release (November 2026).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">This post covers what gets asked, grouped into the basics, the comparison with custom settings, reading them from Apex, deployment and packaging, and scenario questions where a change should not need a release.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-1-1024x640.png\" alt=\"Custom Metadata Interview Questions diagram showing an admin edit changing Apex behaviour\" class=\"wp-image-2598\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Caption: An admin changes a record, the behaviour changes, and nothing is redeployed.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What Custom Metadata Interview Questions Cover<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom Metadata Interview Questions test whether you can separate rules from logic. The comparison in <a href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-types-vs-custom-settings\/\">custom metadata versus custom settings<\/a> covers the trade offs in full. A custom metadata type looks like a custom object, and its records travel with the metadata rather than as data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Think of it like a price list pinned to the wall of a workshop. The tools do not change when the prices do.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That is the value Custom Metadata Interview Questions are really probing. A discount rate, a mapping table, an endpoint name or a feature switch can change in production without a deployment.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">How a Custom Metadata Type Is Built<\/h2>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Piece<\/th><th>What it is<\/th><\/tr><\/thead><tbody><tr><td>The type<\/td><td>A definition with a mdt suffix, like an object<\/td><\/tr><tr><td>Custom fields<\/td><td>Text, number, checkbox, picklist and relationship fields<\/td><\/tr><tr><td>Records<\/td><td>Rows, each with a developer name, that deploy as metadata<\/td><\/tr><tr><td>Metadata relationship<\/td><td>A field pointing at another type or an entity definition<\/td><\/tr><tr><td>Protected setting<\/td><td>Hides records from a subscriber org in a package<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom Metadata Interview Questions often land here. The developer name on each record is what your code should match on, since a label can be renamed by an admin.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>public with sharing class FeeRules {\r\n\r\n    public static Decimal discountFor(String level) {\r\n        Fee_Rule__mdt rule = Fee_Rule__mdt.getInstance(level);\r\n        return rule == null ? 0 : rule.Discount_Percent__c;\r\n    }\r\n\r\n    public static List&lt;Fee_Rule__mdt&gt; all() {\r\n        return Fee_Rule__mdt.getAll().values();\r\n    }\r\n}<\/code><\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Those two methods answer most Custom Metadata Interview Questions. The instance method fetches one record by developer name, and the all method returns every record, and neither consumes a SOQL query.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Custom Metadata vs Custom Settings<\/h2>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-2-1024x640.png\" alt=\"Custom Metadata Interview Questions comparison with custom settings\" class=\"wp-image-2599\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Caption: Rules that ship with the code go in metadata, and per user toggles go in settings.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Need<\/th><th>Pick<\/th><\/tr><\/thead><tbody><tr><td>A discount table that deploys with the code<\/td><td>Custom metadata<\/td><\/tr><tr><td>An endpoint name per environment<\/td><td>Custom metadata<\/td><\/tr><tr><td>A per user feature toggle<\/td><td>Hierarchy custom setting<\/td><\/tr><tr><td>A value a specific profile overrides<\/td><td>Hierarchy custom setting<\/td><\/tr><tr><td>Records a managed package must install<\/td><td>Custom metadata<\/td><\/tr><tr><td>A value an admin changes weekly<\/td><td>Either, based on who owns it<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom Metadata Interview Questions often finish with a requirement and ask which you would pick.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The posts on <a href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-in-apex\/\">custom metadata in Apex<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/hierarchy-custom-settings-apex\/\">hierarchy custom settings<\/a> cover both sides.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Custom Metadata Interview Questions on the Basics<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q1: What is a custom metadata type?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A type you define like a custom object, but whose records are treated as metadata, not data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That means the records deploy with your code, live in source control and can ship in packages. Example: a <a href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-in-apex\/\">Discount_Rule__mdt<\/a> type with one record per customer tier.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give a real example in your first sentence. It turns a definition into experience.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q2: What suffix does the API name use?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">__mdt, like Discount_Rule__mdt.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Fields on the type end in __c as usual, so you read Discount_Rule__mdt.Percent__c in Apex.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q3: Why is it called metadata rather than data?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because its records deploy between orgs and can ship in a package, like other metadata.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Ordinary data, like Accounts, must be loaded into each org separately. Custom metadata records move with the release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Can custom metadata hold records for millions of rows? No, it is for configuration, with an org size limit.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q4: Does a custom metadata query count against SOQL limits?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Reading records with getAll() and getInstance() does not use a SOQL query.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The values are cached by the platform, so config driven code stays cheap even when it is called often.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention CPU time too: no query does not mean free.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q5: Which method returns one record?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">getInstance, with the developer name or the record ID.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Discount_Rule__mdt gold = Discount_Rule__mdt.getInstance(&#8216;Gold&#8217;); It returns null if no record matches.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Method<\/th><th>Returns<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>getInstance(name)<\/td><td>One record or null<\/td><td>Discount_Rule__mdt.getInstance(&#8216;Gold&#8217;)<\/td><\/tr><tr><td>getAll()<\/td><td>Map of developer name to record<\/td><td>Discount_Rule__mdt.getAll().values()<\/td><\/tr><tr><td>SOQL<\/td><td>List of records, with filters<\/td><td>[SELECT Percent__c FROM Discount_Rule__mdt WHERE Active__c = true]<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q6: Which method returns all records?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">getAll, which returns a Map keyed by developer name.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: for (Discount_Rule__mdt r : Discount_Rule__mdt.getAll().values()) { &#8230; } loops over every record without a query.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Does getAll return records in order? No, it is a Map, so sort a list if order matters.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q7: Can you write to custom metadata from Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Not with normal DML. Changes are deployed through the Metadata API.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In Apex, Metadata.Operations.enqueueDeployment can deploy records, but it runs asynchronously, so it is not for changes inside a transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: name Metadata.Operations.enqueueDeployment. Few candidates know it exists.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q8: Why is that limitation acceptable?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because configuration should be changed on purpose, not by a running transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It keeps settings stable and traceable: every change is a deployment or an admin edit, not a side effect of code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q9: Can a Flow read custom metadata?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, through a Get Records element.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That makes the same rules usable by admins in flows and by developers in Apex, so the logic stays in one place.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q10: Can a formula field read it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, with the $CustomMetadata merge syntax.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Amount__c * $CustomMetadata.Discount_Rule__mdt.Gold.Percent__c \/ 100 reads one specific record&#8217;s field.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Can formulas read custom settings too? Yes, with $Setup for hierarchy settings.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q11: Can a validation rule read it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, which is a common way to keep a threshold out of the rule&#8217;s formula.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Fee__c &gt; $CustomMetadata.Limits__mdt.Max_Fee.Value__c lets an admin change the maximum fee without editing the rule.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q12: What field types are supported?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Text, long text, number, percent, date, checkbox, picklist, URL, email, phone and relationship fields, among others.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Some types, like formula fields and roll ups, are not available, because the records are static configuration.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q13: What is a metadata relationship?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A field that points at another custom metadata type, or at an object or field through an entity definition.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a Field_Mapping__mdt record can point at the Account object and at its Industry field, so code knows exactly what to map.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Can a custom metadata record point at a regular record, like an Account? No, only at other metadata or entity definitions.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q14: Why is an entity definition field useful?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It lets one record refer to an object, so a rule can be defined per object.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: one Validation_Config__mdt record per object, with an entity definition field saying which object it applies to.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q15: Should your code match on the label or the developer name?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The developer name, because a label can be renamed by any admin.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use DeveloperName or QualifiedApiName in code, and keep labels for people reading the records in Setup.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give the renamed label bug as an example. It shows real experience.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q16: Is a custom metadata record visible to all users?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It depends on the type&#8217;s visibility setting: public, or protected in a managed package.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In your own org, users read the records through code, flows and formulas, and admins with Customize Application can edit them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q17: What is the difference between custom metadata and a custom object for configuration?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom metadata records deploy, are cached and are read without SOQL limits. A custom object&#8217;s records are data: they must be loaded per org, cost queries to read, and use data storage. Use a custom object only when the configuration is large, changes constantly or needs triggers.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q18: Can you use custom metadata in an LWC?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, with the UI API wire adapters or through an Apex method that reads it. A common pattern is a cacheable Apex method that returns the records the component needs, like labels for a dynamic form.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q19: What does protected mean in a package?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Subscribers cannot see or edit the records, which suits internal configuration.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use public for normal configuration in your own org, and protected for package settings your customers should not change.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Custom Metadata Interview Questions on Custom Settings<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q20: What are the two kinds of custom setting?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">List custom settings and hierarchy custom settings.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option<\/th><th>Values per user or profile<\/th><th>Records deploy<\/th><th>Writable with DML<\/th><th>Best for<\/th><\/tr><\/thead><tbody><tr><td>Custom metadata type<\/td><td>No<\/td><td>Yes<\/td><td>No<\/td><td>Rules and mappings that move with releases<\/td><\/tr><tr><td>Hierarchy custom setting<\/td><td>Yes<\/td><td>No, data only<\/td><td>Yes<\/td><td>Per user or per profile switches<\/td><\/tr><tr><td>List custom setting<\/td><td>No<\/td><td>No, data only<\/td><td>Yes<\/td><td>Older code; prefer custom metadata<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q21: What does a hierarchy setting give you?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Values at org, profile and user level, with the <a href=\"https:\/\/swapnilzambare.com\/blog\/hierarchy-custom-settings-apex\/\">most specific one winning<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: the org default says Enable_Sync__c is false, but the integration user&#8217;s own record says true, so only that user gets sync.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: say &#8220;most specific wins&#8221; and give the order: user, profile, org.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q22: Which method reads the value for the current user?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">getInstance(), which works out the right value for the running user from the hierarchy.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Feature_Flags__c flags = Feature_Flags__c.getInstance(); returns the user&#8217;s record, then the profile&#8217;s, then the org default.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: What does getInstance(userId) do? Returns the value for a specific user or profile ID.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q23: Which method reads the org default?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">getOrgDefaults().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Feature_Flags__c.getOrgDefaults().Enable_Sync__c reads the org level value, ignoring user and profile records.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q24: Do custom setting reads consume SOQL queries?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Custom setting reads come from the application cache, not a query.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That makes them cheap to read in triggers and loops, like custom metadata.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q25: Are custom setting records deployable?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. The definition deploys, but the records are data you create in each org.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">After a deployment, someone must enter or load the values, which is easy to forget in a new sandbox.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you load settings after a sandbox refresh? A post refresh Apex class or a data load script.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q26: Can a managed package ship custom setting records?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Managed packages cannot ship custom setting records.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That is one of the main reasons teams moved to custom metadata, whose records install with the package.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: this is the reason packages moved to custom metadata. Say it clearly.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q27: When is a list custom setting still the right choice?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Rarely for new work, because custom metadata covers the same ground and deploys.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Salesforce <a href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-types-vs-custom-settings\/\">recommends custom metadata over list custom settings<\/a>. Keep list settings only where old code still depends on them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q28: Why would you keep a hierarchy setting?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">For a per user or per profile switch, which custom metadata cannot express.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a trigger bypass that is on only for the data migration user.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q29: Can you write to a custom setting from Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, with normal DML, because the records are data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: update the org default record in a setup script, or let an admin screen change a value.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q30: What is the size limit for custom metadata?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Each org has a total size limit for custom metadata records, around 10 MB, and each certified managed package adds its own allowance. You can check usage in Setup under Custom Metadata Types. It is plenty for configuration, but not for large reference data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q31: What is the difference between a hierarchy custom setting and a custom permission?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A hierarchy setting holds values, like a number or a checkbox, per user or profile. A custom permission is a simple yes or no that you assign through permission sets and check with FeatureManagement.checkPermission. For on or off access, custom permissions are cleaner.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q32: Does that make them better for a feature switch an admin flips?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom settings suit a switch that differs per user. Custom metadata suits one value for the whole org that should deploy.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If support needs to flip a switch in production quickly for one user, a hierarchy setting is easier. For an org wide rule that should match across sandboxes, use custom metadata.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give both cases with an example each. It shows judgement, not memorisation.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Custom Metadata Interview Questions on Config Driven Apex<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q33: What does config driven mean in practice?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Behaviour comes from records, so a change is an admin edit instead of a code deployment.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The code reads the rules and acts on them. Example: commission rates by region live in records, and the code never hard codes a percentage.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q34: Give a good example of something to move into metadata.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A discount table, a field mapping, a threshold, an endpoint path or a feature switch.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These are values that change more often than the logic around them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q35: Give a bad example.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Logic with branching that nobody can read from a table belongs in code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If understanding the behaviour means reading 40 records in a specific order, the configuration has become a hidden programming language.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: interviewers like candidates who say what not to configure.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q36: How do you avoid reading the same records repeatedly?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Cache them in a static Map the first time they are read in the transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: private static Map&lt;String, Discount_Rule__mdt&gt; rules; public static Map&lt;String, Discount_Rule__mdt&gt; getRules() { if (rules == null) rules = Discount_Rule__mdt.getAll(); return rules; }<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Does a static cache survive between transactions? No, it is rebuilt in each one.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q37: Why does that matter if there is no query cost?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because each call still costs CPU time, and that adds up when it runs for every record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A getAll() inside a loop over 200 records repeats the same work 200 times. Read once, then use the Map.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q38: How do you make a trigger handler config driven?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Store a switch per object and handler in custom metadata, and <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-trigger-handler-pattern\/\">check it at the top of the handler<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: if (!Trigger_Setting__mdt.getInstance(&#8216;Account_Handler&#8217;).Is_Active__c) return;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q39: Why is that pattern popular?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It lets support turn off one piece of automation, like during a data load, without a deployment.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It also helps when a new handler misbehaves in production: switch it off, fix it, switch it back on.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q40: How do you test config driven code?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Inject the values, so the test does not depend on records in the org.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Put the reading behind a small class or method that tests can replace, for example with a <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-stub-api-mocking\/\">stub<\/a> or a test only setter.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: name the pattern, injecting a dependency, and why tests need it.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q41: Can a test insert custom metadata records?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Not with DML. The usual approach is to inject the values through a setter or a stub.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Tests can still read real records that exist in the org, but depending on them makes tests fragile.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q42: What is the risk of too much configuration?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Logic spread across many records that nobody can read end to end, which is harder to follow than code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It also hides changes from code review, because a record edit in production can change behaviour with no pull request.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q43: How do you keep that in check?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep each type small and single purpose, and document which code reads it.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Deploy record changes through source control like code, so they get reviewed.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q44: What is a field mapping type used for?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Describing how an outside payload maps to Salesforce fields, without changing Apex.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: each record says partner field cust_name maps to Account.Name, and the integration code loops over the mapping.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q45: How do you design a configurable approval threshold?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Create a custom metadata type like Approval_Threshold__mdt with fields for the object, the amount and the approver role. The flow or Apex reads the record for the current object and compares the amount, so finance can change thresholds without a release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q46: How do you version configuration safely?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep custom metadata records in source control next to the code, review changes in pull requests, and deploy them through the same pipeline. Avoid editing records directly in production except for urgent fixes, and back port those to Git right after.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q47: How does that help an integration?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A new field from the partner becomes one new record instead of a code release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The integration code stays the same, and the mapping is easy to review.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Scenario Based Custom Metadata Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q48: Scenario: a discount rate changes every quarter. Where does it live?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In a custom metadata record, so the change is an edit, not a release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The quarter&#8217;s rate goes into a record like Discount_Rule__mdt.Q4. Deploying it through source control keeps a history of each change.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you keep a history of rate changes? Deploy records through Git, so each change has a commit.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q49: Scenario: an endpoint differs per sandbox. How do you handle it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A named credential for the connection, and custom metadata or a custom setting for anything else that differs per environment.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/swapnilzambare.com\/blog\/named-credentials-in-apex-callouts\/\">Named credentials can point<\/a> at a different URL in each sandbox, and admins can update them after a refresh.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q50: Scenario: support needs to switch off one trigger during a load. What do you build?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A custom metadata switch per handler, checked at the top of the handler.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">For a switch that applies to only the data load user, use a hierarchy custom setting or a custom permission instead.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q51: Scenario: a package must install with default rules. Which do you use?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom metadata, because its records can <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-unlocked-packages-2gp\/\">ship in a package<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Subscribers get the default rules at install, and you can update them in later package versions.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: connect packages with records shipping at install time.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q52: Scenario: each sales user needs their own default. Which do you use?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A hierarchy custom setting, because custom metadata has no per user layer.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Each user can have their own record, and users without one fall back to their profile or the org default.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q53: Scenario: a test fails because a metadata record is missing in the target org. What do you change?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Inject the value in the test instead of reading it from the org.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Or make the code fall back to a safe default when getInstance returns null, which also protects production.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q54: Scenario: CPU time rose after a config change. What is the likely cause?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The metadata read is inside a loop instead of cached in a static variable.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Move the read out of the loop or into a static cache, then <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-performance-profiling\/\">measure CPU time again<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q55: Scenario: an admin renamed a label and the code broke. Why?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The code matched the label instead of the developer name.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Change the code to use DeveloperName or QualifiedApiName, which admins cannot change by accident.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Can DeveloperName change? Yes, but it is rarer and should go through a release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q56: Scenario: a rule needs to differ per object. What field type helps?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">An entity definition relationship field, so one record can point at an object.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Code can then find the rule for the current object with a simple lookup.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q57: Scenario: a manager asks to see the current rules. What do you show them?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The custom metadata records in Setup, which is one of the real benefits.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Managers can read the current rules without opening any code. A list view on the type shows them like a table.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q58: Scenario: the team wants everything configurable. What do you push back on?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Branching logic, which becomes unreadable as records and harder to test than code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep values in configuration and logic in code. Agree a simple rule with the team: if it needs if and else, it belongs in Apex.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: frame it as readability and testing, not as a personal preference.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q59: Scenario: a field mapping must be different for two partner systems. How do you model it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Add a Partner__c picklist or a relationship to a Partner__mdt type on each mapping record. The integration code filters mappings by partner, so both systems share the same code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q60: Scenario: an admin edited a custom metadata record in production and broke a job. How do you prevent it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Limit who has Customize Application, deploy record changes through the pipeline, and add validation in code that checks required values and falls back safely. Field level descriptions on the type also help admins understand each value.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q61: Scenario: a value must change mid transaction. Which option works?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A custom setting, because it is data and can be written with DML.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Custom metadata cannot change within a transaction, since its updates are asynchronous deployments.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Common Mistakes Candidates Make<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Saying custom metadata records deploy and custom setting records do too, a frequent slip in Custom Metadata Interview Questions<\/li>\r\n\r\n<li>Not knowing that metadata reads cost no SOQL query<\/li>\r\n\r\n<li>Matching on the label rather than the developer name<\/li>\r\n\r\n<li>Reading metadata inside a loop with no caching<\/li>\r\n\r\n<li>Trying to insert metadata records with DML<\/li>\r\n\r\n<li>Making branching logic configurable until nobody can follow it<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">More Custom Metadata Interview Questions<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q62: Can custom metadata records be deployed with change sets?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes. Both the type and its records are metadata, so they move with <a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-sandboxes-change-sets\/\">change sets<\/a>, the CLI or packages.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q63: Can Apex deploy custom metadata records?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes, through the Apex Metadata API with Metadata.Operations.enqueueDeployment. The deployment runs asynchronously, so it is not a substitute for normal DML.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q64: Do custom metadata records use data storage?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. They do not count against data storage, though the org has its own size limit for custom metadata, which you can check in Setup.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q65: What is the QualifiedApiName field?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The unique API name of a record, which code should use for lookups because labels can change.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q66: How do you load many custom metadata records at once?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-cli-setup-vs-code\/\">Use the CLI<\/a>, which can generate records from a CSV file, or a tool built for custom metadata. Data Loader does not load them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q67: Who can edit custom metadata records?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Users with the Customize Application permission. Read access to individual types can also be granted through permission sets.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q68: What does getInstance return when no record matches?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It returns null, so code should check for null and fall back to a safe default.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Discount_Rule__mdt r = Discount_Rule__mdt.getInstance(tier); Decimal pct = (r == null) ? 0 : r.Percent__c; A missing record in a new sandbox then does not break the page.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q69: When should you use a custom label instead?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">For text shown to users that may need translation. Custom metadata is for structured configuration that code and automation read.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q70: Should endpoints and secrets live in custom metadata?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Endpoints with authentication belong in named credentials. Custom metadata is fine for non secret settings, but never for passwords or keys.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q71: Can a trigger run when custom metadata changes?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Custom metadata types do not support triggers, so any reaction to a change has to be handled another way.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q72: How do you keep configuration the same across environments?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep the records in source control and deploy them with the rest of the release, so every org gets the same values.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q73: How do you read custom metadata in a flow?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use a Get Records element on the custom metadata type, filter by DeveloperName or another field, and use the record&#8217;s fields in later elements. Flows can also use the $CustomMetadata global variable in formulas.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q74: Can custom metadata be used in Agentforce?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes. An Apex or flow action used by an agent can read custom metadata, for example to look up policy limits or routing rules. Keeping rules in metadata lets admins change agent behaviour without editing the action&#8217;s code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q75: Scenario: a value differs only in production. How do you handle it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep one record per environment specific value and set it as a post deploy step, or use a hierarchy custom setting if the value must differ by org without a deploy.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Best Practices to Mention in an Interview<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Keep rules, mappings and thresholds in custom metadata<\/li>\r\n\r\n<li>Keep per user and per profile toggles in hierarchy settings<\/li>\r\n\r\n<li>Match on developer names, never labels<\/li>\r\n\r\n<li>Cache reads in a static for the duration of the transaction<\/li>\r\n\r\n<li>Inject values in tests rather than relying on org records<\/li>\r\n\r\n<li>Keep each type small, single purpose and documented<\/li>\r\n\r\n<li>Add a switch per automation so support can disable one piece safely<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/\" target=\"_blank\" rel=\"noopener noreferrer\">Apex Developer Guide<\/a><\/li>\r\n\r\n<li><a href=\"https:\/\/trailhead.salesforce.com\/content\/learn\/modules\/custom_metadata_types_dec\" target=\"_blank\" rel=\"noopener noreferrer\">Custom Metadata Types on Trailhead<\/a><\/li>\r\n\r\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_meta.meta\/api_meta\/\" target=\"_blank\" rel=\"noopener noreferrer\">Metadata API Developer Guide<\/a><\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Custom Metadata Interview Questions test whether rules live outside the code<\/li>\r\n\r\n<li>Records deploy and can ship in a package, unlike custom setting records<\/li>\r\n\r\n<li>Reads through getInstance and getAll cost no SOQL query<\/li>\r\n\r\n<li>Match on developer names and cache reads in a static<\/li>\r\n\r\n<li>Hierarchy settings remain the answer for per user values<\/li>\r\n\r\n<li>Configuration suits tables and switches, not branching logic<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What Is Next<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Next, read <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/\">Apex Design Patterns Interview Questions (60+ Q&#038;A)<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.<\/p>\n","protected":false},"author":1,"featured_media":2597,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[250,8,90],"tags":[98,78,26,91],"swapz_series":[],"class_list":["post-2600","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-interview-questions","category-salesforce","category-salesforce-interview","tag-apex","tag-custom-metadata","tag-intermediate","tag-interview-questions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Custom Metadata Interview Questions Answered<\/title>\n<meta name=\"description\" content=\"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Metadata Interview Questions Answered\" \/>\n<meta property=\"og:description\" content=\"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-12T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-22T05:47:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"21 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Custom Metadata Interview Questions and Config Driven Apex\",\"datePublished\":\"2026-11-12T03:30:00+00:00\",\"dateModified\":\"2026-11-22T05:47:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/\"},\"wordCount\":4219,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/custom-metadata-interview-questions-featured.png\",\"keywords\":[\"Apex\",\"Custom Metadata\",\"Intermediate\",\"Interview Questions\"],\"articleSection\":[\"Developer Interview Questions\",\"Salesforce\",\"Salesforce Interview\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/\",\"name\":\"Custom Metadata Interview Questions Answered\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/custom-metadata-interview-questions-featured.png\",\"datePublished\":\"2026-11-12T03:30:00+00:00\",\"dateModified\":\"2026-11-22T05:47:50+00:00\",\"description\":\"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/custom-metadata-interview-questions-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/custom-metadata-interview-questions-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Custom Metadata Interview Questions featured image with sample question cards\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/custom-metadata-interview-questions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom Metadata Interview Questions and Config Driven Apex\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom Metadata Interview Questions Answered","description":"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Custom Metadata Interview Questions Answered","og_description":"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.","og_url":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-11-12T03:30:00+00:00","article_modified_time":"2026-11-22T05:47:50+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"21 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Custom Metadata Interview Questions and Config Driven Apex","datePublished":"2026-11-12T03:30:00+00:00","dateModified":"2026-11-22T05:47:50+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/"},"wordCount":4219,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png","keywords":["Apex","Custom Metadata","Intermediate","Interview Questions"],"articleSection":["Developer Interview Questions","Salesforce","Salesforce Interview"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/","url":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/","name":"Custom Metadata Interview Questions Answered","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png","datePublished":"2026-11-12T03:30:00+00:00","dateModified":"2026-11-22T05:47:50+00:00","description":"Custom Metadata Interview Questions with answers on custom metadata types, custom settings, deployment, limits and config driven Apex design patterns.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/custom-metadata-interview-questions-featured.png","width":2400,"height":1260,"caption":"Custom Metadata Interview Questions featured image with sample question cards"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/custom-metadata-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Custom Metadata Interview Questions and Config Driven Apex"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=2600"}],"version-history":[{"count":4,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2600\/revisions"}],"predecessor-version":[{"id":3519,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2600\/revisions\/3519"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/2597"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=2600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=2600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=2600"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=2600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}