{"id":2605,"date":"2026-11-12T13:00:00","date_gmt":"2026-11-12T07:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/"},"modified":"2026-11-22T11:19:41","modified_gmt":"2026-11-22T05:49:41","slug":"apex-design-patterns-interview-questions","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/","title":{"rendered":"Apex Design Patterns Interview Questions (60+ Q&#038;A)"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">Apex Design Patterns Interview Questions are how an interviewer finds out whether you have maintained a large org or only built features in a small one. The patterns are not academic. They are what stops a trigger file reaching nine hundred lines.<\/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 the questions that get asked, grouped into the classic patterns, the enterprise layers, trigger handlers, dependency injection, and scenario questions where a design has gone wrong.<\/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\/apex-design-patterns-interview-questions-diagram-1-1024x640.png\" alt=\"Apex Design Patterns Interview Questions diagram showing trigger, handler, service, selector and domain layers\" class=\"wp-image-2603\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-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: Each layer has one job, which is what makes any single class small enough to read.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What Apex Design Patterns Interview Questions Cover<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Apex Design Patterns Interview Questions test whether you can keep code changeable. A pattern is a shape that solves a recurring problem, and in Apex most of those problems come from growth.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Think of it like a kitchen. Keeping the trigger itself to one line is covered in the post on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-trigger-handler-pattern\/\">trigger handler patterns<\/a>. Prep, cooking and washing up each have a station. When one person does all three in the same square metre, the service falls apart at volume.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interviewers use Apex Design Patterns Interview Questions to check two things. Whether you can name the patterns, and whether you know when not to use one.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">The Patterns You Should Be Able to Name<\/h2>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Pattern<\/th><th>What it solves<\/th><\/tr><\/thead><tbody><tr><td>Singleton<\/td><td>One shared instance, so expensive setup happens once<\/td><\/tr><tr><td>Factory<\/td><td>Choosing which implementation to create at runtime<\/td><\/tr><tr><td>Strategy<\/td><td>Swapping one piece of behaviour without branching everywhere<\/td><\/tr><tr><td>Trigger handler<\/td><td>Keeping the trigger to one line and the logic testable<\/td><\/tr><tr><td>Service layer<\/td><td>Business rules callable from anywhere<\/td><\/tr><tr><td>Selector layer<\/td><td>All queries for one object in one place<\/td><\/tr><tr><td>Domain layer<\/td><td>Record level validation and defaulting<\/td><\/tr><tr><td>Unit of work<\/td><td>Grouping DML so related records save together<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That table is worth memorising for Apex Design Patterns Interview Questions, because many interviews ask you to name four patterns and explain one.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>public with sharing class CourseSelector {\r\n\r\n    public List&lt;Course__c&gt; byIds(Set&lt;Id&gt; ids) {\r\n        return [\r\n            SELECT Id, Name, Fee__c, Level__c, Is_Online__c\r\n            FROM Course__c\r\n            WHERE Id IN :ids\r\n            WITH USER_MODE\r\n        ];\r\n    }\r\n\r\n    public List&lt;Course__c&gt; publishedByLevel(String level) {\r\n        return [\r\n            SELECT Id, Name, Fee__c\r\n            FROM Course__c\r\n            WHERE Level__c = :level AND Is_Published__c = true\r\n            WITH USER_MODE\r\n        ];\r\n    }\r\n}<\/code><\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That class is the whole selector pattern, and it answers several Apex Design Patterns Interview Questions at once. Every query for the object lives there, so a field added to the select list is one change rather than fifteen.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Service Layer vs Logic in the Trigger<\/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\/apex-design-patterns-interview-questions-diagram-2-1024x640.png\" alt=\"Apex Design Patterns Interview Questions comparison of a service layer and trigger logic\" class=\"wp-image-2604\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-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: Reuse decides this, since a service can be called from Flow and an API as well.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Question<\/th><th>Service layer<\/th><th>Trigger logic<\/th><\/tr><\/thead><tbody><tr><td>Can Flow call it<\/td><td>Yes, through an invocable method<\/td><td>No<\/td><\/tr><tr><td>Can an API call it<\/td><td>Yes<\/td><td>No<\/td><\/tr><tr><td>Can you stub it in a test<\/td><td>Yes<\/td><td>Not really<\/td><\/tr><tr><td>Does it fire on every save<\/td><td>Only if the trigger calls it<\/td><td>Always<\/td><\/tr><tr><td>Where do the queries live<\/td><td>In a selector<\/td><td>Everywhere<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Apex Design Patterns Interview Questions often start from that table and ask what you would change first.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The posts on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns\/\">Apex design patterns<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-enterprise-patterns-service-selector\/\">enterprise patterns<\/a> cover each pattern with code.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Apex Design Patterns Interview Questions on the Classic Patterns<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q1: What is a singleton?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A class that keeps <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns\/\">one shared instance<\/a>, so expensive setup happens only once per transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Every caller gets the same object instead of building its own. In Apex that &#8220;once&#8221; means once per transaction, because static variables reset afterwards.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Is a static class the same as a singleton? No, a singleton is an object you can pass around and replace.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q2: How do you write one in Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A private constructor, a private static field for the instance, and a static method that creates it on first use.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: public class AppConfig { private static AppConfig instance; private AppConfig() { \/* load settings *\/ } public static AppConfig get() { if (instance == null) instance = new AppConfig(); return instance; } }<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: write the three lines from memory. It is often asked as a whiteboard task.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q3: Give a real Apex use for it.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Caching describe results or configuration records that several classes read.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: an AppConfig singleton loads all Feature_Switch__mdt records once, and every trigger handler reads them from it instead of calling getAll() again.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q4: What is the risk of a singleton?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Shared state, which can make behaviour depend on call order and hide bugs.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If one class changes a value inside the singleton, every other class sees the change. Keep singletons read only where you can.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q5: How long does a singleton live?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">For one transaction, because Apex static variables reset when it ends.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">So a singleton is not a cache between users or requests. For that, use Platform Cache.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: say &#8220;per transaction&#8221;. It shows you know how Apex statics behave.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q6: What is a factory?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A class that decides which implementation to create, based on an input.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The caller asks the factory for &#8220;a payment handler for UPI&#8221; and gets the right object, without knowing the class name.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Where should the mapping live? In custom metadata, so new types need no code change.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q7: Give a real use.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Choosing a payment handler per payment type, with one interface for all of them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: PaymentFactory.get(&#8216;UPI&#8217;) returns a UpiHandler, and PaymentFactory.get(&#8216;Card&#8217;) returns a CardHandler. Both implement PaymentHandler, so the caller just calls process().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give a domain example, like payments or notifications. It sounds like real work.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q8: What does a factory remove from your code?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Long if else or switch statements repeated in several places.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The branching lives in one method. Adding a new type means one new class and one line in the factory, or one custom metadata record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q9: What is the strategy pattern?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Putting each variant of a behaviour behind <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-interfaces-abstract-virtual-classes\/\">one interface<\/a>, so the caller can swap implementations.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a FeeCalculator interface with calculate(Course__c c), and one class per pricing rule.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q10: How is that different from a factory?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A factory creates the object. Strategy is about swapping the behaviour that object provides. They are often used together.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Point<\/th><th>Factory<\/th><th>Strategy<\/th><\/tr><\/thead><tbody><tr><td>Main job<\/td><td>Decide which class to create<\/td><td>Swap behaviour behind one interface<\/td><\/tr><tr><td>Answers<\/td><td>Which object do I need?<\/td><td>How should this be done?<\/td><\/tr><tr><td>Example<\/td><td>PaymentFactory.get(&#8216;UPI&#8217;)<\/td><td>UpiHandler.process() vs CardHandler.process()<\/td><\/tr><tr><td>Used together<\/td><td>The factory picks the strategy<\/td><td>The strategy does the work<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: say they are often used together. Interviewers like that link.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q11: Give a real use for strategy in Apex.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Different fee calculations per course level, each in its own class behind one interface.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: BeginnerFee, AdvancedFee and CorporateFee all implement FeeCalculator. Changing the corporate rule touches one small class, not a long method.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q12: What is the builder pattern used for?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Building a complex object step by step, which in Apex often means test data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: new CourseBuilder().withLevel(&#8216;Advanced&#8217;).withFee(15000).withTrainer(t).build(); reads clearly and fills sensible defaults for everything else.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Does a builder insert the record? Usually build() returns it unsaved, and the test decides.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q13: Where do you see builder most in Salesforce code?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In test data factories, where each method sets one part of the record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It keeps tests short and readable, because each test sets only the fields it cares about.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q14: What is the decorator pattern?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Wrapping an object to add behaviour without changing the original class.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In Salesforce it often shows up as display wrappers, like adding a formatted price or a selected flag to a record for a page.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q15: What is a wrapper class in Salesforce?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A small class holding a record plus extra fields, usually for a component or table.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: public class <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-wrapper-inner-classes\/\">CourseRow<\/a> { @AuraEnabled public Course__c course; @AuraEnabled public Boolean selected; @AuraEnabled public Integer seatsLeft; }<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q16: Why is a wrapper class so common?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because a component often needs a checkbox, a calculated value or data from two objects next to a record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The record itself cannot hold those extra values, so a wrapper carries them to the page in one object.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q17: What is the facade pattern in Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A simple class that hides a complex set of classes behind one easy method. Example: an OrderFacade.placeOrder() that calls pricing, stock, payment and notification services in the right order, so callers like an LWC or an API do not need to know the steps.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q18: What is the template method pattern?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A base class defines the steps of a process and leaves some steps for subclasses to fill in. Example: an abstract ImportJob with run() calling validate(), transform() and save(), where each import type overrides transform().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q19: What is the observer pattern in a Salesforce context?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/swapnilzambare.com\/blog\/salesforce-platform-events-apex\/\">Platform events<\/a>, where publishers and subscribers do not know about each other.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The publisher fires an event like Order_Shipped__e, and any number of triggers, flows or external systems react on their own.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Apex Design Patterns Interview Questions on Enterprise Layers<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q20: Name the four enterprise layers.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Service, selector, domain and unit of work.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Layer<\/th><th>Holds<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>Service<\/td><td>Business rules and orchestration<\/td><td>EnrollmentService.enroll()<\/td><\/tr><tr><td>Selector<\/td><td>All SOQL for one object<\/td><td>CourseSelector.byIds(ids)<\/td><\/tr><tr><td>Domain<\/td><td>Record level behaviour for one object<\/td><td>Courses.applyDefaults()<\/td><\/tr><tr><td>Unit of work<\/td><td>Collecting and committing DML in order<\/td><td>uow.registerNew(course); uow.commitWork();<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These come from the <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-enterprise-patterns-service-selector\/\">Apex Enterprise Patterns<\/a>, often used through the fflib library.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: name fflib and say you can use the layers without it.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q21: What belongs in a service class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Business rules and orchestration, without query or DML details.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: EnrollmentService.enroll(studentId, courseId) checks seats, calls the selector, applies the fee strategy and hands records to the unit of work.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q22: What belongs in a selector?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Every SOQL query for one object, returned as lists or maps.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: CourseSelector.selectByIds(Set&lt;Id&gt; ids) and selectOpenByLevel(String level). Callers never write their own query on Course__c.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Should selectors use user mode? Yes by default, with a system mode option where needed.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q23: Why keep queries in one class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A new field, a new filter or a security change becomes one edit.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It also makes adding WITH USER_MODE, or stubbing queries in tests, easy, because there is only one place to change.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention security: adding user mode to every query becomes one change.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q24: What belongs in a domain class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Record level behaviour for one object, such as validation and setting defaults.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a Courses domain class with applyDefaults() and validateFees(), called from the trigger handler for Course__c.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q25: What does unit of work do?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It collects records to save and commits them in the right order, in one place.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Instead of DML spread across many methods, each method registers new or changed records, and one commitWork() saves everything, often inside a savepoint.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Which library offers one? fflib_SObjectUnitOfWork.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q26: Why does order matter there?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Parents must exist before children, and a unit of work handles that order for you.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It also links children to parents that were just inserted, so you do not have to copy IDs by hand.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q27: Should a service class query?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. It asks a selector, which keeps the service testable.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In tests you can stub the selector to return in memory records, so the service logic runs without any data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q28: Should a service class perform DML?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It can, or it can hand records to a unit of work, depending on the design.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Small orgs often do DML in the service. Larger ones use a unit of work so several services can save together in one controlled step.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q29: Can a service call another service?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes. That is normal for orchestration, as long as the dependency goes one way.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If ServiceA calls ServiceB and ServiceB calls ServiceA, you have a loop that is hard to test and reason about. Move the shared part into a third class.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q30: What is the main cost of these layers?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">More classes, so a small org can feel over engineered.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">New developers also need to learn where each piece goes. That cost is why the layers should grow with the codebase.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: admitting the cost shows maturity. Over engineering is a real risk.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q31: When is that cost worth paying?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Once several triggers, flows and integrations touch the same objects.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">At that point, one place for queries and rules saves far more time than the extra classes cost.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q32: What is the difference between a domain class and a trigger handler?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The handler knows about trigger context and decides what to call for each event. The domain class holds the record level rules for one object, like defaults and validation, and can also be used outside triggers, for example by a batch or an API.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q33: How do selectors help with security?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because every query for an object lives in one class, you can add WITH USER_MODE, field sets or sharing rules in one place. It also makes security reviews easier, because reviewers check one file instead of searching the whole codebase.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q34: Is a framework required to use them?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. The layers are a convention, and a framework only adds helpers.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">You can follow the same layer ideas with plain classes. fflib adds base classes and helpers, but it is not required.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Apex Design Patterns Interview Questions on Trigger Handlers<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q35: How many triggers should an object have?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">One trigger per object, so the order of logic is predictable.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">With two triggers on the same event, Salesforce does not promise which runs first.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q36: What should that trigger contain?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">One line that <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-trigger-handler-pattern\/\">calls a handler class<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: trigger CourseTrigger on Course__c (before insert, before update, after insert, after update) { new CourseTriggerHandler().run(); }<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q37: Why move logic out of the trigger?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Triggers cannot be stubbed, called from other code or hold reusable methods.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A handler class can be unit tested, reused by batch jobs and switched off by a bypass, none of which works with logic inside the trigger.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention testing and reuse. They are the two strongest reasons.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q38: What does a handler class look like?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A class with one method per context, like beforeInsert() and afterUpdate(), and a run() method that routes to them.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Often each object&#8217;s handler extends a virtual base handler and overrides only the events it needs.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How does run() know the event? It switches on Trigger.operationType.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q39: How do you stop recursion?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Track <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-trigger-recursion-prevention\/\">processed record IDs<\/a> in a static Set, and run logic only when relevant fields actually changed.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A static Boolean flag also stops recursion, but it skips the second and later chunks of a large load.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q40: Why is a static flag risky?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It can block legitimate second runs, like the second chunk of 200 records, or a real update later in the same transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That is why a Set of IDs plus a changed fields check is the safer guard.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give the 200 record chunk example. It makes the risk concrete.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q41: How do you make a handler bulk safe?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Pass collections between methods, and <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-bulkification-best-practices\/\">never query or do DML inside a loop<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Each handler method takes the full list or map for the chunk, so the whole call path stays bulk safe.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q42: How do you let support disable one handler?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/swapnilzambare.com\/blog\/custom-metadata-in-apex\/\">A switch in custom metadata<\/a>, checked at the top of the handler.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: if (!Handler_Switch__mdt.getInstance(&#8216;Course&#8217;).Active__c) return; Support can then turn it off without a deployment.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q43: Should a handler contain business rules?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. It decides what to call, and the rules belong in a service or domain class.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keeping rules out of the handler means flows, batches and APIs can reuse them too.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q44: What is the benefit of a base handler class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Shared plumbing, like the recursion guard, the bypass check and the routing by context.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Each object handler then holds only its own logic, and every object behaves the same way.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Should the base class be abstract or virtual? Virtual, so handlers override only what they need.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q45: Is a trigger framework worth adopting?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In a growing org, yes, as long as the team understands it rather than copying it.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A known framework like Trigger Actions or fflib gives consistency. A small org may only need a simple base handler.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q46: What is the Trigger Actions Framework?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">An open source framework where each piece of trigger logic is its own action class, listed in custom metadata with an order and an on or off switch. Admins can reorder or disable actions, and flows can be added as actions too.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q47: How do you handle errors in a trigger handler?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Catch expected errors and use addError on the right records, so users see a clear message. Log unexpected errors through a logging service, and let them stop the save when data would otherwise be wrong.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q48: What is the first sign a handler needs splitting?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A method that does two unrelated things, or a file nobody wants to open.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Another sign is a test class that needs a lot of setup just to test one small rule.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Apex Design Patterns Interview Questions on Dependency Injection<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q49: What is dependency injection?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Passing a class the things it needs, instead of letting it create them itself.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: new EnrollmentService(new CourseSelector()) gives the service its selector, so a test can pass a fake one.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q50: Why does it matter in Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Because the <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-stub-api-mocking\/\">Stub API<\/a> can only replace an instance that was passed in.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If a class creates its own dependency with new inside a method, a test has no way to swap it for a stub.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: link dependency injection to the Stub API. That is the Apex specific reason.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q51: How do you do it with no framework?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Two constructors: an empty one for production that builds the real dependency, and one that accepts it for tests.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: public EnrollmentService() { this(new CourseSelector()); } public EnrollmentService(CourseSelector sel) { this.selector = sel; }<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q52: How many lines does that cost?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Usually a field and an extra constructor, around six lines.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">That small cost lets every test of the class run without inserting data.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q53: What does it let a test do?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Replace a dependency with a stub, so the test needs no records and no callouts.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Tests run in milliseconds, and you can make the stub return errors to test failure paths.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you create the stub? Test.createStub(ClassName.class, new MyStubProvider()).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q54: Can you inject a static class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Static methods cannot be replaced at run time, which is why services should be instance classes.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you inherit static code, wrap it in an instance class that calls the statics, and inject the wrapper.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q55: What is an interface used for here?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Declaring the shape of a dependency, so any implementation can be passed in.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a NotificationSender interface lets production pass an EmailSender and tests pass a FakeSender.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Can you stub an interface? Yes, Test.createStub works with interfaces.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q56: How does custom metadata help with injection?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A record can name the class to use, which Type.forName then creates.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a Payment_Provider__mdt record holds Handler_Class__c = &#8216;RazorpayHandler&#8217;, and the factory builds that class at run time.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q57: What is Type.forName used for?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Creating an instance from a class name held in configuration.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: PaymentHandler h = (PaymentHandler) Type.forName(config.Handler_Class__c).newInstance();<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q58: What is the risk of that approach?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A typo in a record becomes a run time failure, so check the name and handle null.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Type.forName returns null for an unknown class, so throw a clear exception or fall back to a default. A test that loops over every configured class catches typos early.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q59: What is the difference between composition and inheritance in Apex design?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Inheritance builds a class on top of a parent. Composition gives a class other objects to use, like a service holding a selector and a notifier. Composition is usually easier to test and change, because parts can be swapped through constructors.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q60: How does the Stub API replace a class?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Test.createStub(MyClass.class, provider) creates a fake instance, and every method call on it goes to the provider&#8217;s handleMethodCall, which returns whatever the test needs. The real class&#8217;s code never runs.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q61: Is a dependency injection framework needed?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Constructor injection covers almost every case in Apex.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Simple constructor injection with interfaces is easy to read and works well with the Stub API.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Scenario Based Apex Design Patterns Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q62: Scenario: one object has four triggers. What do you do?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Consolidate them into one trigger with a handler, because the order of four triggers is not predictable.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Move each trigger&#8217;s logic into its own handler method or action class, keep the tests green, then delete the old triggers in the same release.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q63: Scenario: the same query appears in nine classes. What pattern helps?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A selector, so the query exists once.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Create CourseSelector with a method for that query, replace the nine copies with calls to it, and add the fields any caller needs.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q64: Scenario: a fee rule must differ by course level. Which pattern?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Strategy, with one class per level behind a shared interface.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A small factory or custom metadata record picks the right class for each course, so adding a new level means one new class.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q65: Scenario: a service class has grown to 1,200 lines. What is your first move?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Split it by responsibility, and move the queries into a selector.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Look for groups of methods that work on different things, like pricing, enrolment and notifications, and give each its own service. Pin behaviour with tests before you start.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q66: Scenario: tests take 20 minutes because every one inserts data. What design change helps?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Dependency injection, so logic tests can use stubs instead of real records.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep a smaller set of tests that run real DML through triggers, and test the business logic in isolation.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give numbers if you can, like cutting a suite from 20 minutes to 5.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q67: Scenario: a describe call runs for every record. Which pattern fixes it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">A singleton or a static cache, so the describe runs once per transaction.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: a SchemaCache class keeps a static Map of describe results and fills it on first use.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q68: Scenario: parents and children must save together. Which pattern?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Unit of work, which handles the order and the grouping.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Register the parent and children, call commitWork() once, and it inserts parents first, links the children and wraps it all in a savepoint.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q69: Scenario: Flow and Apex both need the same rule. Where does it go?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">In a service, exposed to flows through an <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-invocable-methods-flow\/\">invocable method<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The @InvocableMethod is a thin wrapper that calls the service, so Apex and flows share exactly the same rule.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q70: Scenario: a small org has two triggers. Do you add all four layers?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">No. Start with a handler and a service, and add selectors and a unit of work when the pain appears.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Patterns should solve a real problem. In a small org, too many layers slow the team down without paying back.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q71: Scenario: an integration needs the same validation a trigger applies. What do you do?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Move the validation into a service or domain class that both call.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The trigger handler and the integration&#8217;s Apex REST class then use the same method, so the rule cannot drift apart.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q72: Scenario: a new developer cannot find where a rule lives. What does that tell you?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The layers are not being respected, so logic has leaked into triggers and handlers.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Agree a simple map of where things go, document it in the README, and use code review to keep new logic in services.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q73: Scenario: three teams keep changing the same service class. What do you suggest?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Split the service by responsibility so each team owns its own class, with clear interfaces between them. Agree code owners in the repository, so changes to shared parts get reviewed by the right people.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q74: Scenario: an Agentforce action needs the same pricing rule as your LWC. How do you design it?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Keep the rule in a pricing service. The LWC calls an @AuraEnabled method and the agent calls an @InvocableMethod, and both are thin wrappers over the same service, so the price is always the same.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q75: Scenario: an interviewer asks which pattern you would remove from a codebase. What is a good answer?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Any pattern with one implementation and no second use, since it adds indirection for nothing.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Good answer: remove an interface or factory that has only one implementation and no plan for another, because it adds indirection with no benefit. Patterns are tools, not goals.<\/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>Naming patterns without a Salesforce example, which Apex Design Patterns Interview Questions expose immediately<\/li>\r\n\r\n<li>Putting business rules in the trigger handler<\/li>\r\n\r\n<li>Adding four layers to an org with two triggers<\/li>\r\n\r\n<li>Writing services as static methods, which cannot be stubbed<\/li>\r\n\r\n<li>Using a singleton for mutable state that leaks between tests<\/li>\r\n\r\n<li>Describing a framework instead of the problem it solves<\/li>\r\n<\/ul>\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>One trigger per object, calling one handler<\/li>\r\n\r\n<li>Business rules in a service, queries in a selector<\/li>\r\n\r\n<li>Services as instances with constructor injection<\/li>\r\n\r\n<li>A static cache for anything expensive and stable<\/li>\r\n\r\n<li>Add a layer when the pain appears, not in advance<\/li>\r\n\r\n<li>Keep dependencies pointing one direction<\/li>\r\n\r\n<li>Prefer a pattern the whole team understands over a clever one<\/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\/apex_patterns_sl\" target=\"_blank\" rel=\"noopener noreferrer\">Apex Enterprise Patterns on Trailhead<\/a><\/li>\r\n\r\n<li><a href=\"https:\/\/github.com\/trailheadapps\/apex-recipes\" target=\"_blank\" rel=\"noopener noreferrer\">Apex Recipes<\/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>Apex Design Patterns Interview Questions reward examples over definitions<\/li>\r\n\r\n<li>One trigger, one handler, rules in a service, queries in a selector<\/li>\r\n\r\n<li>Singleton caches, factory creates, strategy swaps behaviour<\/li>\r\n\r\n<li>Unit of work handles save order for related records<\/li>\r\n\r\n<li>Constructor injection is what makes stubbing possible<\/li>\r\n\r\n<li>Add structure when growth demands it, not before<\/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-exception-interview-questions\/\">Apex Exception Interview Questions and Error Handling (60+ Q&#038;A)<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.<\/p>\n","protected":false},"author":1,"featured_media":2602,"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":[68,98,99,91],"swapz_series":[],"class_list":["post-2605","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-interview-questions","category-salesforce","category-salesforce-interview","tag-advanced","tag-apex","tag-architecture","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>Apex Design Patterns Interview Questions Guide<\/title>\n<meta name=\"description\" content=\"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.\" \/>\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\/apex-design-patterns-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apex Design Patterns Interview Questions Guide\" \/>\n<meta property=\"og:description\" content=\"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-12T07:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-22T05:49:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-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=\"22 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Apex Design Patterns Interview Questions (60+ Q&#038;A)\",\"datePublished\":\"2026-11-12T07:30:00+00:00\",\"dateModified\":\"2026-11-22T05:49:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/\"},\"wordCount\":4303,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-design-patterns-interview-questions-featured.png\",\"keywords\":[\"Advanced\",\"Apex\",\"Architecture\",\"Interview Questions\"],\"articleSection\":[\"Developer Interview Questions\",\"Salesforce\",\"Salesforce Interview\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/\",\"name\":\"Apex Design Patterns Interview Questions Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-design-patterns-interview-questions-featured.png\",\"datePublished\":\"2026-11-12T07:30:00+00:00\",\"dateModified\":\"2026-11-22T05:49:41+00:00\",\"description\":\"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-design-patterns-interview-questions-featured.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-design-patterns-interview-questions-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Apex Design Patterns Interview Questions featured image with sample question cards\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-design-patterns-interview-questions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apex Design Patterns Interview Questions (60+ Q&#038;A)\"}]},{\"@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":"Apex Design Patterns Interview Questions Guide","description":"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.","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\/apex-design-patterns-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Apex Design Patterns Interview Questions Guide","og_description":"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.","og_url":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-11-12T07:30:00+00:00","article_modified_time":"2026-11-22T05:49:41+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-featured.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"22 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Apex Design Patterns Interview Questions (60+ Q&#038;A)","datePublished":"2026-11-12T07:30:00+00:00","dateModified":"2026-11-22T05:49:41+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/"},"wordCount":4303,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-featured.png","keywords":["Advanced","Apex","Architecture","Interview Questions"],"articleSection":["Developer Interview Questions","Salesforce","Salesforce Interview"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/","url":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/","name":"Apex Design Patterns Interview Questions Guide","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-featured.png","datePublished":"2026-11-12T07:30:00+00:00","dateModified":"2026-11-22T05:49:41+00:00","description":"Apex Design Patterns Interview Questions with answers on singleton, factory, strategy, service and selector layers, trigger handlers and scenarios.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-featured.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-design-patterns-interview-questions-featured.png","width":2400,"height":1260,"caption":"Apex Design Patterns Interview Questions featured image with sample question cards"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/apex-design-patterns-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apex Design Patterns Interview Questions (60+ Q&#038;A)"}]},{"@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\/2605","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=2605"}],"version-history":[{"count":3,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2605\/revisions"}],"predecessor-version":[{"id":3520,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/2605\/revisions\/3520"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/2602"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=2605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=2605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=2605"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=2605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}