🏠 Home 🔒 Record Sharing ⚙ Apex Triggers 🔍 SOQL 💻 LWC 🔗 Integration 🤖 Flows & Automation 🤖 Agentforce & AI 🎈 Agentforce Course — Free ☁ Data Cloud 🎓 DC Course — Free 🚀 DevOps Course — Free 💵 CPQ 🎯 100 Scenario Questions 🏆 150 Advanced Questions 📧 Marketing Cloud 🏗️ Company Wise 👥 About Us Start Learning Free →

Top 125 Salesforce Architecture Interview Questions & Answers 2026 — Solution Architect & CTA Level

🏗️ Salesforce Architecture Series 2026

Top 125 Salesforce Architecture Interview Questions 2026

Architect-level questions covering Multi-Tenant internals, Data Architecture, Security Model, Integration Patterns, Automation Engine, DevOps, Scalability, and Enterprise Architecture. Built for Solution Architects, Technical Architects, and Senior Developers.

125Questions
8Sections
ArchitectLevel
100%Free
All Topics 150 Advanced Qs
🏗️

Multi-Tenant Architecture & Platform Internals

Q1–Q20 · What separates Architects from Developers

Q1
How does Salesforce implement multi-tenancy at the database level using the Universal Data Dictionary (UDD)?
⚡ Direct Answer
Salesforce stores ALL tenant data in shared Oracle database tables where every row has an OrgID column to identify the tenant. The Universal Data Dictionary (UDD) acts as the metadata layer that maps virtual Salesforce objects and fields to actual physical columns in MT (multi-tenant) tables like MT_DATA, MT_LONG, MT_CLOB etc. There is no separate schema or database per org.
🔬 Deep Dive
Traditional SaaS gives each customer their own database or schema. Salesforce takes a radically different approach — one physical table stores data for millions of orgs simultaneously. The UDD is the engine that makes this work. When you create a custom field in Salesforce, no DDL runs on the database — a row is inserted in the UDD metadata table instead. The physical column already exists (as a generic SLOT0, SLOT1... column). The UDD maps 'MyField__c' to 'SLOT14' for OrgID 123.
LayerTraditional AppSalesforce Multi-Tenant
DatabaseSeparate DB per clientShared Oracle DB, OrgID column
Schema changesALTER TABLE per clientUDD metadata row insert only
Field storageNamed columnsGeneric SLOT0...SLOTn columns
IsolationPhysical DB separationLogical OrgID-based isolation
ScalingN databases for N clientsOne database, N virtual schemas
🏗️ Architecture Points
Every query Salesforce runs adds WHERE OrgID = ? automatically | Custom fields = UDD metadata rows, not new DB columns | Schema changes never require DB downtime | The optimizer must work extra hard because queries hit shared tables with billions of rows | Governor limits exist to protect shared resources from one tenant starving others
🏢 XYZ Company Example
At XYZ Company, when the admin created a custom field 'Polymer_Grade__c' on Account, no ALTER TABLE ran on Oracle. The UDD inserted a row mapping Polymer_Grade__c → SLOT22 for XYZ's OrgID. When a sales rep queries that field, Salesforce's query optimizer rewrites the SOQL to fetch SLOT22 from MT_DATA WHERE OrgID = XYZ's ID. The rep sees 'Polymer_Grade__c'. Oracle sees 'SLOT22'.
📌 For Interviewer
Interviewers expect you to know UDD exists | Key insight: WHY governor limits exist — shared infrastructure protection | The virtual schema concept is what enables 3x/year releases with zero downtime | Mention Oracle as the underlying DB
🎤 "Salesforce multi-tenancy works via a Universal Data Dictionary that maps virtual org schemas to shared physical columns in common Oracle tables, with OrgID isolating every tenant's data."
Q2
How does Salesforce compile and execute Apex code in its multi-tenant runtime?
⚡ Direct Answer
Apex source code is compiled to an intermediate bytecode format (similar to Java bytecode) at save time, not at execution time. This bytecode is stored in the metadata layer. At runtime, the Apex runtime engine interprets this bytecode in a sandboxed JVM-like environment with governor limits enforced at the execution layer via instrumentation hooks.
🔬 Deep Dive
When you click Save on an Apex class in Developer Console, Salesforce immediately compiles it to bytecode and stores it. If there are syntax errors, you get them instantly. At runtime, the Apex runtime engine picks up the bytecode, starts a transaction context, initializes governor limit counters, and executes. Every DML operation, SOQL query, and heap allocation increments the appropriate counter. If any counter hits its limit, an exception is thrown.
🏗️ Architecture Points
Apex compiles at SAVE time — runtime errors are logic errors, not syntax | The sandboxed execution prevents file system and network access by default | Governor limits are enforced via bytecode instrumentation — not optional | The Apex runtime is separate from the Force.com web server — they communicate via internal APIs | Every Apex transaction gets its own isolated governor limit context
🏢 XYZ Company Example
At XYZ Company, an Apex trigger that queried inside a for loop was hitting the SOQL governor limit at runtime (not compile time). The bytecode was valid — the logic was wrong. Understanding that compile-time vs runtime are separate helped the team debug the issue correctly: the counter for SOQL queries exceeded 100 mid-loop.
📌 For Interviewer
Know the difference between compile-time (syntax/type errors) and runtime (governor limits) | Bytecode storage in metadata layer enables zero-downtime deployments | The JVM-like sandbox is why Apex can't do arbitrary file I/O
🎤 "Apex compiles to platform-specific bytecode at save time, executed by a sandboxed runtime engine that enforces governor limits via instrumentation on every operation."
Q3
How does Salesforce ensure one tenant's workload doesn't impact other tenants (noisy neighbor problem)?
⚡ Direct Answer
Salesforce uses multi-layer isolation: Governor Limits enforce per-transaction resource caps, the Apex Flex Queue limits concurrent async jobs per org, database connection pooling is shared but per-org query timeouts prevent monopolization, and the Force.com kernel implements CPU throttling per org. No single tenant can consume unbounded resources.
🔬 Deep Dive
The noisy neighbor problem is the fundamental challenge of multi-tenancy. If one org runs a query that takes 10 minutes, all other orgs on that database node suffer. Salesforce's architecture addresses this at every layer: Apex transactions time out, SOQL queries have row limits, bulk operations use chunked processing, and the scheduler controls concurrent async job execution. The entire governor limit system exists specifically to solve this.
ResourceProtection MechanismLimit
CPUPer-transaction CPU time limit10,000ms sync / 60,000ms async
SOQL queriesPer-transaction query count100 sync / 200 async
DML statementsPer-transaction DML count150 sync / 200 async
Async jobsFlex Queue concurrency5 concurrent batch jobs
API callsPer-org 24hr rolling windowBased on license count
🏗️ Architecture Points
Governor limits are NOT a developer convenience — they are architectural necessity for multi-tenancy | Crossing a limit throws an exception that halts the transaction — not a warning | The async framework (Batch/Queueable) has looser limits because it runs in a managed, isolated queue | Platform Cache exists to reduce DB load from repeated queries across multiple users
🏢 XYZ Company Example
At XYZ Company, a poorly written batch job was consuming excessive CPU processing 10,000 records per batch chunk. Salesforce threw a CPU time limit exception and the batch failed. The architect redesigned the batch with smaller chunk sizes (200 records) and pre-loaded data into Maps before the loop — staying within CPU limits while protecting other tenants on the same infrastructure.
📌 For Interviewer
Always frame governor limits as tenant isolation mechanisms, not arbitrary restrictions | Knowing WHICH limit is being hit tells you WHAT architectural pattern to apply | This question tests whether you understand multi-tenancy deeply or superficially
🎤 "Salesforce prevents noisy neighbor impact through a comprehensive governor limit architecture that enforces per-transaction resource caps across CPU, queries, DML, heap, and async concurrency."
Q4
How does the Salesforce order of execution work and what architectural issues can it create?
⚡ Direct Answer
When a record is saved, Salesforce executes: (1) System validation, (2) Before triggers, (3) System & custom validation rules, (4) Duplicate rules, (5) After triggers, (6) Assignment rules, (7) Auto-response rules, (8) Workflow rules (legacy), (9) Escalation rules, (10) Processes (legacy), (11) Flow record triggers, (12) Entitlement rules, (13) Roll-up summary recalculation, (14) Criteria-based sharing rules, (15) Commit to database. Then post-commit: email alerts.
🔬 Deep Dive
This fixed order creates critical architectural constraints. A before trigger fires BEFORE validation rules — meaning you can set field values that then get validated. An after trigger fires AFTER DB commit preparation — you can read the newly assigned record ID. The order also creates cascade problems: a Flow that updates a field triggers another round of triggers on THAT record. Understanding this order is the difference between an architect who can debug mysterious data corruption and one who cannot.
PhaseWhat RunsCan DML?
Before triggerCustom before logicNo (same record auto-saved)
Validation rulesSystem + custom validationsNo
After triggerCustom after logicYes (other objects)
FlowsRecord-triggered FlowsYes
CommitWrite to DBTransaction ends
🏗️ Architecture Points
Before triggers: read/modify fields before save — no record ID available yet | After triggers: record ID exists, can create related records, but field changes need another DML | Flows run AFTER triggers — a common source of unexpected re-triggering | Multiple automation tools on the same object means multiple executions in one save | Recursive trigger prevention must be implemented at the architect level, not just the developer level
🏢 XYZ Company Example
At XYZ Company, a before trigger set a discount field, then a validation rule checked that discount field — working correctly because triggers fire before validations. But when a Flow was added to also update the discount, it fired after the trigger in the same transaction, causing the validation to run twice and conflicting with the trigger's calculation. The architect consolidated the logic into the trigger to control execution order explicitly.
📌 For Interviewer
Knowing the exact order is an architect differentiator | The most common bug source is unexpected interaction between triggers AND flows on the same object | Frame this as: 'The order of execution defines the contract between automation tools'
🎤 "The Salesforce order of execution creates a fixed, deterministic automation pipeline — misunderstanding it causes data corruption bugs that are nearly impossible to debug without this architectural knowledge."
Q5
What is the difference between the Metadata API, Tooling API, and Connect API architecturally?
⚡ Direct Answer
Metadata API: deploys/retrieves org configuration and code (Apex, objects, flows, permissions) — used for deployments. Tooling API: provides granular access to individual metadata components for IDE tooling — used by VS Code, Developer Console for save/compile/debug. Connect API: exposes Salesforce data and UI actions as RESTful resources for Chatter, Community, mobile apps — used for application integration.
🔬 Deep Dive
These three APIs operate at fundamentally different layers of the Salesforce stack. Metadata API works at the configuration/schema layer — it packages and deploys entire components. Tooling API works at the development layer — it can compile a single Apex class, fetch debug logs, run anonymous Apex. Connect API works at the application/data layer — it surfaces pre-built UI patterns like feeds, files, user profiles as REST endpoints.
APILayerUse CaseFormat
Metadata APIConfigurationCI/CD deployments, migrationsSOAP/ZIP
Tooling APIDevelopmentIDE, compile, debug, testREST/SOAP
Connect APIApplicationMobile apps, portals, feedsREST/JSON
REST APIDataCRUD on standard/custom objectsREST/JSON
Bulk APIDataMass data operations 50K+ recordsREST/CSV
🏗️ Architecture Points
Metadata API is asynchronous — large deployments queue and run in the background | Tooling API is synchronous — ideal for real-time IDE interactions | Connect API abstracts complex multi-object operations into single endpoints | SFDX CLI uses Metadata API under the hood for deployments | Never use Metadata API for data operations — that's what REST/Bulk API is for
🏢 XYZ Company Example
At XYZ Company's CI/CD pipeline, the architect used Metadata API via Salesforce CLI for production deployments (configuration + code), Tooling API in the VS Code extension for developer save/compile during development, and Connect API for the customer self-service portal's Chatter feed integration. Three different APIs, three different layers, three different use cases.
📌 For Interviewer
A common interview trap: 'Can you use Tooling API for production deployments?' — technically yes but architecturally wrong | The distinction shows deep platform knowledge | Connect API is often confused with regular REST API — they serve different abstraction levels
🎤 "Metadata API deploys configuration, Tooling API enables development tooling, and Connect API exposes UI-layer Salesforce features as REST resources — three APIs operating at three distinct architectural layers."
Q6
How does Salesforce handle schema changes (new custom fields, objects) without database downtime?
⚡ Direct Answer
Schema changes in Salesforce never run DDL (ALTER TABLE, CREATE TABLE) against the Oracle database. Instead, new fields are registered in the Universal Data Dictionary (UDD) as metadata rows, mapped to pre-existing generic SLOT columns in physical tables. New objects get a new entity type ID in the UDD. The database schema itself never changes — only the metadata layer changes.
🔬 Deep Dive
This is one of Salesforce's most elegant architectural decisions. When you add a custom field to Account, behind the scenes: a new row is inserted into the FieldDefinition table (UDD) with OrgID, ObjectType, FieldName, DataType, and SlotIndex. The physical MT_DATA table already has SLOT0 through SLOTn columns. The query optimizer uses the SlotIndex to map field names to physical columns at query time. This enables instant schema changes for millions of orgs with zero database downtime.
🏗️ Architecture Points
Zero DDL = zero table locks = zero downtime for schema changes | The UDD has a finite number of SLOT columns — this is why there's a limit on custom fields per object (~500) | Different data types use different physical tables: strings in MT_DATA, large text in MT_CLOB, long text in MT_LONG | Deleting a custom field marks the slot as available in UDD but doesn't change the physical table
🏢 XYZ Company Example
At XYZ Company, during a live sales day, the admin added 3 new fields to the Opportunity object. No downtime, no database changes — just 3 UDD rows inserted. The sales reps immediately saw the new fields. If this were a traditional on-premise system, a DBA would need to run ALTER TABLE on a production database — risking locks and downtime. Salesforce's UDD architecture makes this a routine self-service operation.
📌 For Interviewer
This is a Salesforce Architect certification topic | Shows you understand WHY field limits exist (finite slots) | Connect it to why deleting fields has a 15-day recycle period (slot reservation) | The custom field limit per object is an architectural constraint, not an arbitrary rule
🎤 "Salesforce achieves zero-downtime schema changes by registering new fields as UDD metadata rows mapped to pre-existing generic database columns — no DDL ever runs against the physical Oracle schema."
Q7
What are the architectural differences between synchronous and asynchronous Apex execution contexts?
⚡ Direct Answer
Synchronous Apex runs in the same thread as the user transaction — it must complete before the page/API response returns. It has tighter governor limits (100 SOQL, 150 DML, 10s CPU). Asynchronous Apex (@future, Batch, Queueable, Scheduled) runs in a separate execution context on a background thread — it has relaxed limits (200 SOQL, 200 DML, 60s CPU) and can make HTTP callouts.
🔬 Deep Dive
The architectural distinction matters enormously for solution design. Any operation that needs an HTTP callout to an external system MUST be asynchronous in Salesforce — you cannot make callouts in a synchronous trigger context (after DML has opened a database transaction). Any operation processing more than ~2,000 records needs Batch Apex. Understanding which async mechanism fits which scenario is core architect knowledge.
MechanismBest ForMax RecordsCalloutsChaining
@futureSimple async, single calloutNo batch processingYesNo
QueueableComplex async, job chainingNo built-in batchingYesYes (chain)
Batch ApexMass data processing50M recordsYes (per batch)Via chaining
ScheduledTime-based executionVia Batch/QueueableVia inner jobNo
🏗️ Architecture Points
@future cannot be called from Batch Apex execute() — use Queueable instead | Queueable supports typed parameters (unlike @future which only accepts primitives) | Batch Apex has a maximum of 5 concurrent running jobs per org | Transaction Finalizers (Queueable) enable reliable async processing with success/failure handling | Scheduled Apex is the entry point — actual work should delegate to Batch or Queueable
🏢 XYZ Company Example
At XYZ Company, an integration requirement needed to call the ERP API every time an Opportunity was Closed Won. Using @future from the trigger worked in dev (1 record) but failed in production when a sales manager bulk-updated 50 opportunities — each fired a separate @future callout, hitting the per-transaction @future call limit of 50. The architect redesigned using Queueable with chaining: one Queueable job per Opportunity, chained sequentially.
📌 For Interviewer
The @future vs Queueable vs Batch decision is a standard architect interview question | Key differentiator: Queueable supports typed parameters and chaining — @future doesn't | Frame your answer with: 'The right async mechanism depends on volume, complexity, and whether chaining is needed'
🎤 "Synchronous Apex runs in the user transaction with tight limits; asynchronous Apex runs in separate managed threads with relaxed limits — the architectural choice between @future, Queueable, Batch, and Scheduled depends on volume, complexity, and callout requirements."
Q8
How does the Salesforce Lightning component framework architecture differ from Visualforce?
⚡ Direct Answer
Visualforce is a server-side rendering model — the server generates full HTML pages that are sent to the browser. Lightning Web Components (LWC) uses a client-side component model where the server sends JSON data and the browser renders UI, communicating via Apex wire adapters and imperative calls. LWC runs in a locker service sandbox for security isolation between components from different namespaces.
🔬 Deep Dive
This architectural shift from server-centric to client-centric has profound implications. Visualforce page loads require a round trip to the server for every interaction. LWC loads the component framework once, then only exchanges data. LWC also enables reactive programming via @wire decorator — data changes automatically re-render the component without page refresh. The Locker Service sandbox prevents one component from accessing another namespace's DOM.
AspectVisualforceLWC
RenderingServer-side HTMLClient-side DOM
Data bindingServer-rendered expressionsReactive @wire / properties
PerformanceFull page refreshIncremental DOM updates
SecurityPage-level isolationLocker Service per namespace
StandardSalesforce proprietaryW3C Web Components standard
🏗️ Architecture Points
LWC is built on W3C Web Components standard — skills transfer to non-Salesforce development | Locker Service prevents cross-namespace DOM access — important for AppExchange security | @wire is declarative data fetching — reactive, cached, auto-refreshed on record changes | LWC on mobile uses the same component model as desktop — no separate codebase needed | Visualforce is not deprecated but receives no new features — architects should prefer LWC
🏢 XYZ Company Example
At XYZ Company, migrating a Visualforce quote page to LWC reduced page load time from 4.2 seconds to 0.8 seconds. The Visualforce page re-rendered the entire page every time a field changed. The LWC version only updated the changed DOM node reactively. The architectural shift from server-rendering to client-rendering with reactive data binding was the root cause of the performance improvement.
📌 For Interviewer
Frame the difference as: server-rendering vs client-rendering — same concept as PHP vs React in the web world | Locker Service is a security architecture topic, not just a framework detail | The W3C standard alignment is the architect's argument for LWC adoption
🎤 "Visualforce is a server-side rendering model requiring full page requests; LWC is a standards-based client-side component framework with reactive data binding and Locker Service security isolation."
Q9
What is the Salesforce Well-Architected framework and how do you apply its principles?
⚡ Direct Answer
The Salesforce Well-Architected framework defines four pillars for platform excellence: (1) Trusted — security, privacy, compliance; (2) Easy — user adoption, simplicity, minimal technical debt; (3) Adaptable — scalability, extensibility, integration readiness; (4) Aligned — stakeholder alignment, ROI, business outcome focus. It is the architect's compass for making trade-off decisions.
🔬 Deep Dive
The Well-Architected framework shifts architecture from being purely technical to being outcome-focused. An architect who only optimizes for performance (Adaptable) but ignores user adoption (Easy) builds technically excellent but abandoned solutions. The framework forces architects to evaluate every decision across all four dimensions. For example: a complex Apex trigger is Adaptable (handles all scenarios) but may not be Easy (admin cannot maintain it).
🏗️ Architecture Points
Trusted: every architecture decision has a security implication — evaluate it explicitly | Easy: if an admin can't maintain it without a developer, the architecture has a complexity debt | Adaptable: architecture should handle 10x current volume without redesign | Aligned: every technical decision should map to a business outcome the stakeholder cares about | Anti-pattern: building technically impressive solutions that nobody uses
🏢 XYZ Company Example
At XYZ Company, the architect evaluated a proposed custom LWC dashboard vs a standard Salesforce Dashboard. LWC scored higher on Adaptable (more features, custom logic). Standard Dashboard scored higher on Easy (admin-maintained, no code), Trusted (no custom code surface area), and Aligned (faster delivery, lower cost). The architect recommended Standard Dashboard — the Well-Architected framework justified the trade-off explicitly.
📌 For Interviewer
Salesforce Architect certification centers heavily on this framework | Use it to structure interview answers — 'I'd evaluate this against the Well-Architected pillars' | Shows strategic thinking, not just technical knowledge
🎤 "The Salesforce Well-Architected framework's four pillars — Trusted, Easy, Adaptable, and Aligned — provide the architect's decision framework for evaluating trade-offs across security, usability, scalability, and business value."
Q10
How does Salesforce implement the three-tier architecture pattern across its platform stack?
⚡ Direct Answer
Salesforce implements a three-tier architecture: Presentation tier (Lightning Experience UI, Experience Cloud, LWC, Mobile), Logic tier (Apex classes, Flows, Process Builder, Rules engine, the Force.com kernel), and Data tier (multi-tenant Oracle database via UDD, external data via Salesforce Connect, data lake via Data Cloud). Each tier is accessible via distinct APIs and scales independently.
🏗️ Architecture Points
Presentation tier is stateless — user sessions managed via cookie-based authentication | Logic tier is where governor limits are enforced — it's the most critical architectural tier | Data tier is shared infrastructure — no org gets dedicated database resources | The key architectural constraint: you cannot bypass the Logic tier to access Data directly — no direct DB access for customers | External integrations must go through the Logic tier APIs, never direct DB connections
🏢 XYZ Company Example
At XYZ Company, a performance issue was traced to a data-heavy LWC that fetched 500 records in the presentation tier via a wire adapter. The architect moved the heavy processing to the Logic tier (Apex with pre-aggregation) and returned only 20 summary records to the presentation tier. The three-tier principle — compute in logic, display in presentation — resolved the governor limit issue and improved performance.
📌 For Interviewer
Three-tier is a fundamental architecture pattern — knowing how Salesforce implements it shows depth | The constraint 'no direct DB access' is the key insight | Use this to explain why all integrations go through APIs
🎤 "Salesforce's three-tier architecture separates Lightning presentation, Apex/Flow logic with governor limit enforcement, and shared multi-tenant Oracle data — with no path to bypass the logic tier for direct database access."
Q11
How does Platform Cache work architecturally and when should an architect recommend it?
⚡ Direct Answer
Platform Cache provides an in-memory caching layer separate from the database — Org Cache persists across transactions and users (up to 24 hours), Session Cache is scoped to a single user session. It stores serialized Apex objects or primitives. Architects recommend it when the same expensive SOQL queries or complex computations run repeatedly across multiple users or transactions.
🔬 Deep Dive
Without Platform Cache, every page load that needs configuration data (Custom Metadata, pricing tables, territory mappings) runs the same SOQL queries. With Platform Cache, the first transaction pays the query cost and stores the result. Subsequent transactions retrieve from memory in microseconds. The architectural trade-off: cache invalidation must be handled explicitly — stale data in cache can cause data integrity issues.
Cache TypeScopeTTLBest For
Org CacheAll users, all transactionsUp to 24 hrsShared config data, pricing tables
Session CacheSingle user sessionUp to 8 hrsUser preferences, wizard state
🏗️ Architecture Points
Platform Cache has a capacity limit per org — monitor usage to avoid evictions | Never cache sensitive PII in Platform Cache — it is not encrypted at rest | Always implement cache-aside pattern: check cache → if miss, query DB → store in cache | Cache invalidation strategy is the hardest part — stale cache data causes production bugs | Platform Cache is NOT a replacement for proper query optimization
🏢 XYZ Company Example
At XYZ Company, a product pricing LWC queried 2,000 pricing rules from a custom object on every page load — adding 1.5 seconds to load time. The architect implemented Org Cache for the pricing table (refreshed every 2 hours at night). Page load dropped to 0.2 seconds. Cache invalidation: a nightly Scheduled Apex job rebuilt the cache. A manual cache-clearing mechanism was added for emergency pricing updates.
📌 For Interviewer
Platform Cache is a senior/architect interview topic — junior devs rarely know it | Emphasize the invalidation strategy — that's where candidates show depth | Frame it as: 'The cost of Platform Cache is cache management complexity; the benefit is dramatic query reduction'
🎤 "Platform Cache provides an in-memory caching layer where Org Cache spans all users and Session Cache scopes to one user — the architectural trade-off is cache invalidation complexity vs significant SOQL query reduction."
Q12
What are the architectural implications of Salesforce's three-release-per-year upgrade model?
⚡ Direct Answer
Salesforce releases Spring, Summer, and Winter updates simultaneously to all orgs. Features progress through Preview sandboxes (4 weeks before production), then pre-release orgs (6 weeks before). Features activate automatically on production. Architects must maintain sandbox parity to detect breaking changes before they reach production, and must monitor the release notes and deprecated features timeline.
🏗️ Architecture Points
Release notes publish 6+ weeks before go-live — architect must review | Deprecated API versions affect integrations — client integrations using old API versions break silently after retirement | Sandbox refresh timing matters: if your sandbox isn't refreshed to the latest release, UAT misses release-specific issues | Critical Updates can be turned on by admins or activated by Salesforce automatically on a deadline | Architect responsibility: maintain a release management calendar and review 'Before the Release' items
🏢 XYZ Company Example
At XYZ Company, Salesforce's Summer release activated a Critical Update that changed how certain formula fields calculated null values. The integration team had not reviewed release notes. 3 days after the production release, downstream Excel reports started showing incorrect totals. A sandbox on the previous release version caught this issue in another org but XYZ's sandbox had been refreshed before the critical update. The architect implemented a mandatory release review 6 weeks before each Salesforce release.
📌 For Interviewer
Shows operational maturity beyond just technical skills | Critical Updates are the most dangerous — they can silently change behavior | API version retirement is a real enterprise risk — integrations using API v20.0 will eventually break
🎤 "Salesforce's three annual releases require architects to establish release management practices — sandbox parity, proactive release note review, and critical update impact assessment — to prevent production disruptions from automated platform upgrades."
Q13
How does the Salesforce governor limit system interact with the async execution framework?
⚡ Direct Answer
Each async execution context (Batch execute(), Queueable execute(), @future method) gets its own FRESH set of governor limits — the limits from the triggering transaction do not carry over. A Batch Apex job's execute() method gets 200 SOQL queries, 200 DML statements, and 60 seconds CPU per batch chunk — independent of what the start() method consumed.
🏗️ Architecture Points
@future calls inherit NO limits from the caller — they start fresh | Batch Apex start() method is synchronous with tighter limits; execute() and finish() are async with relaxed limits | A chain of Queueable jobs each get a fresh governor context — this is why chaining is used to work around limits | The maximum stack depth for Queueable chaining is not officially documented but practically ~5 chains deep before platform instability | Batch Apex's scope size directly determines how many records each execute() processes — affects limit consumption
🏢 XYZ Company Example
At XYZ Company, a Batch Apex job processing 1 million Opportunity records was failing intermittently. Analysis showed the execute() method was consuming all 200 SOQL queries for its first 50 records, then failing on the remaining 150. The batch scope was 200 records but each record needed 2 SOQL queries — 400 total, exceeding the 200 limit. Solution: reduce scope to 90 records (90 × 2 = 180 queries, safely under 200).
📌 For Interviewer
Interviewers test whether candidates know limits reset per async context | The scope size calculation is a practical architect question | Queueable chaining depth is a nuanced topic that shows deep platform knowledge
🎤 "Each Salesforce async execution context receives a completely fresh set of governor limits independent of the calling transaction — this architectural isolation is why async frameworks enable processing volumes impossible in synchronous contexts."
Q14
What is the Salesforce Event-Driven Architecture and how do Platform Events implement it?
⚡ Direct Answer
Platform Events implement a pub/sub messaging architecture on top of Salesforce's event bus. Publishers fire event messages (Apex, Flows, external APIs) without knowing who subscribes. Subscribers process events asynchronously (Apex triggers on events, Flows, external CometD subscribers) without blocking the publisher. Events are stored for up to 72 hours (standard) or 7 days (high-volume) for replay.
🔬 Deep Dive
Traditional Salesforce integration is request/response — System A calls System B and waits. Platform Events enable decoupled, async communication. This is architecturally transformative for integrations: an ERP system can subscribe to OrderCreated__e events without Salesforce knowing or caring about the ERP's availability. If the ERP is down, events accumulate in the bus and are replayed when it recovers. This is the foundation of resilient integration architecture.
AspectPlatform EventsChange Data CaptureStreaming API (PushTopic)
PublisherCustom (Apex/Flow/API)Salesforce automaticallySOQL query result changes
SchemaCustom event fieldsObject change fieldssObject fields
Replay72hr / 7 days72hr / 7 days24 hours
Use caseCustom business eventsData sync to external systemsReal-time UI updates
🏗️ Architecture Points
publishAfterCommit vs publishImmediately matters architecturally — publishImmediately fires even if the transaction rolls back | Platform Events do NOT participate in Salesforce transactions — a rolled-back DML does not roll back a published event | Event subscribers run in their own transaction with fresh limits | High-volume Platform Events (HVPEs) have no per-org volume limit vs standard Platform Events
🏢 XYZ Company Example
At XYZ Company, the ERP integration was initially built as synchronous REST callouts from Apex triggers. When the ERP was slow, triggers timed out and orders were lost. The architect redesigned using Platform Events: Apex trigger publishes OrderCreated__e → ERP subscriber processes asynchronously. When ERP is slow, events queue up. When it recovers, it replays from the event bus. Zero data loss. The integration became resilient to ERP downtime.
📌 For Interviewer
Platform Events vs CDC vs PushTopics is a classic architect question | publishImmediately behavior with rollbacks is a subtle but important distinction | The decoupling benefit is the architectural headline: publishers and subscribers are independent
🎤 "Platform Events implement pub/sub event-driven architecture on Salesforce's event bus — publishers and subscribers are fully decoupled, events persist for replay, and subscribers process asynchronously with independent governor limit contexts."
Q15
How does Salesforce implement the Composite API and when is it architecturally superior to individual API calls?
⚡ Direct Answer
The Composite API combines multiple sub-requests into a single HTTP round trip. Sub-requests can reference the results of previous sub-requests using reference IDs. Types: Composite (up to 25 mixed API requests, supports references), Composite Graph (multiple independent trees), SObject Collections (up to 200 same-type records in one call), Batch (up to 25 independent requests).
🔬 Deep Dive
Every API call has latency overhead — authentication, SSL handshake, routing, load balancing. For a mobile app that needs to create an Account, Contact, and Opportunity in sequence, three separate API calls mean 3x the latency. Composite API bundles all three into one HTTP request. The reference mechanism ($refId) is the killer feature — the Contact creation references the Account ID from the first sub-request without the client needing to parse intermediate responses.
Composite TypeMax RequestsCross-referencesBest For
Composite25 mixedYes ($refId)Sequential dependent operations
Composite Graph500 sub-requestsWithin graph onlyMultiple independent trees
SObject Collections200 same-type recordsNoBulk same-object CRUD
Batch25 independentNoParallel independent requests
🏗️ Architecture Points
Composite API reduces round trips — critical for mobile and high-latency integrations | If any sub-request fails and allOrNone=true, all sub-requests roll back | Reference IDs must be unique within a composite request | Cannot mix Composite and Bulk API — they solve different scale problems | Composite API counts against API call limits — 25 sub-requests = 25 API calls consumed
🏢 XYZ Company Example
At XYZ Company, a mobile field sales app was making 5 separate API calls to create a customer visit record (Account lookup, Contact create, Opportunity update, Visit_Report__c create, Task create). Network latency in field locations (2G/3G) made each call take 800ms — total 4 seconds. Composite API with $refId references reduced this to 1 round trip, total 900ms. 77% performance improvement from API architecture alone.
📌 For Interviewer
Composite Graph vs Composite is a nuanced distinction interviewers use to test depth | The $refId cross-reference mechanism is the key differentiator vs Batch | allOrNone behavior is important — it changes how partial success is handled
🎤 "Composite API reduces multiple sequential API calls into a single HTTP round trip with cross-reference support — architecturally essential for mobile integrations where network latency multiplies across each API call."
Q16
What are the architectural differences between Declarative and Programmatic automation in Salesforce and how do you choose?
⚡ Direct Answer
Declarative automation (Flows, Validation Rules, Formula Fields) runs on the platform engine with no compiled code — maintainable by admins, auto-upgraded by Salesforce releases, and zero code coverage requirement. Programmatic automation (Apex Triggers, Apex Classes) is compiled code with full language capabilities — handles complex logic, bulk operations, external callouts, but requires developer maintenance and test coverage.
🏗️ Architecture Points
Salesforce best practice: Declarative First, Programmatic Second | Flow has nearly closed the gap with Apex for most use cases — complex branching, loops, record operations, subflows, callout actions | Apex is required when: complex business logic exceeds Flow capability, performance requires set/map operations, callouts need custom error handling, or bulk processing needs fine-grained control | Mixed architecture: Flow for orchestration, Apex for complex computation invoked from Flow via Invocable Actions
🏢 XYZ Company Example
At XYZ Company, a requirement to auto-create 5 related records when an Opportunity closed was implemented as a Flow (declarative). When the requirement grew to include complex ERP API validation before record creation, the architect kept the Flow for orchestration and added an Invocable Apex class for the API call — declarative shell, programmatic core. Neither fully declarative (API call too complex) nor fully programmatic (admin couldn't maintain it).
📌 For Interviewer
'Declarative first' is the Salesforce mantra but architects know when to break it | The Invocable Apex pattern bridges declarative and programmatic — architects should know it deeply | Maintenance cost is a key factor: Apex requires developer for changes, Flow can be modified by certified admins
🎤 "The architectural choice between declarative and programmatic automation balances admin maintainability and platform upgrades (declarative) against complex logic capability and performance control (programmatic) — with Invocable Apex bridging both worlds."
Q17
How does Salesforce implement governor limit enforcement at the transaction boundary?
⚡ Direct Answer
Governor limits are enforced by the Apex runtime engine through a Transaction Context object that maintains counters for each limit category. Every SOQL query increments the query counter. Every DML row increments the DML rows counter. Every CPU instruction increments the CPU time counter. When any counter reaches its ceiling, the runtime throws a LimitException that cannot be caught — it terminates the transaction.
🏗️ Architecture Points
LimitException cannot be caught with a try-catch — it immediately terminates the transaction | Limits.getQueries() and Limits.getLimitQueries() let you check current usage programmatically | The System.Limits class is your architect's tool for monitoring limit consumption in code | Limits are per transaction, not per class or per method — all Apex in one transaction shares one limit pool | Exception to remember: @future and Queueable jobs that exceed limits fail silently unless Transaction Finalizers are used
🏢 XYZ Company Example
At XYZ Company, a trigger was hitting the CPU time limit intermittently — only on large bulk updates. The architect added Limits.getCpuTime() monitoring before and after each major code section to identify the hotspot. Discovered a nested loop processing 200 × 200 = 40,000 iterations. Refactored to use Maps for O(1) lookup instead of O(n²) loop. CPU time dropped from 9,800ms to 340ms.
📌 For Interviewer
LimitException uncatchability is a critical architectural fact — plan for limit avoidance, not limit handling | The Limits class is essential for profiling Apex | Frame: 'Architect designs to stay below limits, not recover from them'
🎤 "Salesforce enforces governor limits via a Transaction Context counter system where every operation increments tracked counters — when any counter hits its ceiling, a non-catchable LimitException immediately terminates the entire transaction."
Q18
What is the architectural pattern for implementing a Salesforce Center of Excellence (CoE)?
⚡ Direct Answer
A Salesforce CoE is a governing body that defines platform standards, architecture patterns, release management processes, and technical governance for an enterprise Salesforce implementation. Architecture layers: Governance (CoE board, architecture review board), Enablement (documentation, training, pattern library), Delivery (dev standards, CI/CD, testing), and Operations (monitoring, incident management, capacity planning).
🏗️ Architecture Points
CoE prevents org sprawl — multiple teams building on Salesforce without standards creates unmaintainable technical debt | Architecture Review Board (ARB): every new solution design reviewed against established patterns before build | Pattern Library: approved solutions for common problems (sharing model, integration patterns, naming conventions) | Release Calendar: all changes follow a defined deployment cadence — no ad-hoc production deployments | Capacity Management: monitor API usage, storage, governor limit trends before they become production incidents
🏢 XYZ Company Example
At XYZ Company (scaled context), as the Salesforce footprint grew from 1 team to 5 teams building concurrently, the CoE established: a naming convention standard (all custom objects prefixed with team code), a mandatory architecture review for any integration design, a bi-weekly release window (no ad-hoc deployments), and a shared Apex utility library to prevent duplicate implementations across teams. Technical debt reduced by 60% over 12 months.
📌 For Interviewer
CoE is a common topic in CTA (Certified Technical Architect) exam scenarios | The governance layer is what separates enterprise architects from project architects | Frame as: 'Technical governance prevents org entropy'
🎤 "A Salesforce Center of Excellence provides the governance structure, architecture standards, and delivery processes that prevent technical debt accumulation when multiple teams build on the same Salesforce platform simultaneously."
Q19
How does the Force.com Sites and Experience Cloud architecture differ from internal Salesforce?
⚡ Direct Answer
Force.com Sites and Experience Cloud expose Salesforce pages to unauthenticated or community users without requiring Salesforce licenses. Architecturally, Experience Cloud adds a presentation layer (LWC, Aura, or CMS templates) on top of the Salesforce platform with guest user context management, CDN for static resources, and separate sharing rules for guest/community users. The data model is the same — the security and presentation layers are different.
🏗️ Architecture Points
Guest user context is a critical security consideration — misconfigured OWD or sharing rules can expose org data publicly via Experience Cloud | Experience Cloud runs on Salesforce's CDN infrastructure — static resources cached globally for performance | The guest user profile controls what unauthenticated visitors can see/do — architect this with least-privilege | Partner Community users have different license capabilities than Customer Community users — license architecture matters | Content Management System (CMS) in Experience Cloud separates content from code — enables non-developer content updates
🏢 XYZ Company Example
At XYZ Company, a customer self-service portal was built on Experience Cloud. The architect discovered the OWD for Cases was Public Read — meaning any authenticated community user could see ALL cases in the org. Emergency fix: set Case OWD to Private, implement sharing rules for community users to see only their own cases. A security architecture review before launch would have caught this.
📌 For Interviewer
Guest user security misconfiguration is a real-world vulnerability — shows practical depth | Experience Cloud license types affect feature availability — architect must know the license model | CDN and performance architecture of Experience Cloud is often overlooked
🎤 "Experience Cloud adds a community/portal presentation layer on top of Salesforce's data platform — the key architectural considerations are guest user security model, sharing configuration for external users, and CDN-based static resource caching."
Q20
What is the architectural difference between the Salesforce mobile app (native) and a mobile-first LWC experience?
⚡ Direct Answer
Salesforce Mobile App (iOS/Android native) uses the Salesforce Mobile SDK, connects to Salesforce via REST/SOAP APIs, supports offline with SmartStore (encrypted SQLite), and renders Salesforce UI components natively. A mobile-first LWC experience is a browser-based responsive web app using LWC with Experience Cloud or internal Salesforce — no offline capability, but no app store deployment required.
AspectSalesforce Mobile AppMobile-First LWC
OfflineYes (SmartStore + SmartSync)No
DeploymentApp Store / MDMBrowser URL
Custom brandingLimited (white-label possible)Full CSS control
PerformanceNative renderingBrowser-based
UpdatesApp store release cycleInstant (LWC deploy)
🏗️ Architecture Points
SmartStore (offline storage) uses SQLite with AES-256 encryption — security architect must review offline data sensitivity | Mobile SDK handles OAuth token refresh automatically | The choice between native mobile and mobile LWC is often driven by offline requirements and IT MDM policies | Progressive Web App (PWA) is an emerging middle ground — browser-based with some offline capability via service workers
🏢 XYZ Company Example
At XYZ Company, field sales reps needed to create Visit Reports while at customer sites with no internet. This requirement drove the Salesforce Mobile App decision — only native mobile supports offline data entry via SmartStore. A mobile-first LWC approach was rejected because offline capability was non-negotiable for field operations.
📌 For Interviewer
Offline requirement = automatic Salesforce Mobile App recommendation | SmartStore encryption is the security architect's concern | The app store deployment vs instant update trade-off is a practical enterprise consideration
🎤 "The Salesforce native mobile app provides offline capability via SmartStore encrypted SQLite storage; mobile-first LWC delivers instant-update browser experiences — the architectural choice hinges on whether offline data access is a hard requirement."
🗄️

Data Architecture & Storage

Q21–Q35 · Where performance problems live and die

Q21
How does Salesforce handle Large Data Volumes (LDV) and what architectural patterns address it?
⚡ Direct Answer
LDV is typically defined as objects with 1M+ records. Salesforce handles LDV through: selective indexing (standard + custom indexes), skinny tables (denormalized copies of frequently queried fields), Divisions (horizontal data partitioning), archiving to Big Objects or external systems, and query optimization via selective filters that use indexed fields.
🔬 Deep Dive
LDV is one of the most common real-world Salesforce architecture problems. A query against 10 million Account records with a non-selective WHERE clause will time out — not because Salesforce is slow but because it's scanning all rows across all tenants in a shared table. The SOQL optimizer analyzes the filter selectivity before execution. If no indexed field is in the WHERE clause, it may refuse to run the query or run a full table scan.
PatternMechanismBest For
Custom IndexSalesforce Support requestFrequently filtered non-standard fields
Skinny TableSalesforce Support requestReports/queries on same field subset
DivisionsOrg setting + fieldGeographically/logically partitioned data
Big ObjectsCustom object typeHistorical archive with index-based access
External ObjectsSalesforce Connect / ODataData better left in external system
🏗️ Architecture Points
A query is selective if the filter returns <10% of total records for indexed fields, <33% for non-indexed | Skinny tables must be requested from Salesforce Support — not self-serve | Custom indexes cannot be created on long text fields, multi-select picklists, or encrypted fields | Owner ID and Record Type ID are automatically indexed | Divisions require careful planning — once enabled, they're difficult to remove
🏢 XYZ Company Example
At XYZ Company's parent company (10M+ Account records), reports were timing out. Salesforce Support analysis revealed: the WHERE clause filtered on an unindexed custom field (Territory__c). Salesforce created a custom index on Territory__c. Report execution dropped from timeout (>10 min) to 12 seconds. The architect also requested a skinny table for the 8 most-used report fields on Account, reducing report query time by 65%.
📌 For Interviewer
LDV is almost always an indexing problem | Skinny tables and custom indexes require Salesforce Support — show you know the process | The 10%/33% selectivity rules are what interviewers test
🎤 "Salesforce LDV architecture relies on custom indexes, skinny tables, and query selectivity analysis — SOQL against 1M+ records requires indexed filter fields to avoid full table scans that timeout and impact all tenants."
Q22
What is the architectural difference between Big Objects and Custom Objects in Salesforce?
⚡ Direct Answer
Big Objects store massive volumes (billions) of records with archival intent and limited functionality. They support only index-based SOQL queries (no SOQL WHERE on non-indexed fields), no Flows, no triggers, no reports, no list views. Custom Objects support full Salesforce functionality — Apex, Flows, reports, triggers, sharing — but have practical LDV limits (~100M records before serious performance issues.
🔬 Deep Dive
Big Objects solve the problem of retaining historical data in Salesforce without impacting performance on operational data. They were designed for immutable, append-only archival patterns — think audit logs, event histories, meter readings, and compliance records. The trade-off is severe functional limitation: you cannot filter, sort, or aggregate Big Object data without using the index. This forces architects to plan the index fields meticulously at design time.
FeatureCustom ObjectBig Object
VolumeUp to ~100M practicallyBillions
SOQLFull WHERE supportIndex fields only
TriggersYesNo
ReportsYesNo
Async SOQLNoYes
🏗️ Architecture Points
Big Object index fields are immutable — you cannot add/change index fields after creation without rebuilding | Async SOQL aggregates Big Object data into Custom Objects for reporting | Big Objects cannot be deleted from the UI — only via Async SOQL or the delete DML statement in Apex | The index definition order determines query capability — leading index fields must be in every query
🏢 XYZ Company Example
At XYZ Company, the requirement to retain 7 years of API call logs (for compliance) at ~500K logs/day = 1.28 billion records over 7 years. Custom Objects were ruled out (storage cost + LDV performance). Big Objects were chosen with index fields: OrgID (leading), CallDate, APIEndpoint. Daily aggregation via Async SOQL created summary Custom Object records for monthly compliance reports.
📌 For Interviewer
Big Objects vs Custom Objects is a senior architect interview topic | The immutable index design point is critical — wrong index fields = useless Big Object | Async SOQL is the reporting bridge — know it exists
🎤 "Big Objects store billions of records with index-only access and no triggers/reports — architected for immutable historical data retention; Custom Objects provide full platform functionality but have practical performance limits around 100M records."
Q23
How do External Objects and Salesforce Connect implement virtual data access architecturally?
⚡ Direct Answer
External Objects use the OData protocol to surface data from external systems as if it were native Salesforce data — without copying it. Salesforce Connect translates SOQL queries on External Objects into OData requests to the source system in real time. Records appear in Salesforce UI, can have Apex code reference them, and can be related to standard objects via External Lookup and Indirect Lookup relationships.
🏗️ Architecture Points
External Objects have no record storage in Salesforce — data lives in the source system | Every query on an External Object makes a real-time HTTP call to the source OData endpoint — latency implications | External Objects do NOT support: Apex triggers, workflows, process builder, reports (limited), sharing rules | External Lookup: child in Salesforce, parent in External Object | Indirect Lookup: relates to a unique custom field instead of Salesforce record ID | Cross-Org Adapter: use Salesforce Connect to expose one Salesforce org's data in another
🏢 XYZ Company Example
At XYZ Company, ERP product catalog data (50,000 SKUs) was in SAP. Options: (1) ETL sync to Salesforce Custom Object (data duplication, sync management overhead), (2) External Objects via OData adapter (real-time, no duplication). The architect chose External Objects for read-only catalog browsing from Opportunity line items. For performance-critical operations (price calculations during quote generation), the ERP data was cached in Custom Metadata.
📌 For Interviewer
External Objects vs data replication is a common architecture trade-off question | The real-time nature is the benefit AND the risk (OData endpoint latency/availability) | Cross-Org Adapter use case is often asked in multi-org architecture questions
🎤 "Salesforce Connect implements External Objects by translating SOQL queries into real-time OData requests to source systems — providing virtual data access without replication, at the cost of runtime dependency on the external system's availability."
Q24
What are the architectural implications of Salesforce's data storage limits and how do you design around them?
⚡ Direct Answer
Salesforce storage is divided into: Data Storage (records, all objects) and File Storage (attachments, files, ContentVersion). Enterprise Edition: 10GB data storage per org + 20MB per user. Exceeding storage blocks record creation. Architectural solutions: archive to Big Objects (operational data), use Salesforce Shield CTE to keep files smaller, use External File Storage (Amazon S3 via Files Connect), and implement data lifecycle management.
🔬 Deep Dive
Storage is one of the most overlooked architectural concerns. Organizations that start with 10GB of data storage can exhaust it faster than expected when storing rich content — PDFs, images, and attachments. Once storage is full, users cannot create new records — a business-stopping event. The architect must implement storage monitoring, archival strategies, and potentially external file storage before hitting limits.
🏗️ Architecture Points
Monitor storage quarterly — not annually | ContentDocument (Files) often consumes more storage than record data | Attachments (legacy) and Files (ContentVersion) both count against File Storage | Archiving to Big Objects reduces data storage consumption | External File Storage via Files Connect keeps files in S3/SharePoint — counts against file storage only minimally | Custom reports on ContentDocument size can identify the biggest storage consumers
🏢 XYZ Company Example
At XYZ Company, the Legal department uploaded thousands of contract PDFs as Salesforce Files. Within 18 months, file storage was at 89% capacity. The architect implemented Files Connect with Amazon S3 — new uploads went to S3, existing large files migrated via a Batch Apex job. Storage consumption dropped by 70%. The architect also implemented a quarterly storage audit process using the Storage Usage page and custom reports.
📌 For Interviewer
Storage architecture is often missed until there's a crisis | Files Connect external storage is the enterprise solution | Mention the distinction between data storage (records) and file storage (attachments/files)
🎤 "Salesforce storage architecture requires proactive monitoring and archival strategies — External File Storage via Files Connect, Big Object archival for records, and data lifecycle policies prevent the business-stopping event of reaching storage limits."
Q25
How does SOQL differ from SQL at the execution layer and what constraints does this create for architects?
⚡ Direct Answer
SOQL is a tenant-aware, permission-enforced query language that runs through Salesforce's multi-tenant query optimizer — not directly on Oracle SQL. SOQL automatically adds WHERE OrgID = ? and WHERE IsDeleted = 0 to every query. SOQL does not support: JOINs (uses relationship queries instead), wildcard SELECT * (must list fields), subqueries in WHERE (except semi-joins on related objects), or arbitrary aggregation.
🔬 Deep Dive
Understanding that SOQL is not SQL is fundamental to Salesforce architecture. SQL JOINs become SOQL relationship queries — parent-to-child (subquery) and child-to-parent (dot notation). These have significant performance implications at scale. A SOQL relationship query that fetches Accounts with all related Contacts runs two SQL queries internally. The 50,000 row limit and 20 aggregate query limits force architects to design data access patterns very differently from SQL databases.
SQL FeatureSOQL EquivalentLimitation
JOINRelationship queryMax 5 levels deep, 20K child records
SELECT *Not supportedMust list all fields explicitly
WHERE subquerySemi-join: WHERE Id IN (SELECT...)Must relate via relationship field
GROUP BY HAVINGSupportedMax 2,000 aggregate rows
UNIONNot supportedMultiple SOQL queries required
🏗️ Architecture Points
The 50,000 row limit per transaction (200M in Batch) is the most common architect constraint | SOQL FOR UPDATE acquires row locks — use cautiously in bulk operations | Relationship queries (parent-to-child) cannot exceed 20,000 child records in the subquery | Semi-joins and anti-joins (WHERE Id NOT IN (SELECT...)) can be more efficient than fetching IDs in Apex then using them in another query | SOQL injection is possible if dynamic SOQL is used with user-controlled input — architect must enforce String.escapeSingleQuotes()
🏢 XYZ Company Example
At XYZ Company, a report requirement needed Account data with related Contacts and Opportunities in one query. The developer used a nested relationship SOQL: SELECT Id, (SELECT Id FROM Contacts), (SELECT Id FROM Opportunities) FROM Account. When run against 5,000 Accounts with 100 Contacts each, it hit the 20,000 child record limit. Architect redesigned: separate SOQL queries for each object, joined in Apex Maps. More code, but architecturally sound.
📌 For Interviewer
SOQL vs SQL architectural differences are a foundational interview topic | The JOIN limitation forces a specific data access pattern that developers from SQL backgrounds often violate | SOQL injection via dynamic SOQL is a security architecture concern
🎤 "SOQL operates through Salesforce's multi-tenant optimizer — automatically tenant-scoped and permission-enforced — with no JOIN support, mandatory field enumeration, and strict row limits that force architects to design data access patterns fundamentally differently from SQL databases."
Q26
How do you architect Salesforce for GDPR and data privacy compliance?
⚡ Direct Answer
GDPR compliance in Salesforce requires: (1) Data Classification — label all personal data fields; (2) Data Residency — ensure EU data stays in EU via Salesforce hyperforce region selection; (3) Right to Erasure — implement data deletion/anonymization workflows; (4) Data Subject Access Requests (DSAR) — exportable personal data audit trail; (5) Consent Management — track consent per contact; (6) Salesforce Shield — field-level encryption for sensitive data.
🔬 Deep Dive
GDPR is not just a legal requirement — it's an architectural constraint that must be designed in from the start, not bolted on later. Retrofitting GDPR compliance to an existing org can require restructuring the data model, implementing new automation, and potentially exporting and anonymizing millions of records. The architect must make GDPR an explicit requirement in every design review.
🏗️ Architecture Points
Data Classification in Salesforce: mark fields as Public, Internal, Confidential, Restricted — drives retention policies | Right to erasure cannot be implemented with standard Salesforce delete (data is soft-deleted then purged after 15 days) — need anonymization for immediate compliance | Consent Management: standard Salesforce Individual object tracks consent by contact/lead | Shield Platform Encryption: encrypts data at rest — search, formulas, and reports on encrypted fields have limitations | Hyperforce region selection: EU customers can mandate EU data residency
🏢 XYZ Company Example
At XYZ Company's European subsidiary (Belgium), the architect designed GDPR compliance: all Contact and Lead personal fields marked Confidential in Data Classification, Individual object linked to each Contact for consent tracking, a DSAR Apex process that exports all records linked to an Individual, and a Right to Erasure Flow that anonymizes (not deletes) records — replacing name with 'GDPR_ERASED' and email with a hashed token. Salesforce Shield encryption applied to sensitive fields (passport numbers, financial data).
📌 For Interviewer
GDPR architecture shows strategic thinking — not just technical | Right to Erasure implementation nuance (anonymize vs delete) is what separates architects from developers | Hyperforce data residency is increasingly important for enterprise European clients
🎤 "GDPR-compliant Salesforce architecture requires data classification, consent management via the Individual object, anonymization workflows for right-to-erasure, Hyperforce data residency for EU compliance, and Shield encryption for sensitive personal data — all designed in from the start."
Q27
What are the architectural considerations for Salesforce Data Cloud (CDP) integration with core Salesforce?
⚡ Direct Answer
Salesforce Data Cloud (formerly CDP) is a separate platform from core Salesforce that ingests data from multiple sources, resolves unified customer profiles, and activates segments. It integrates with core Salesforce via Data Actions (write data back to Salesforce objects), Data Graphs (share data between Data Cloud and Salesforce Einstein), and the MuleSoft connector. Data Cloud has its own data model (Data Lake Objects, Data Model Objects) separate from Salesforce sObjects.
🏗️ Architecture Points
Data Cloud is NOT the same as Salesforce CRM — it's a separate platform with a separate data model | Data Lake Objects (DLOs): raw ingested data | Data Model Objects (DMOs): standardized model based on Salesforce's global schema | Identity Resolution: Data Cloud's AI engine that merges duplicate profiles across sources | Data Actions: near-real-time writes from Data Cloud back to Salesforce CRM objects | Einstein features in Sales Cloud/Service Cloud can use Data Cloud segments for AI predictions
🏢 XYZ Company Example
At XYZ Company, the marketing team needed to segment polymer industry customers by purchase history (in ERP), support tickets (in Salesforce Service Cloud), and website behavior (from web analytics). Data Cloud ingested all three sources, resolved unified customer profiles, created a segment of 'High-Value Customers with Recent Support Issues', and activated that segment back to Salesforce as a Campaign Member — triggering a proactive retention flow.
📌 For Interviewer
Data Cloud architecture is increasingly asked in 2026 architect interviews | The separate data model (DLO vs DMO vs sObject) is the key architectural distinction | Identity Resolution is the killer feature — understanding it shows depth
🎤 "Salesforce Data Cloud is a separate platform from core CRM that ingests multi-source data, resolves unified customer profiles via identity resolution, and activates segments back to Salesforce — requiring architects to design across two distinct data models and activation patterns."
Q28
How does the Salesforce sharing model recalculation work architecturally and what performance impact does it have?
⚡ Direct Answer
When OWD, sharing rules, or role hierarchy changes, Salesforce triggers a sharing recalculation process that rebuilds the sharing data in the AccountShare, OpportunityShare, and custom object Share tables. This process runs asynchronously as a Deferred Sharing Calculation job. For orgs with millions of records and complex sharing rules, recalculation can take hours to days, during which sharing data is temporarily inconsistent.
🏗️ Architecture Points
Share tables: Salesforce maintains implicit share tables (AccountShare, ContactShare, OpportunityShare) that record every user's access to every record — adding up to billions of rows in large orgs | OWD change triggers full sharing recalculation — should never be done in business hours for large orgs | Adding a new sharing rule for a single object can trigger partial recalculation for that object only | The deferSharing flag in Apex can temporarily skip sharing calc during bulk imports — re-enable after | Criteria-based sharing rules are more expensive than ownership-based rules
🏢 XYZ Company Example
At XYZ Company (enterprise context with 500K Opportunity records), the admin changed OWD from Public Read Only to Private for Opportunities. A full sharing recalculation was triggered — it ran for 14 hours, during which some reps couldn't access records they should have. The architect established a policy: OWD changes require a Saturday maintenance window, impact assessment, and stakeholder communication. Never change OWD on a business day in an LDV org.
📌 For Interviewer
Sharing recalculation timing is a real operational risk — show you understand the business impact | Share tables are the mechanism — knowing they exist shows platform depth | The deferred sharing pattern for bulk imports is an advanced performance technique
🎤 "OWD and sharing rule changes trigger asynchronous sharing recalculation that rebuilds billions of Share table rows — for LDV orgs this can take hours, creating temporary sharing inconsistency that architects must plan for with maintenance windows and stakeholder communication."
Q29
What is the architectural difference between Custom Metadata, Custom Settings, and Custom Labels?
⚡ Direct Answer
Custom Metadata: deployable configuration records queryable in SOQL, subscribable in Flows/Apex, cacheable, supports relationships — the architect's choice for configuration data. Custom Settings: org-specific or profile/user-specific key-value pairs loaded into application cache automatically — fast access, but harder to deploy. Custom Labels: static string values for multi-language support — not SOQL-queryable, UI and code references only.
FeatureCustom MetadataCustom SettingsCustom Labels
DeployableYes (via Change Set/SFDX)No (org-specific)Yes
SOQL queryableYesNo (getInstance())No
Multi-languageNoNoYes
CacheableYes (platform cache)Yes (automatic)Compiled in
Use in FlowYesYes (limited)Yes
🏗️ Architecture Points
Custom Metadata is the MODERN choice — everything Custom Settings does, Custom Metadata does better except for user/profile-specific settings | Custom Settings list type enables user/profile-level settings — no Custom Metadata equivalent | Custom Labels only for UI strings and internationalization — NOT for business logic configuration | Custom Metadata can have lookup relationships to other Custom Metadata types | Custom Settings are not deployable — each org must configure them separately post-deployment
🏢 XYZ Company Example
At XYZ Company, integration endpoint URLs were originally stored as Custom Settings (not deployable). Every environment (dev, UAT, prod) needed manual reconfiguration after deployment. The architect migrated to Custom Metadata — the sandbox used sandbox endpoint metadata, production used production endpoint metadata, both deployable and environment-aware. Deployment errors from misconfigured endpoints dropped to zero.
📌 For Interviewer
Custom Metadata vs Custom Settings is a classic interview trap | The deployability distinction is the killer argument for Custom Metadata | Custom Labels for i18n is the only clear unique use case
🎤 "Custom Metadata is the architect's configuration choice — deployable, SOQL-queryable, cacheable, and relationship-capable; Custom Settings provide automatic per-user/profile caching; Custom Labels handle multilingual string management — three tools for three distinct configuration patterns."
Q30
How does Salesforce implement selective SOQL queries and what makes a query non-selective?
⚡ Direct Answer
A SOQL query is selective when its filter conditions use indexed fields and return a sufficiently small percentage of the total records: <10% for standard indexed fields, <33% for custom indexed fields. Non-selective queries (returning >30% of all records) result in the optimizer choosing a full table scan — which in a multi-tenant shared table context is extremely expensive and often leads to timeouts.
🏗️ Architecture Points
Standard indexed fields: Id, Name, OwnerId, RecordTypeId, CreatedDate, SystemModstamp, custom ExternalId fields | Non-selective filters: IS NULL, IS NOT NULL on large datasets, non-leading LIKE ('%value'), OR conditions that combine non-indexed fields, formulas in WHERE | The query optimizer logs (available via SOQL query plan in Developer Console) show whether an index is used | Adding LIMIT does NOT make a query selective — it limits rows returned but the scan still runs | For reports and list views, filters on indexed fields are essential for LDV performance
🏢 XYZ Company Example
At XYZ Company, a SOQL query filtered: WHERE Status__c = 'Active' AND CreatedDate = LAST_N_DAYS:30. Status__c was not indexed — optimizer chose table scan. CreatedDate was indexed but returned 40% of records (too many). The query timed out in production with 2M records. Fix: Salesforce Support created a custom index on Status__c, making the combined filter selective (<8% of records). Query dropped from timeout to 0.4 seconds.
📌 For Interviewer
SOQL query plan tool in Developer Console shows index usage — mention this | The 10%/33% thresholds are testable interview facts | Non-selective SOQL in a trigger on a high-volume object is a critical architecture anti-pattern
🎤 "SOQL selectivity is determined by whether filter conditions use indexed fields and return <10-33% of total records — non-selective queries trigger full multi-tenant table scans that timeout and impact all tenants on shared infrastructure."
Q31
How does Salesforce implement data archiving architecturally?
⚡ Direct Answer
Four patterns: Big Objects (index-based queries only), External archiving via Bulk API export then hard delete, Salesforce Backup native add-on, Third-party tools (OwnBackup, Spanning).
🏗️ Architecture Points
Retention policy per object is the architect's first deliverable | Hard delete via Bulk API bypasses 15-day recycle bin — irreversible | Archive during off-peak Scheduled Batch | Big Object archival near-zero storage cost
🏢 XYZ Company Example
At XYZ Company, 2M Order records consumed 40% of storage. Batch identified Orders older than 3 years, Bulk API exported to Azure Blob encrypted, then hard deleted. Monthly run freed 6GB. Orders accessible via Azure for legal queries.
🎤 "Salesforce data archiving requires per-object retention policies, Batch-based identification, external export for compliance, and Bulk API hard delete to permanently free storage."
Q32
What are the architectural implications of formula fields at scale?
⚡ Direct Answer
Formula fields calculate at query time — not stored in the database. At scale this means: SOQL WHERE on formula fields forces full table scans (not indexed), cross-object formulas add parent fetch overhead, and TODAY()-based formulas recalculate on every access.
🏗️ Architecture Points
Never filter on formula fields in SOQL for LDV objects (>1M records) | Solution: Flow or Trigger stores formula value to a separate indexed Number field | Roll-up Summary fields cause parent record locking on high-volume child DML
🏢 XYZ Company Example
At XYZ Company, filtering on Days_Since_Last_Contact__c (TODAY() formula) timed out at 800K records. Fix: nightly Batch stored value as indexed Number field. Report time: 45 seconds to 3 seconds.
🎤 "Formula fields recalculate at query time and cannot be indexed — architects replace formula-field SOQL filters with stored indexed equivalents maintained by automation."
Q33
When should you use SOSL vs SOQL architecturally?
⚡ Direct Answer
SOSL uses Salesforce's full-text search index — searches multiple objects simultaneously with partial word matching. SOQL uses the database engine for exact matching on indexed fields. Use SOSL for user search bars, SOQL for programmatic filtering with known values.
🏗️ Architecture Points
SOSL for user-driven search — partial word matching | SOQL for programmatic filtering — exact values | SOSL cannot use WHERE clause | 20 SOSL limit per transaction vs 100 SOQL | Multi-object search is SOSL's unique capability
🏢 XYZ Company Example
At XYZ Company, global search needed Accounts, Contacts, and Cases from one search term. SOSL searched all three simultaneously using search index — 200ms vs 3.2 seconds for equivalent SOQL LIKE queries.
🎤 "SOSL leverages the full-text search index for user-driven multi-object searches; SOQL uses the database engine for programmatic filtering with known values."
Q34
What is the architectural role of External IDs in Salesforce?
⚡ Direct Answer
External IDs create a secondary unique index enabling upsert operations (update if exists, create if not), idempotent integration, and relationship creation in Bulk API by the source system's key instead of Salesforce IDs — eliminating the two-pass migration pattern.
🏗️ Architecture Points
Creates automatic index on the field | Upsert is inherently idempotent — same External ID, same record, no duplicates | Relationship by External ID in Bulk API: reference parent by external key in child CSV | Case-sensitive — mismatched casing creates duplicates
🏢 XYZ Company Example
At XYZ Company, migrating 500K Accounts with LegacyCRM_ID__c as External ID. Contact CSV referenced Account by LegacyCRM_ID__c — eliminated mapping to Salesforce IDs. Migration time reduced 40%.
🎤 "External IDs create indexed secondary unique keys enabling idempotent upsert and relationship creation by source system keys — eliminating the two-pass migration pattern."
Q35
How do you design a Salesforce data model for a many-to-many relationship?
⚡ Direct Answer
Salesforce implements many-to-many via Junction Objects — a custom object with two Master-Detail relationships, one to each side. The Junction Object carries relationship attributes (Role__c, Active__c). Multi-select picklist is only for simple tagging with no reporting or filtering needs.
🏗️ Architecture Points
Junction Object inherits sharing from BOTH parents — user must have access to both | Rollup Summary fields enabled from both sides | Multi-select picklist is an anti-pattern for anything requiring filtering, reporting, or relationship traversal
🏢 XYZ Company Example
At XYZ Company, Contact could be associated with multiple polymer customer Accounts. Junction object Contact_Account_Relationship__c with MD to both, plus Role__c (Primary, Technical, Procurement). Enabled contact count rollup on Account and relationship reporting.
🎤 "Salesforce many-to-many uses Junction Objects with two Master-Detail relationships — inheriting sharing from both parents and enabling relationship attributes that multi-select picklists cannot support."
🔒

Security Architecture

Q36–Q50 · The layer that fails silently when wrong

Q36
Explain Salesforce's complete security model from org level to field level and how each layer interacts.
⚡ Direct Answer
Salesforce implements a layered security model: (1) Org Security — login hours, IP restrictions, password policies, MFA; (2) Object Security — via Profiles/Permission Sets: CRUD access to objects; (3) Record Security — OWD baseline, Role Hierarchy, Sharing Rules, Manual Sharing, Apex Managed Sharing determine WHO sees WHICH records; (4) Field Security — Field-Level Security (FLS) hides fields from profiles; (5) Data Security — Shield Encryption for at-rest encryption.
🔬 Deep Dive
Each layer is additive — you cannot grant access at a lower layer if a higher layer restricts it. If a Profile says a user cannot Read Accounts (object level), they cannot see any Account record regardless of how sharing rules are configured. If FLS hides a field, Apex code running in user context cannot see that field value even if the user has record access. Understanding the hierarchy is critical because troubleshooting access issues requires systematically checking each layer.
LayerControlsCan Override?
OrgLogin access, MFA, IPNo
Object (Profile/PermSet)CRUD on objectsOnly grant more via PermSet
Record (OWD→Sharing)Which records visibleOnly open up, never restrict below OWD
Field (FLS)Field visibilityOnly grant more via PermSet
Data (Shield)At-rest encryptionEncrypt/decrypt via key management
🏗️ Architecture Points
Profiles set the MINIMUM — Permission Sets only ADD permissions, never restrict | OWD sets the MAXIMUM restriction — sharing rules can only OPEN access, never restrict | FLS in Apex: use WITH SECURITY_ENFORCED or Schema.describeSObjectResult() to enforce FLS in Apex code | @without sharing bypasses record security but NOT FLS | Shield encryption impacts: search, formulas, reports on encrypted fields have limitations
🏢 XYZ Company Example
At XYZ Company, a sales rep reported they could not see the Discount__c field on Opportunities they owned. OWD check: Private (irrelevant — they own the record). Profile check: Read access to Opportunity ✅. Record sharing: they own it ✅. Field-Level Security check: Discount__c set to hidden for their profile ❌. Fix: Permission Set granting FLS Read on Discount__c. The layered security model debugging sequence prevented a 2-hour investigation from becoming a 2-day one.
📌 For Interviewer
Systematic layer-by-layer troubleshooting is the architect skill this tests | The 'sharing rules only open, never restrict' principle is a common interview question | Profile vs Permission Set architecture (fewer profiles, more PermSets) is current Salesforce best practice
🎤 "Salesforce security is a five-layer model where each layer is additive — object access via profiles/permission sets, record access via OWD and sharing rules, field access via FLS, and at-rest protection via Shield encryption — no lower layer can override a higher layer's restriction."
Q37
How does Salesforce implement row-level security without explicit SQL WHERE clauses?
⚡ Direct Answer
Salesforce implements row-level security through Share tables (AccountShare, OpportunityShare, CustomObject__Share) that store every user-record access combination. When a user runs a query, Salesforce's query optimizer automatically JOINs the user's query with their Share table entries, filtering results to only records the user has access to. This JOIN happens transparently — the SOQL developer never writes it.
🔬 Deep Dive
This is a profound architectural distinction. In a traditional database, row-level security requires developers to write WHERE clauses checking user permissions, or database views that pre-filter data. In Salesforce, the Share table JOIN is the security mechanism — it's automatic, centralized, and impossible to bypass (except via @without sharing in Apex, which exists for specific use cases like automation running as the system).
🏗️ Architecture Points
Share tables are automatically updated when sharing rules change (recalculation), ownership changes, or manual sharing is granted | @without sharing in Apex bypasses the Share table JOIN — runs as system, sees ALL records | @with sharing enforces Share table filtering (default for most contexts) | @inherited sharing inherits the sharing context from the calling code — use for reusable utility classes | The Share table JOIN is the source of LDV performance issues on objects with complex sharing rules
🏢 XYZ Company Example
At XYZ Company, a requirement needed an Apex class to send renewal emails to ALL customers regardless of the running user's territory. The architect used @without sharing on the email service class — it could query all Accounts regardless of territory-based sharing. However, the developer-facing query helper class used @inherited sharing — when called from a user context it enforced sharing, when called from system context it didn't. Layered sharing architecture.
📌 For Interviewer
@without sharing vs @with sharing vs @inherited sharing is a critical interview question | The automatic Share table JOIN is the 'how' answer | Architects are expected to know when @without sharing is legitimately needed vs being an anti-pattern
🎤 "Salesforce implements row-level security via transparent Share table JOINs that the query optimizer automatically applies to every SOQL query — the developer never writes access control WHERE clauses because the platform enforces them invisibly through the sharing model."
Q38
How does Salesforce Shield Platform Encryption work and what are its architectural limitations?
⚡ Direct Answer
Shield Platform Encryption encrypts data at rest using AES-256 encryption. The Salesforce-managed or customer-managed encryption key encrypts field values before storage in the database. The key derivation architecture uses a tenant-specific data encryption key (DEK) encrypted by a key encryption key (KEK) stored in the Salesforce key management service. Fields are encrypted at the individual cell level in the physical database.
🔬 Deep Dive
Shield is the strongest data security option but comes with significant functional trade-offs. Because the field value is encrypted in the database, any database operation that requires reading the plaintext for computation — sorting, indexing, filtering, formula evaluation — is affected. An encrypted Email field cannot be used in a SOQL WHERE clause, a Salesforce report filter, or a duplicate detection rule that matches on email.
Impact AreaShield Behavior
SOQL WHERECannot filter on encrypted fields (except deterministic)
Sorting/ReportingCannot sort or filter in reports on encrypted fields
Formula fieldsCannot reference encrypted fields
Duplicate rulesCannot match on encrypted fields
Deterministic encryptionAllows exact-match SOQL (not range queries)
🏗️ Architecture Points
Two encryption modes: Probabilistic (stronger, no SOQL filter) and Deterministic (weaker, allows exact SOQL match) | BYOK (Bring Your Own Key): customer manages the KEK, Salesforce manages the DEK — compromise of the KEK doesn't expose data without both | Shield is additive — must be enabled per field per object | Search (SOSL) is supported for deterministic encryption only | Rotating encryption keys is a scheduled operation — not instantaneous
🏢 XYZ Company Example
At XYZ Company (healthcare client context), HIPAA compliance required encrypting Patient_ID__c and SSN__c fields. The architect chose Deterministic encryption for Patient_ID__c (needed for SOQL lookup queries — exact match) and Probabilistic for SSN__c (stored but never searched). After enabling Shield, the existing duplicate detection rule on Patient_ID__c was broken — it could not match on probabilistic encrypted fields. Redesigned using deterministic encryption + a custom Apex duplicate checker.
📌 For Interviewer
Probabilistic vs Deterministic encryption is the nuanced architect knowledge this tests | The functional limitation list is what differentiates Shield architects from security novices | BYOK key management is an enterprise compliance topic
🎤 "Shield Platform Encryption protects Salesforce data at rest with AES-256 cell-level encryption — the architectural trade-off is significant functional limitations on encrypted fields including no SOQL filters, no report sorting, and no formula field references unless deterministic encryption mode is used."
Q39
What is the difference between implicit and explicit sharing in Salesforce and when does each apply?
⚡ Direct Answer
Implicit sharing is automatic sharing Salesforce provides without any admin configuration: (1) Account-Contact implicit sharing: an Account owner automatically sees related Contacts and Opportunities; (2) Portal implicit sharing: a community user sees records shared to their account. Explicit sharing is configured or granted: OWD, Role Hierarchy, Sharing Rules, Manual Sharing, Apex Managed Sharing.
🏗️ Architecture Points
Implicit sharing is invisible in the UI — it doesn't appear in sharing rules or manual sharing lists | Account OWD Private doesn't prevent the Account owner from seeing related Contacts (implicit sharing) | Portal implicit: community user sees their own Account's Cases even without explicit Case sharing — this is portal implicit sharing | Implicit sharing cannot be disabled or overridden | Territory Management adds another implicit sharing layer on top of the standard model | Guest user implicit sharing: guest users in Experience Cloud have implicit access to public group shared records
🏢 XYZ Company Example
At XYZ Company, the security team couldn't understand why Account OWD was Private but some users could still see Contacts they didn't own. Analysis revealed implicit sharing: Account owners automatically see related Contacts and Opportunities regardless of Contact OWD. This is by design — Salesforce assumes a user who owns an Account should see its related records. The team documented this behavior in the security model design document to prevent future confusion.
📌 For Interviewer
Implicit sharing is the source of many 'unexpected' access bugs — architects must document it | The Account-Contact-Opportunity implicit sharing chain is the most important | This question tests platform depth vs surface-level security knowledge
🎤 "Implicit sharing is automatic platform-granted access — Account owners see related Contacts and Opportunities regardless of OWD — while explicit sharing is intentionally configured access via OWD, role hierarchy, sharing rules, and Apex managed sharing."
Q40
How does Salesforce implement OAuth 2.0 flows for different integration patterns?
⚡ Direct Answer
Salesforce supports multiple OAuth 2.0 flows for different integration contexts: Web Server Flow (user-facing apps with a web server), User-Agent Flow (client-side apps, deprecated for mobile), JWT Bearer Token Flow (server-to-server, no user interaction — used for integrations and CI/CD), Username-Password Flow (legacy, avoid — sends credentials), Device Flow (IoT devices), SAML Assertion Flow (legacy SSO bridge).
FlowUse CaseUser InteractionRecommended
Web Server (Auth Code)Server-side web appsYes — browser redirectYes
JWT BearerServer-to-server, CI/CDNoYes
Client CredentialsMachine-to-machineNoYes (newer)
Username-PasswordLegacy integrationsNoAvoid — sends creds
Device FlowIoT, CLI toolsOut-of-bandFor IoT only
🏗️ Architecture Points
JWT Bearer requires a pre-authorized Connected App with digital certificate — the integration user approves once, then tokens issue without user interaction | Named Credentials abstract OAuth from code — the architect should prefer them over hardcoded OAuth logic | Client Credentials flow (Spring 2023+) is replacing JWT Bearer for machine-to-machine — simpler setup | Refresh token rotation: best practice is to implement refresh token renewal rather than re-authentication on every call | Connected App OAuth policies: IP relaxation, refresh token validity, and permitted users all have security architecture implications
🏢 XYZ Company Example
At XYZ Company, the MuleSoft-to-Salesforce integration was initially using Username-Password OAuth flow — a security risk (credentials embedded in MuleSoft config, not rotatable without changing integration). The architect migrated to JWT Bearer Token flow: dedicated integration user, Connected App with certificate, JWT signed with private key. Credentials no longer exist in MuleSoft — only the certificate. Security team approved the architecture.
📌 For Interviewer
JWT Bearer vs Username-Password is a standard security architecture improvement recommendation | Named Credentials as the implementation pattern shows architectural maturity | The 'avoid Username-Password flow' recommendation shows security awareness
🎤 "Salesforce OAuth 2.0 architecture offers flow-specific patterns — JWT Bearer for server-to-server integrations without user interaction, Web Server flow for user-facing apps, and Client Credentials for modern machine-to-machine — with Named Credentials abstracting token management from application code."
Q41
How do Territory Management 2.0 and Role Hierarchy interact in Salesforce sharing architecture?
⚡ Direct Answer
Territory Management 2.0 adds a parallel sharing layer to the Role Hierarchy. A rep gets access to records via EITHER their Role Hierarchy path OR their Territory assignment — whichever grants more access wins (union, not intersection). Territories can be assigned to Accounts and their related Opportunities, creating account-based segmentation independent of the org chart.
🏗️ Architecture Points
Territory 2.0 operates as an additional sharing mechanism — it doesn't replace Role Hierarchy | An Account assigned to a Territory is shared to all users in that Territory AND all users above them in the Territory hierarchy | Territory rules can auto-assign Accounts based on criteria (revenue, industry, geography) | Territories affect Opportunity sharing: Enable Territory Forecasts to include territory-based Opp access in forecasting | Mixed model risk: users with both Territory and Role Hierarchy access may see more records than intended — audit regularly
🏢 XYZ Company Example
At XYZ Company, the sales restructuring moved from purely role-based (vertical team hierarchy) to territory-based (industry segments). Territory 2.0 was enabled: Chemical industry territory, Pharma territory, Automotive territory. Account auto-assignment rules based on Industry field. Reps inherited access to all Accounts in their territory regardless of who owned the Account. Old role hierarchy remained for non-territory objects (Cases, Contracts).
📌 For Interviewer
Territory 2.0 is an advanced sharing architecture topic — interviewers use it to separate architects from admins | The union (not intersection) behavior with Role Hierarchy is the key insight | Territory forecasting integration is an additional capability
🎤 "Territory Management 2.0 creates a parallel sharing layer alongside Role Hierarchy — a user's record access is the union of both models, enabling account-based territory segmentation independent of the organizational reporting structure."
Q42
What are the security implications of @without sharing in Apex and when is it architecturally justified?
⚡ Direct Answer
@without sharing executes Apex code in system context — bypassing the Share table JOIN, allowing access to ALL records regardless of the running user's record-level permissions. It does NOT bypass object-level or field-level security. Architecturally justified uses: background processes that need to operate across all records (reporting, data maintenance), trigger logic that must access related records the user doesn't own, and service classes called from both user and system contexts.
🏗️ Architecture Points
@without sharing is a privilege escalation — treat it as such in code reviews | If misused in a visualforce page or API endpoint, a user with no record access can be elevated to see all records | @inherited sharing is the safer default for utility classes — they behave appropriately in both user and system contexts | FLS is NEVER bypassed by @without sharing — field-level restrictions still apply | Audit: regularly search your codebase for @without sharing usage and verify each is justified
🏢 XYZ Company Example
At XYZ Company, a nightly report aggregation class used @without sharing to read all Opportunity records across all territories for an executive dashboard. The class was then called from a Visualforce page accessible to regular reps — unintentionally exposing all company pipeline to individual reps. Fix: the @without sharing class was restricted to internal-only callouts (not exposed to UI), and the Visualforce page used a separate @with sharing class for rep-facing data.
📌 For Interviewer
The architectural risk of @without sharing in UI-accessible code is the key insight | @inherited sharing as a safer alternative shows depth | Code review for @without sharing is an actual security governance practice
🎤 "@without sharing is architecturally justified for system-level automation but dangerous in user-facing code — it bypasses record-level security while still enforcing field-level security, and must be restricted to controlled execution contexts reviewed explicitly in security architecture."
Q43
How does Salesforce implement CORS and Content Security Policy (CSP) for Lightning components?
⚡ Direct Answer
CORS (Cross-Origin Resource Sharing): Salesforce requires external domains that make API calls to Salesforce to be whitelisted in Setup > CORS. Without CORS whitelisting, browser-based JavaScript from domain A cannot call Salesforce API on domain B. CSP (Content Security Policy): Lightning Experience enforces a strict CSP that prevents inline JavaScript, restricts which external domains LWC can load resources from — requires Trusted URLs allowlisting for external scripts/fonts.
🏗️ Architecture Points
CORS whitelist: required for any external web app making REST/Connect API calls to Salesforce from the browser | CSP Trusted Sites: required for LWC components loading external JavaScript, CSS, fonts, or frames | Lightning Locker Service also implements namespace isolation within Salesforce — one LWC component cannot access another namespace's DOM | CSP violations appear as browser console errors — often missed during development if testing without CSP enforcement | Static resources (uploaded JS libraries) bypass external CSP restrictions — prefer this for third-party JS in LWC
🏢 XYZ Company Example
At XYZ Company, a LWC embedded in the Opportunity page loaded Chart.js from a CDN (https://cdn.jsdelivr.net). In production, the chart rendered blank. Browser console showed CSP violation: 'Refused to load script from cdn.jsdelivr.net'. Fix: uploaded Chart.js as a Salesforce Static Resource (no external URL needed) AND added cdn.jsdelivr.net to Trusted URLs for non-strict environments. The architect implemented a policy: all third-party JS libraries must be uploaded as Static Resources.
📌 For Interviewer
CSP/CORS violations are production bugs that occur even when dev testing works | Trusted URLs vs CORS are different: CORS = API calls FROM external domains, CSP = resources loaded by LWC | Static Resources as the preferred pattern for third-party libraries is an architect best practice
🎤 "Salesforce enforces CORS for external domain API access and CSP for Lightning component resource loading — both require explicit allowlisting in Setup, with Lightning Locker Service adding an additional layer of namespace-based DOM isolation."
Q44
How do Connected App policies control OAuth security and what are the architect's configuration responsibilities?
⚡ Direct Answer
Connected App policies define: who can authorize the app (All users, Admin-approved users only, specific Profiles/Permission Sets), OAuth scopes (principle of least privilege — only grant needed data access), session policies (timeout, MFA requirements), IP relaxation (whether to enforce login IP restrictions), and refresh token policies (validity period, rotation behavior).
🏗️ Architecture Points
Admin-approved users only: only users with the Connected App listed in their Profile/PermSet can authenticate — prevents unauthorized OAuth access | OAuth scopes: never grant 'Full' scope to integration Connected Apps — use 'api', 'refresh_token', specific object scopes | IP relaxation: 'Relax IP restrictions' is a security risk — avoid it; use token-based authentication instead | Refresh token expiry: short-lived refresh tokens force re-authentication — balance security with usability | Mobile SDK Connected Apps: separate from web integration apps — configure mobile-specific policies
🏢 XYZ Company Example
At XYZ Company, an audit revealed a Connected App created for a vendor integration had scope 'Full access (full)' and 'Relax IP restrictions' enabled. The vendor had full org access with no IP restriction. The architect revoked the existing tokens, reconfigured the Connected App with minimum required scopes (api, refresh_token), enabled IP restriction enforcement, and limited authorized users to the integration service account profile only.
📌 For Interviewer
Connected App audit is a real security architecture activity | Least-privilege OAuth scopes is the key principle | Admin-approved users only is the enterprise standard for integration apps
🎤 "Connected App policies are the OAuth security architecture control point — architects must enforce least-privilege scopes, restrict authorized users, enforce IP restrictions, and configure appropriate refresh token policies to minimize the blast radius of a compromised OAuth token."
Q45
What is the architectural approach to implementing Single Sign-On (SSO) with Salesforce as Service Provider vs Identity Provider?
⚡ Direct Answer
Salesforce as Service Provider (SP): users authenticate to an external IdP (Okta, Azure AD, ADFS) which sends a SAML assertion to Salesforce — Salesforce trusts the assertion and logs the user in. No password in Salesforce. Salesforce as Identity Provider (IdP): Salesforce serves as the IdP for other applications — users log in to Salesforce, then access connected apps (third-party) without re-authenticating. SP mode is more common in enterprise; IdP mode is used when Salesforce is the primary authentication hub.
AspectSF as Service ProviderSF as Identity Provider
Auth sourceExternal IdP (Okta, Azure)Salesforce itself
Common inEnterprise with existing IdPSalesforce-centric orgs
Password in SFNo (SSO users)Yes
MFA enforcementAt IdP levelSalesforce MFA policies
🏗️ Architecture Points
Just-in-Time (JIT) Provisioning: SAML assertion can auto-create Salesforce users on first login — eliminates manual user provisioning | MyDomain is required for SSO — enables SP-initiated SSO and custom login branding | SAML attribute mapping: IdP attributes (email, department) map to Salesforce user fields | SP-initiated vs IdP-initiated SSO: SP-initiated (user goes to Salesforce first, redirected to IdP) vs IdP-initiated (user goes to IdP portal, clicks Salesforce app) | Certificate expiry: SAML signing certificates expire — architect must establish renewal monitoring
🏢 XYZ Company Example
At XYZ Company, enterprise SSO was implemented with Azure AD as IdP (SP mode for Salesforce). JIT provisioning automatically created Salesforce user records from Azure AD attributes on first login — no manual user creation. MFA was enforced at Azure AD level. When the SAML certificate expired 2 years later, all SSO logins failed — users couldn't access Salesforce. The architect implemented certificate expiry monitoring (90-day advance alert) to prevent recurrence.
📌 For Interviewer
SP mode vs IdP mode is frequently asked | JIT provisioning is the advanced detail that separates architects from admins | Certificate expiry is a real operational risk — showing awareness of it demonstrates maturity
🎤 "Salesforce SSO as Service Provider delegates authentication to an external IdP via SAML, with JIT provisioning auto-creating users — as Identity Provider, Salesforce authenticates users and issues assertions to connected apps, with MyDomain required in both configurations."
Q46
How do you architect Salesforce security for a partner community?
⚡ Direct Answer
Partner Community security: Partner users have Community licenses with Partner Community profile. External OWD (separate from internal) controls baseline access. Sharing Sets share records based on Account relationship. Partner Super User has elevated access within their account.
🏗️ Architecture Points
External OWD is SEPARATE from internal OWD — architect this explicitly | Sharing Sets are the community-specific sharing mechanism | Data leakage risk: too-open external OWD lets partners see each other's records | Quarterly audit of external OWD and Sharing Set configurations
🏢 XYZ Company Example
At XYZ Company, polymer distributors needed to see only their own orders. Architecture: external OWD for Order = Private, Sharing Set sharing Orders where Order.Account = Partner's Account. Partners see only their own orders — zero cross-visibility.
🎤 "Partner Community security uses external OWD settings and Sharing Sets based on Account relationships — configured separately from internal sharing rules to ensure each partner sees only their own data."
Q47
What is data masking architecture for Salesforce non-production environments?
⚡ Direct Answer
Data masking prevents PII exposure in sandboxes. Approaches: Salesforce Data Mask (native, post-refresh automation), Custom Batch Apex anonymization, or synthetic data generation for scratch orgs.
🏗️ Architecture Points
Must happen BEFORE developers access the sandbox | Email→random@fake.com, Phone→000-000-0000, Name→Test User [ID] | GDPR, HIPAA, PCI-DSS all require PII masking in non-production | Salesforce Data Mask configures masking rules applied automatically on sandbox refresh
🏢 XYZ Company Example
At XYZ Company, developers had real customer emails in sandbox — GDPR violation found in audit. Salesforce Data Mask configured: Email, Phone, Contact Name masked on refresh. Compliance team verified quarterly.
🎤 "Data masking automates PII anonymization immediately after sandbox refresh — preventing GDPR violations from real customer data exposure in developer and test environments."
Q48
How does Apex managed sharing differ from manual sharing architecturally?
⚡ Direct Answer
Manual sharing: record owner shares via UI — RowCause=Manual, removed when ownership changes. Apex managed sharing: programmatic Share record insertion with custom RowCause — persists through ownership changes. Used when complex business rules require access the standard sharing model cannot express.
🏗️ Architecture Points
Requires a custom RowCause (Sharing Reason) created in Setup first | Persists through ownership transfers — manual sharing does not | @without sharing bypasses sharing entirely — different from explicit sharing | insert AccountShare records with custom RowCause in Apex
🏢 XYZ Company Example
At XYZ Company, Accounts needed to be visible to all users in the same Industry vertical regardless of territory. Apex trigger inserts AccountShare with custom RowCause after Account insert/update. Applied immediately, no recalculation delay.
🎤 "Apex managed sharing inserts custom-RowCause Share records programmatically — persisting through ownership changes for complex business-rule-driven access the standard model cannot express."
Q49
How does FLS enforcement work in Apex and why is it not automatic?
⚡ Direct Answer
Apex runs in system context ignoring FLS by default. Enforce via: WITH SECURITY_ENFORCED in SOQL (throws QueryException), Security.stripInaccessible() (strips fields gracefully), or WITH USER_MODE (complete user context — Summer 2022+).
🏗️ Architecture Points
@without sharing bypasses record security but NOT FLS | WITH USER_MODE is the modern complete solution | FLS enforcement mandatory for AppExchange security review | Security.stripInaccessible() preferred for API endpoints — graceful degradation vs exception
🏢 XYZ Company Example
At XYZ Company, REST endpoint exposed Confidential_Terms__c without FLS enforcement. Security audit: High severity finding. Fix: Security.stripInaccessible() — gracefully excluded inaccessible fields from API response.
🎤 "Apex ignores FLS by default — enforce via WITH SECURITY_ENFORCED, Security.stripInaccessible(), or WITH USER_MODE in all data-exposing Apex code."
Q50
How does Shield Platform Encryption affect Salesforce functional architecture?
⚡ Direct Answer
Shield encrypts field values at rest using AES-256. Two modes: Probabilistic (stronger, no SOQL filter possible) and Deterministic (allows exact-match SOQL). Encrypted fields cannot be used in: SOQL WHERE (probabilistic), formula fields, rollup summaries, duplicate rules, or standard report filters.
🏗️ Architecture Points
Probabilistic: no SOQL filter, no formula, no rollup — maximum security | Deterministic: allows exact SOQL match — enables duplicate detection | BYOK (Bring Your Own Key): customer manages key encryption key | Key rotation is a scheduled operation — not instantaneous | Shield encryption does NOT protect EAC (Einstein Activity Capture) data
🏢 XYZ Company Example
At XYZ Company (healthcare context), HIPAA required encrypting Patient_ID__c and SSN__c. Patient_ID__c used Deterministic (needed for SOQL lookups). SSN__c used Probabilistic (stored, never searched). Existing duplicate rule on Patient_ID__c broke with Probabilistic — redesigned using Deterministic + Apex duplicate checker.
🎤 "Shield Platform Encryption protects Salesforce data at rest — the architectural trade-off is significant functional limitations on encrypted fields unless deterministic mode is used, requiring redesign of formulas, rollups, and duplicate detection that reference those fields."
🔗

Integration Architecture

Q51–Q70 · The glue that enterprise architectures live and die by

Q51
What are the architectural differences between REST API, SOAP API, Bulk API 2.0, and Streaming API?
⚡ Direct Answer
REST API: synchronous, JSON/XML, 2,000 records max per call, best for transactional CRUD operations. SOAP API: synchronous, XML only, enterprise WSDL for type-safe clients, legacy but widely used. Bulk API 2.0: asynchronous, CSV, 100M records per job, best for mass data operations. Streaming API (PushTopic/Generic Events): server-push via CometD, for real-time UI notifications. Each solves a different integration scale problem.
APIMax Records/CallPatternBest For
REST API2,000 (Collections)SynchronousTransactional CRUD
SOAP API200 per callSynchronousLegacy enterprise integrations
Bulk API 2.0100M per jobAsynchronousMass data load/extract
Streaming APIN/A (event stream)Push (CometD)Real-time UI updates
Platform EventsEvent busPub/Sub asyncDecoupled integration
🏗️ Architecture Points
Bulk API 2.0 improvements over 1.0: no XML, simpler batch management, automatic chunking | REST API Composite resource reduces round trips for related operations | SOAP API enterprise vs partner WSDL: enterprise is org-specific (strongly typed), partner is generic (weakly typed, one WSDL for all orgs) | Streaming API vs Platform Events: PushTopics are SOQL-based (deprecated direction), Platform Events are the modern architectural choice | API consumption counts: every sub-request in Composite API counts as one API call
🏢 XYZ Company Example
At XYZ Company, the integration architect defined API selection criteria: <100 records, real-time → REST API; >10,000 records, batch → Bulk API 2.0; event notification to external system → Platform Events; real-time UI update in LWC → Streaming API or Platform Event subscriber. This decision matrix prevented developers from using REST API for 500K record loads (which would hit governor limits) and Bulk API for 5-record transactional updates (unnecessary complexity).
📌 For Interviewer
The API selection matrix approach is what architects use vs developers picking whatever they know | Bulk API 2.0 vs 1.0 improvements show currency | Platform Events as the modern Streaming alternative shows forward-looking architecture
🎤 "Salesforce's API portfolio addresses different integration scales — REST for transactional CRUD, Bulk API 2.0 for mass data with automatic chunking, Platform Events for decoupled pub/sub, and Streaming API for server-push UI updates — architectural API selection is driven by volume, pattern, and latency requirements."
Q52
How do Platform Events guarantee delivery and what are the architectural failure scenarios?
⚡ Direct Answer
Platform Events do NOT guarantee exactly-once delivery — they guarantee at-least-once delivery (event may be delivered multiple times) with a 72-hour retention window for replay. Failure scenarios: (1) subscriber trigger failure — the event is retried but failures after 72 hours are lost; (2) publishImmediately events fire even on transaction rollback — creating phantom events; (3) high subscriber load — event bus can throttle delivery; (4) ReplayId-based replay requires the subscriber to track its own position.
🏗️ Architecture Points
publishAfterCommit (default): events fire only after the publishing transaction commits — consistent with DML outcomes | publishImmediately: fires regardless of transaction outcome — creates events for rolled-back operations | Idempotent subscribers are essential because at-least-once delivery means handling duplicates | ReplayId: every event has a ReplayId — subscribers can request replay from a specific ID after downtime | High-volume Platform Events (HVPEs): no per-org volume limit (vs standard Platform Events) | Dead letter queue: Salesforce does not provide a native DLQ — architects must implement their own via a Failed_Event__c custom object
🏢 XYZ Company Example
At XYZ Company, the ERP integration consumed Platform Events. During an ERP maintenance window, events accumulated. When the ERP came back online, it replayed events from its last ReplayId. However, some events had been delivered twice — once in the original delivery and once in replay. The ERP was not idempotent — it created duplicate orders. The architect added an ExternalID__c field to events and implemented duplicate detection in the ERP consumer using the event ExternalID.
📌 For Interviewer
at-least-once vs exactly-once delivery is the key architectural constraint | publishImmediately phantom events on rollback is a subtle but critical failure scenario | Idempotency design is the architect's responsibility, not the platform's
🎤 "Platform Events guarantee at-least-once delivery with 72-hour replay — not exactly-once — requiring architects to design idempotent subscribers, implement dead letter mechanisms for persistent failures, and handle the publishImmediately rollback scenario where events fire for transactions that never committed."
Q53
How does the Salesforce Bulk API 2.0 process large data sets differently from Bulk API 1.0?
⚡ Direct Answer
Bulk API 2.0 simplifies the 1.0 flow: create a job (specify object, operation, CSV format), upload CSV data, close the job, poll for results. Salesforce automatically chunks the data into optimal batch sizes (no manual batch management). Results are retrieved as successful and failed record files. Bulk API 2.0 does not support XML — CSV only, which is simpler and more performant for large volumes.
FeatureBulk API 1.0Bulk API 2.0
FormatCSV or XMLCSV only
BatchingManual (up to 10K records/batch)Automatic
Job typesV1 batchesIngest and Query jobs
PK ChunkingSupportedAutomatic
ComplexityHigher (batch management)Lower
🏗️ Architecture Points
Bulk API 2.0 Query jobs: extract records as CSV — useful for large data exports | PK Chunking is automatic in Bulk API 2.0 — splits large object queries into primary-key-based chunks | Hard delete operation: Bulk API can permanently delete records (bypasses recycle bin) — requires permission | Failed records file: Bulk API 2.0 provides a separate CSV of failed records with error messages — process these separately | Bulk API uses a separate server infrastructure — doesn't count toward synchronous API governor limits
🏢 XYZ Company Example
At XYZ Company, annual data archival migrated 2M Opportunity records from Salesforce to an external data warehouse. Bulk API 2.0 Query job extracted records as CSV (3 hours for 2M records). Bulk API 2.0 hard delete removed the archived records from Salesforce (4 hours). Bulk API 1.0 had been attempted first — manual batch management with 10K-record batches caused 200+ batch jobs to manage. Bulk API 2.0 reduced operational complexity to 2 job calls.
📌 For Interviewer
Bulk API 2.0 automatic chunking vs 1.0 manual batch management is the headline difference | Hard delete capability and permission requirement is a governance point | The failed records file handling pattern is a practical integration architecture detail
🎤 "Bulk API 2.0 simplifies large data operations with automatic chunking, CSV-only format, separate successful/failed result files, and unified job management — eliminating the manual batch management complexity of Bulk API 1.0 for mass data operations up to 100M records."
Q54
How do you architect an idempotent integration between Salesforce and an external system?
⚡ Direct Answer
Idempotency in Salesforce integration means processing the same event or message multiple times produces the same result — no duplicate records, no duplicate actions. Architectural patterns: (1) External ID fields as idempotency keys (upsert instead of insert), (2) Idempotency key field on Salesforce records storing the source system's unique transaction ID, (3) Status tracking records that transition states atomically, (4) Duplicate Rules as a safety net.
🏗️ Architecture Points
External ID field: define a field as External ID — the upsert operation automatically deduplicates | Idempotency key in Platform Events: include a UUID from the source in every event, subscriber checks if this UUID has been processed before | Salesforce Duplicate Rules: last-resort protection — they don't replace idempotent design | REST API upsert endpoint: PATCH /sobjects/Account/ExternalId__c/{value} is inherently idempotent | Saga pattern for distributed transactions: each step is idempotent, with compensating transactions for failure
🏢 XYZ Company Example
At XYZ Company, IndiaMART leads were pushed to Salesforce via a webhook. During a network retry, some lead events were delivered 3 times. Without idempotency, 3 Lead records were created per inquiry. Fix: (1) Lead ExternalID__c = IndiaMART's inquiry_id, (2) upsert instead of insert in the receiving Apex, (3) Duplicate Rule on Lead matching ExternalID__c as a safety net. After fix, 10 retries of the same inquiry still created exactly 1 Lead.
📌 For Interviewer
Idempotency design is a fundamental integration architecture skill | External ID + upsert is the Salesforce-native pattern | The UUID idempotency key pattern applies across all Salesforce integration types
🎤 "Idempotent Salesforce integration uses External ID fields with upsert operations as the primary mechanism — ensuring repeated delivery of the same integration event produces exactly one result regardless of how many times the message is processed."
Q55
What is the architectural pattern for implementing real-time bidirectional sync between Salesforce and SAP?
⚡ Direct Answer
Bidirectional sync architecture: (1) Salesforce → SAP: Platform Events or outbound REST callouts from Apex triggers/Flows notify SAP of Salesforce changes; (2) SAP → Salesforce: SAP publishes events consumed by a middleware (MuleSoft, Boomi) that calls Salesforce REST/Bulk API; (3) Conflict resolution: a last-write-wins or master-system-of-record strategy prevents update loops; (4) Loop prevention: a 'source system' field or bypass flag prevents SAP-originated updates from triggering Salesforce → SAP events.
DirectionMechanismLoop Prevention
SF → SAPPlatform Event or Apex calloutCheck source_system__c != SAP
SAP → SFMiddleware → REST API upsertSet source_system__c = SAP in payload
ConflictSystem of record decisionTimestamp comparison or SoR wins
🏗️ Architecture Points
Loop prevention is the #1 failure mode in bidirectional sync | System of Record (SoR) designation: which system owns which field — Salesforce owns sales fields, SAP owns financial fields | Change Data Capture from Salesforce can replace Platform Events for SAP notification — lower implementation cost | MuleSoft as middleware provides transformation, error handling, and retry logic — preferred over point-to-point | Field-level sync: don't sync ALL fields bidirectionally — only sync fields that SAP and Salesforce both need to see
🏢 XYZ Company Example
At XYZ Company, SAP was the SoR for product pricing; Salesforce was SoR for customer contacts and opportunities. Bidirectional sync: Opportunity Closed Won in Salesforce → Platform Event → MuleSoft → SAP creates Sales Order. SAP shipping confirmation → MuleSoft → Salesforce REST API → update Opportunity with Delivery_Date__c. Source_system__c = 'SAP' flag prevented the Delivery_Date__c update from triggering another SAP event. Clean, loop-free bidirectional sync.
📌 For Interviewer
Loop prevention is the architect's key responsibility in bidirectional sync | Field-level SoR designation is the design principle | MuleSoft as middleware vs direct integration is an architectural choice with significant implications
🎤 "Bidirectional Salesforce-SAP sync requires explicit System of Record field designation, loop prevention via source system flags, conflict resolution strategy, and typically a middleware layer for transformation and retry — without loop prevention the two systems will perpetually update each other."
Q56
How does Named Credentials architecture improve integration security compared to hardcoded credentials?
⚡ Direct Answer
Named Credentials store authentication credentials (OAuth tokens, username/password, certificates) and endpoint URLs securely in Salesforce — separate from Apex code and configuration. Apex callouts reference the Named Credential by name: HttpRequest.setEndpoint('callout:MySystem/path'). Salesforce handles token refresh, credential storage (encrypted at rest), and IP whitelisting automatically. No credentials ever appear in Apex code or Custom Settings.
🏗️ Architecture Points
Named Credentials enforce Remote Site Settings automatically — no separate whitelist needed | External Credentials (Spring 2023+): new model that separates authentication from endpoint definition — supports per-user or per-org credential sets | Legacy Named Credentials: single credential per named credential (org-wide) | Per-user Named Credentials: different OAuth tokens per user — enables user-context integrations | Credentials stored in Named Credentials cannot be accessed by Apex — only referenced via callout: prefix | Change management: rotating credentials only requires Named Credential update, not code deployment
🏢 XYZ Company Example
At XYZ Company, the SAP integration previously stored OAuth tokens in Custom Settings (accessible in Apex, visible to any developer with org access). Migration to Named Credentials: SAP OAuth token stored in Named Credential, Apex code changed from string-based endpoint to 'callout:SAP_Production/orders'. Security audit passed — no credentials in code or accessible metadata. Token rotation only required Named Credential update, not a deployment.
📌 For Interviewer
Named Credentials vs hardcoded credentials is a security architecture baseline | External Credentials is the modern evolution — shows currency with 2023+ platform features | Credential rotation without code deployment is the operational security benefit
🎤 "Named Credentials eliminate credential exposure in Apex code by abstracting authentication into Salesforce-managed encrypted storage — referenced via the callout: prefix, with automatic token refresh and Remote Site Settings enforcement, enabling credential rotation without code changes."
Q57
What is the Salesforce Composite Graph API and how does it differ from the standard Composite API?
⚡ Direct Answer
Composite Graph API (Spring 2020+) enables creating multiple independent record trees in a single HTTP request — up to 500 sub-requests across multiple independent trees. Unlike standard Composite API (25 requests, one sequential chain with $refId references), Composite Graph creates multiple disconnected graphs simultaneously. Each graph can have cross-references ($refId) within itself but not across graphs. All graphs commit atomically.
🏗️ Architecture Points
Composite Graph vs Composite: Composite = one sequential chain; Composite Graph = multiple parallel trees in one call | 500 sub-request limit makes Composite Graph suitable for moderate bulk scenarios | allOrNone behavior: if any graph fails, all graphs in the request fail (atomic) | Composite Graph is ideal for: creating multiple independent records sets in one API call (e.g., creating 10 customer-with-contact pairs in one request) | Not suitable for true bulk operations — use Bulk API 2.0 for 10K+ records
🏢 XYZ Company Example
At XYZ Company, a mobile onboarding app needed to create Account + Contact + Opportunity for each new customer — 10 customers at once from a bulk onboarding session. Composite API: 3 sub-requests × 10 customers = 30 calls sequentially (too slow). Composite Graph: 10 independent graphs (each with Account→Contact→Opportunity chain) in one HTTP request. 10x performance improvement. All 10 customers created atomically.
📌 For Interviewer
Composite Graph vs Composite is a nuanced differentiator — interviewers use it to find architects vs developers | Atomic commit across all graphs is the key behavior | 500 sub-request limit positions it between standard Composite (25) and Bulk API (unlimited)
🎤 "Composite Graph API enables multiple independent record creation trees in a single atomic HTTP request — unlike standard Composite's 25-request sequential chain, Composite Graph supports up to 500 sub-requests across multiple parallel trees, ideal for moderate-volume multi-object creation scenarios."
Q58
How does Change Data Capture (CDC) implement reliable event delivery for external system integration?
⚡ Direct Answer
Change Data Capture automatically generates events for every create, update, delete, and undelete on selected Salesforce objects — no custom Apex required. CDC events include: changed field values only (delta, not full record), header data (transaction ID, sequence number, operation type, originating user). Events persist on the Salesforce event bus for 72 hours with ReplayId-based replay capability.
FeatureCDCPlatform Events
PublisherSalesforce automaticallyCustom (Apex/Flow/API)
TriggersAny record changeExplicit publish call
PayloadChanged fields only (delta)Custom event fields
Replay72 hours72 hours (standard)
🏗️ Architecture Points
CDC publishes ONLY changed fields — full record not included unless all fields changed | ChangeType header: CREATE, UPDATE, DELETE, UNDELETE — subscribers must handle all four | Gap events: if the subscriber's last processed ReplayId is older than 72 hours, a gap event is delivered indicating missed events | CDC is ideal for data replication patterns — replicate Salesforce data to a data warehouse, data lake, or external cache | CDC with Apex trigger subscriber: @isTest cannot test CDC events natively — use Test.getEventBus().deliver()
🏢 XYZ Company Example
At XYZ Company, the data warehouse team needed real-time replication of Opportunity changes to Snowflake. Traditional approach: scheduled SOQL polling every 15 minutes (missed rapid changes, high API consumption). CDC approach: subscribe to OpportunityChangeEvent — every Opportunity change (create/update/delete) streams to MuleSoft which transforms and writes to Snowflake. Near-real-time replication with zero SOQL API consumption and 72-hour replay for MuleSoft downtime recovery.
📌 For Interviewer
CDC vs polling for data sync is a clear architectural improvement recommendation | Delta payload (changed fields only) reduces data transfer and processing in the subscriber | Gap events for missed events is the reliability mechanism
🎤 "Change Data Capture automatically streams delta events for every Salesforce record change with 72-hour replay capability — eliminating API-consuming scheduled polling for data replication patterns by delivering only changed fields with ReplayId-based reliable delivery."
Q59
What are the architectural patterns for handling Salesforce API rate limits in high-volume integrations?
⚡ Direct Answer
Salesforce API limits are calculated per org per 24-hour rolling window based on license count. Architectural mitigation strategies: (1) Bulk API for mass operations (doesn't count against REST API limits), (2) Composite API to bundle multiple calls, (3) Platform Cache to reduce repeated query calls, (4) Event-driven architecture (CDC/Platform Events) instead of polling, (5) API usage monitoring and alerting before limits are reached.
🏗️ Architecture Points
API limit = 1,000 + (200 per license) for most orgs | Monitor via: Setup > System Overview, or the REST endpoint /limits | Polling anti-pattern: checking Salesforce for updates every N minutes consumes API calls even when nothing changed — replace with CDC or Platform Events | Exponential backoff: when hitting rate limits, retry with increasing delays — don't hammer the API | External system API caching: cache Salesforce data in the external system to reduce read calls | Salesforce's API limit is per ORG, not per user — all integrations share the same pool
🏢 XYZ Company Example
At XYZ Company, 3 separate integrations (ERP, Marketing Platform, Analytics) were all polling Salesforce REST API every 5 minutes. Total: 3 × 288 calls/day = 864 API calls just for polling, even when no data changed. Redesign: CDC for ERP and Analytics (event-driven, zero polling), Marketing Platform given a dedicated Connected App with Bulk API Query jobs twice daily (2 calls/day instead of 288). API consumption reduced by 94%.
📌 For Interviewer
Event-driven vs polling is the headline architectural improvement | The shared API limit pool across all integrations is critical — architects must govern API consumption holistically | Bulk API not counting against REST limits is the key cost-reduction mechanism
🎤 "Salesforce API rate limit architecture requires holistic governance across all integrations — replacing polling with event-driven CDC or Platform Events, using Bulk API for mass operations exempt from REST limits, and implementing Composite API to reduce call count through request bundling."
Q60
How does MuleSoft integration architecture differ from direct Salesforce API integration?
⚡ Direct Answer
MuleSoft (Anypoint Platform) adds a middleware layer between Salesforce and other systems: transformation (different data models), orchestration (complex multi-system workflows), error handling and retry logic, centralized security (OAuth, encryption), monitoring and observability, and protocol translation (REST↔SOAP, JSON↔XML↔CSV). Direct API integration is point-to-point — simpler for 1:1 integrations, but creates a web of dependencies at scale.
AspectDirect APIMuleSoft (Middleware)
ComplexityLow for simple integrationsHigher initial setup
ScalabilityPoint-to-point web grows exponentiallyHub-and-spoke — N systems, not N² connections
MonitoringPer-integration logsCentralized Anypoint Monitoring
Retry logicCustom per integrationBuilt-in with MuleSoft policies
🏗️ Architecture Points
N systems: direct integration requires N×(N-1) connections; MuleSoft requires N connections to hub | MuleSoft as API-led connectivity: Experience APIs (channel-specific), Process APIs (orchestration), System APIs (backend CRUD) — three-layer architecture | MuleSoft is owned by Salesforce — native Salesforce connector with pre-built operations | For simple 2-system integration, MuleSoft adds unnecessary overhead — evaluate ROI | MuleSoft Accelerators: pre-built integration templates for common patterns (Salesforce-SAP, Salesforce-ServiceNow)
🏢 XYZ Company Example
At XYZ Company, direct API integration worked for Salesforce↔IndiaMART (1:1). When ERP, Marketing Cloud, Logistics, and Analytics were added, the team was managing 6 separate integration codebases with different error handling, retry logic, and monitoring. The architect recommended MuleSoft at 5+ system integrations — hub-and-spoke reduced connection management from 12 point-to-point connections to 5 MuleSoft flows with centralized monitoring.
📌 For Interviewer
Direct vs middleware is an architectural scale decision — the crossover point is typically 3-5 systems | API-led connectivity three-layer architecture is the MuleSoft methodology answer | MuleSoft-Salesforce native connector is a differentiator vs third-party middleware
🎤 "MuleSoft middleware architecture transforms point-to-point integration spaghetti into hub-and-spoke with centralized transformation, error handling, monitoring, and security — the architectural ROI justifies the additional setup complexity at 3+ system integration landscapes."
Q61
How does Outbound Messages work and when is it still appropriate?
⚡ Direct Answer
Outbound Messages send SOAP XML to an external endpoint triggered by Workflow Rules — guaranteeing at-least-once delivery with 24-hour automatic retry. Appropriate only for SOAP-capable legacy endpoints. Platform Events are the modern architectural replacement.
🏗️ Architecture Points
Workflow Rules being retired = Outbound Messages path is ending | 24-hour retry with exponential backoff | External system must respond 200 OK to acknowledge — idempotency in external system critical | Migration path: Outbound Message → Platform Event subscriber
🏢 XYZ Company Example
At XYZ Company, legacy ERP received Outbound Messages when Opportunities closed. ERP vendor announced SOAP deprecation. Architect migrated to Platform Events: trigger publishes OpportunityClosed__e → MuleSoft subscribes → calls ERP REST endpoint. Outbound Messages retired.
🎤 "Outbound Messages provide legacy SOAP notifications with 24-hour retry — Platform Events are the architectural replacement for all new integration requirements."
Q62
What is the difference between REST API and Connect REST API architecturally?
⚡ Direct Answer
REST API: accesses sObject data via CRUD — designed for data integration. Connect REST API: accesses Salesforce application features (Chatter, files, communities, Knowledge, approvals) as pre-aggregated RESTful resources — designed for mobile and portal applications.
🏗️ Architecture Points
Connect API pre-aggregates complex data: one call returns Chatter post with likes, comments, user details | Connect API for approvals: submit/approve/reject via REST — no custom Apex | Use REST for data operations; Connect for Salesforce feature access
🏢 XYZ Company Example
At XYZ Company, mobile app needed Account Chatter feed + files. REST API: 4+ separate calls. Connect API: one call with all sub-resources returned. API calls reduced 75% for the activity feed feature.
🎤 "Connect REST API provides pre-aggregated Salesforce application features as single RESTful resources — reducing multiple REST API calls to one for mobile and portal applications."
Q63
How do you implement a reliable Salesforce webhook receiver?
⚡ Direct Answer
Pattern: @RestResource Apex class validates HMAC signature → publishes Platform Event → returns 200 OK immediately → Platform Event subscriber processes asynchronously. Never process synchronously — external systems timeout and the immediate 200 OK is critical.
🏗️ Architecture Points
Never process webhook payload synchronously — response must be immediate | HMAC signature verification authenticates the sender | External ID deduplication for idempotent retry handling | Error logging to custom Error_Log__c object
🏢 XYZ Company Example
At XYZ Company, IndiaMART webhooks timed out under load with synchronous processing. Redesign: receive → validate HMAC → publish Platform Event → 200 OK. Zero timeouts. HMAC check rejected 3 unauthorized requests in the first month.
🎤 "A reliable Salesforce webhook receiver returns immediate 200 OK and offloads processing to Platform Events — with HMAC verification, External ID idempotency, and error logging for observability."
Q64
What are the considerations for Salesforce API versioning in long-lived integrations?
⚡ Direct Answer
Salesforce supports API versions for minimum 3 years. Strategy: pin to specific version, monitor retirement announcements in release notes, test against next version annually, and plan version upgrades as scheduled projects — not emergencies.
🏗️ Architecture Points
Version in endpoint URL: /services/data/v59.0/ | Retirement announced 9-12 months in advance | Test against current AND next version annually | Enterprise WSDL version-specific — regenerate on upgrade | Maintain a test suite running against both versions
🏢 XYZ Company Example
At XYZ Company, ERP on API v32.0 received retirement notice. 9-month window: found 2 breaking changes in sandbox testing, updated, deployed 3 months before deadline. Zero-incident upgrade. Another team discovered it the week before — weekend production incident.
🎤 "Salesforce API version governance requires monitoring retirement notices, annual next-version testing, and planned upgrade projects — Salesforce provides 9-12 months notice that proactive architects use to prevent emergencies."
Q65
How does Heroku extend Salesforce platform capabilities?
⚡ Direct Answer
Heroku adds compute-intensive processing beyond governor limits, technology stack diversity (Python, Node.js), and long-running processes. Patterns: Heroku Connect (bi-directional data sync), External Service (call from Flow via OpenAPI), direct REST API integration.
🏗️ Architecture Points
Heroku justified by specific platform constraints — not as general Salesforce alternative | Heroku Connect uses Salesforce Bulk API + Streaming API internally | External Service from Flow: define OpenAPI spec, Flow invokes without code | Governor limits are the specific justification
🏢 XYZ Company Example
At XYZ Company, Python ML model scored polymer batch quality — impossible in Salesforce (Python unsupported, limits exceeded). Heroku hosted Flask API. Batch Apex sends data, Heroku processes, results pushed back via REST API.
🎤 "Heroku extends Salesforce for compute-intensive processing and technology stack diversity — justified specifically when Salesforce governor limits are the explicit constraint."
Q66
How does the Salesforce GraphQL API differ from REST API architecturally?
⚡ Direct Answer
Salesforce GraphQL API (GA Summer 2023) lets clients specify exact fields and nested relationships in a single request — eliminating REST over-fetching (unused fields returned) and under-fetching (multiple calls for related data). Client defines response shape, not the server.
🏗️ Architecture Points
Single POST to /services/data/vXX.0/graphql | Query Account + Contacts + Opportunities in ONE request | Not all Salesforce objects supported yet | Counts against API limits | Ideal for mobile with limited bandwidth constraints
🏢 XYZ Company Example
At XYZ Company, mobile app needed Account + Contacts + Opportunities. REST: 3 calls. GraphQL: one query specifying exact nested fields. Bandwidth reduced 60%. Developer experience improved significantly.
🎤 "Salesforce GraphQL API enables client-defined response shapes eliminating REST over-fetching and under-fetching — architecturally superior for mobile applications requiring complex relational data in one request."
Q67
What are the patterns for Salesforce-to-Salesforce integration?
⚡ Direct Answer
S2S patterns: Salesforce Connect cross-org adapter (External Objects — no data duplication), Platform Events cross-org via REST API, REST API direct with JWT Bearer authentication, MuleSoft hub for complex orchestration.
🏗️ Architecture Points
Native S2S Connect is deprecated — use cross-org Salesforce Connect adapter | JWT Bearer token for org-to-org authentication | Define System of Record per data domain — which org owns which fields | Loop prevention: source_org__c flag same as bidirectional sync pattern
🏢 XYZ Company Example
At XYZ Company (India + Belgium orgs), Belgium Order records surfaced as External Objects in India org via Salesforce Connect cross-org adapter. No data duplication. Schema changes in Belgium auto-updated India's External Object. Zero maintenance overhead.
🎤 "Salesforce-to-Salesforce integration via the cross-org Salesforce Connect adapter virtualizes data without replication — REST API with JWT Bearer for write operations and MuleSoft for complex orchestration."
Q68
How does Salesforce implement API security through Connected App OAuth scopes?
⚡ Direct Answer
Connected App security: OAuth scopes restrict API operations (prefer granular over 'full'), IP restrictions limit token usage to corporate networks, refresh token policies control lifetime, and permitted users restrict which profiles can authenticate.
🏗️ Architecture Points
Scope 'full' grants everything — never use for integration apps | 'api' scope grants ALL REST API — prefer specific scopes | IP restriction 'Relax' is a security risk — enforce corporate IP ranges | Admin-approved users only is the enterprise standard
🏢 XYZ Company Example
At XYZ Company, audit found vendor Connected App with scope='full' and no IP restrictions. Remediated: changed to 'api refresh_token' scope, added IP restriction to vendor office IPs, changed to Admin-approved users with dedicated integration profile. Attack surface reduced 95%.
🎤 "Connected App security enforces least-privilege via granular OAuth scopes, IP-based token restriction, and admin-approved user restriction — eliminating the 'full scope, no restrictions' pattern that creates maximum breach blast radius."
Q69
What is the difference between Legacy Named Credentials and External Credentials?
⚡ Direct Answer
Legacy Named Credentials: endpoint + auth combined, one credential per NC. External Credentials (Spring 2023+): separates auth configuration (Auth Provider) from credential values, supports per-user credentials and multiple credential sets — the modern replacement.
🏗️ Architecture Points
Per-user External Credentials: each user's own OAuth token to external system | Principal types: Named Principal (org-wide), Per-User (user-specific) | Callout syntax unchanged: callout:MyNamedCredential/endpoint works identically | Auth Provider defines OAuth flow — separate from credential storage
🏢 XYZ Company Example
At XYZ Company, Google Drive integration needed each rep's own Drive access. Legacy NC: only one service account token for everyone. External Credentials with Per-User Principal: each rep's own OAuth token. Each rep accesses only their own Drive — zero data leakage.
🎤 "External Credentials separate authentication configuration from credential storage — enabling per-user OAuth tokens and multiple credential sets, the modern replacement for legacy Named Credentials."
Q70
How do you architect a rate-limit-resilient Salesforce integration?
⚡ Direct Answer
Architecture: monitor /limits endpoint proactively, implement exponential backoff on HTTP 429, replace polling with Platform Events/CDC, use Bulk API for mass operations (exempt from REST limits), and implement circuit breaker pattern.
🏗️ Architecture Points
HTTP 429 = API limit exceeded — back off exponentially (1s, 2s, 4s, 8s) | Bulk API not counted against REST API limits — biggest architectural saving | Platform Events: zero polling API calls, events fire only when data changes | Circuit breaker: stop after N failures for M minutes
🏢 XYZ Company Example
At XYZ Company, month-end burst consumed 60% of daily API limit, throttling real-time order sync. Redesign: month-end migrated to Bulk API (exempt from REST), order sync to Platform Events (zero polling), exponential backoff in MuleSoft. Month-end no longer impacts real-time integrations.
🎤 "Rate-limit-resilient integration combines Bulk API for mass operations, event-driven subscriptions replacing polling, and exponential backoff with circuit breaker — preventing one integration's burst from throttling all others."

Automation & Event Architecture

Q71–Q85 · The heart of Salesforce business logic

Q71
How does Salesforce prevent and detect trigger recursion and what are the architectural patterns?
⚡ Direct Answer
Trigger recursion occurs when a trigger's DML operation on Record A triggers another execution on Record A (or B triggers A which triggers B). Prevention patterns: (1) Static Boolean flag in a utility class (TriggerHandler pattern) — set to true before DML, check at trigger entry; (2) Set of processed record IDs to skip already-processed records; (3) Recursion depth counter for multi-level recursion tracking.
🏗️ Architecture Points
Simple Boolean flag: works for single-level recursion, fails for legitimate re-entry scenarios (e.g., different field changes) | ID Set pattern: more precise — skip only records already processed in this transaction | The fundamental fix: trigger should only run for relevant field changes (check Trigger.oldMap vs Trigger.newMap) — reduces unnecessary re-entry | Flow-trigger interaction: Flows can cause trigger re-entry too — the flag must cover both | Unit test for recursion: create a test that updates a record and verifies the trigger ran exactly once
🏢 XYZ Company Example
At XYZ Company, an after-update trigger on Opportunity updated a related Account field. The Account update triggered another Opportunity update (Account's formula field changed, cascading to Opportunity). Infinite loop. Fix: TriggerExecutionContext class with a static Set alreadyProcessed. The trigger checked if the Opportunity ID was in alreadyProcessed before executing — legitimate second runs (different field change) still processed, recursive runs (same ID, same change) skipped.
📌 For Interviewer
The ID Set pattern is more sophisticated than the Boolean flag — shows architecture depth | Flow re-entry via trigger is often missed — shows completeness | Unit testing recursion is the professional practice
🎤 "Trigger recursion architecture requires ID-based tracking rather than simple Boolean flags — ensuring legitimate re-entry scenarios on different field changes still execute while preventing recursive loops from the same DML operation."
Q72
What are the architectural considerations for building a Saga pattern in Salesforce for distributed transactions?
⚡ Direct Answer
The Saga pattern manages distributed transactions across multiple systems where traditional ACID transactions are impossible. In Salesforce: each step of the saga is an independent transaction with a compensating transaction for rollback. Implementation: a Saga orchestrator (Queueable Apex chain) executes steps sequentially — if Step 3 fails, it calls compensating actions for Steps 1 and 2 to undo their effects. State tracked in a custom Saga_Execution__c object.
🏗️ Architecture Points
Salesforce doesn't support distributed transactions (2-phase commit) — Saga is the architectural alternative | Compensating transactions must be idempotent — they may be called multiple times | Saga state machine: STARTED, STEP_1_COMPLETE, STEP_2_COMPLETE, FAILED, COMPENSATING, COMPENSATED | Transaction Finalizers in Queueable Apex: execute cleanup even when the Queueable fails with an unhandled exception — essential for Saga failure detection | Choreography vs Orchestration Saga: orchestration (one controller) is easier to reason about for Salesforce; choreography (event-driven) is more scalable but complex
🏢 XYZ Company Example
At XYZ Company, creating a large order required: (1) Create Salesforce Order record, (2) Reserve inventory in ERP, (3) Create shipping request in Logistics. If Step 3 failed, Step 2 needed to release inventory and Step 1 needed to cancel the order. Saga implementation: Queueable Apex chain with Saga_Execution__c tracking state. Step 3 ERP failure → Saga transitioned to COMPENSATING state → reversed Steps 2 and 1 via compensating API calls. Consistent distributed state without distributed transactions.
📌 For Interviewer
Saga pattern is an advanced architecture topic — often asked in senior/architect interviews | Compensating transactions + idempotency is the core design | Transaction Finalizers for failure detection is the Apex-specific implementation detail
🎤 "The Saga pattern implements distributed transaction management in Salesforce through sequential Queueable Apex steps with compensating transactions for each step — orchestrated via a Saga state machine that rolls back successfully completed steps when any subsequent step fails."
Q73
How does the Apex Flex Queue manage async job prioritization and concurrency?
⚡ Direct Answer
The Apex Flex Queue is a holding area for Batch Apex jobs waiting to run. Maximum 100 jobs can be in Holding status in the Flex Queue. Salesforce processes Flex Queue jobs in FIFO order (by default), moving them to Queued status when executor capacity is available. Maximum 5 Batch Apex jobs can run concurrently per org. Developers can reorder jobs in the Flex Queue using the FlexQueue API.
🏗️ Architecture Points
5 concurrent batch jobs: most common org constraint for Apex automation | Flex Queue ordering: first-in-first-out by default, but FlexQueue.moveJobToFront() enables priority promotion | Scheduled Apex impacts: 100 scheduled Apex job limit per org includes Scheduled Apex not just Batch | Queueable jobs don't use the Flex Queue — they use a separate Async Job Queue | Monitor via Setup > Apex Jobs or AsyncApexJob SOQL queries | Chained Queueable jobs: each link executes asynchronously — no Flex Queue involvement
🏢 XYZ Company Example
At XYZ Company, month-end processing launched 8 simultaneous Batch Apex jobs: data archival, commission calculation, territory reporting, ERP sync, email campaigns × 4. With only 5 concurrent job slots, 3 jobs queued in the Flex Queue. The commission calculation was time-critical (finance needed it by 6 AM). The architect used FlexQueue.moveJobToFront() to prioritize commission calculation and FlexQueue API to implement a batch scheduler that respects business priorities.
📌 For Interviewer
5 concurrent Batch Apex jobs is a real architectural constraint in production orgs | FlexQueue.moveJobToFront() for priority management is an advanced API | Queueable not using Flex Queue is a distinction many candidates miss
🎤 "The Apex Flex Queue manages Batch Apex prioritization with a maximum of 5 concurrent running jobs per org — FlexQueue API enables runtime priority reordering, critical for production environments where multiple time-sensitive batch processes compete for executor capacity."
Q74
What are the architectural differences between before-save Flows and record-triggered Flows?
⚡ Direct Answer
Before-save Flows (Fast Field Updates) run synchronously before the record is committed to the database — they can update fields on the triggering record directly without a DML statement (the record is in memory). Record-triggered Flows (after-save) run asynchronously after the record is committed — they can create/update related records, publish Platform Events, and call actions, but require separate DML operations and support scheduled paths.
AspectBefore-Save FlowAfter-Save Flow
DML for same recordNo DML needed (in memory)Requires separate DML
Related recordsNo (cannot query/DML others)Yes
PerformanceFaster (no DML)Slower (additional DML)
Scheduled pathNoYes (hours/days later)
Platform EventsNoYes
🏗️ Architecture Points
Before-save Flows are the performance-optimal choice for same-record field updates — prefer over after-save for this use case | After-save Flows for: creating child records, related object updates, Platform Event publishing, sending emails | Scheduled paths in after-save: 'When Opportunity stays in Negotiation for 7 days → send follow-up email' — powerful for time-based automation without Scheduled Apex | Before-save Flows run before validation rules in most contexts — verify behavior in your org version | Mixing before-save and after-save Flows on the same object requires careful order-of-execution planning
🏢 XYZ Company Example
At XYZ Company, two Flows on Opportunity: (1) Before-save: calculate Discount_Percentage__c from Amount and List_Price__c (same-record update, no DML needed — 40% faster than after-save version). (2) After-save: create a Visit_Report__c related record when Stage = 'Negotiation' (requires DML on a related object). Separating them by pattern (before-save for field updates, after-save for related record creation) optimized performance and clarity.
📌 For Interviewer
Before-save vs after-save distinction is a 2024/2025 exam topic | Performance difference (no DML in before-save) is the architectural justification | Scheduled paths in after-save Flows is an often-underused feature that replaces complex Scheduled Apex
🎤 "Before-save Flows update the triggering record in memory without DML — architecturally optimal for field calculations; after-save Flows handle related record operations, Platform Events, and scheduled time-based paths — the architectural split by capability type optimizes both performance and maintainability."
Q75
How does Transaction Finalizer in Queueable Apex improve integration reliability?
⚡ Direct Answer
Transaction Finalizer (introduced Summer 2021) executes code AFTER a Queueable job completes — whether it succeeds or fails with an unhandled exception. The execute(FinalizerContext ctx) method receives the job result status (SUCCESS, ERROR, ABORT) and the exception that caused failure. This enables reliable async processing: update a status record, send an alert, chain a retry job — all triggered by the success or failure of the Queueable.
🏗️ Architecture Points
Without Transaction Finalizer: if a Queueable throws an unhandled exception, it fails silently — no notification, no status update, no retry | With Finalizer: guaranteed execution regardless of outcome — the Saga pattern's failure detection mechanism | FinalizerContext.getRequestId(): the Queueable job's unique ID for logging | Retry pattern: in the Finalizer, if status is ERROR, enqueue a new Queueable retry job (up to a retry limit stored in a custom field) | Finalizer itself must not throw unhandled exceptions — wrap in try-catch | Finalizer has its own governor limit context
🏢 XYZ Company Example
At XYZ Company, an ERP callout Queueable was silently failing when the ERP was unavailable — orders were lost with no visibility. Adding Transaction Finalizer: SUCCESS → update Order__c.Integration_Status__c = 'Synced'; ERROR → update Order__c.Integration_Status__c = 'Failed', create an Error_Log__c record, enqueue retry Queueable if retry_count < 3; ABORT → alert the integration team via email alert. Zero silent failures after implementation.
📌 For Interviewer
Transaction Finalizer is a 2021+ feature — showing knowledge of it demonstrates platform currency | The silent failure problem it solves is a real production reliability issue | Retry pattern with retry count is the practical implementation
🎤 "Transaction Finalizers guarantee execution after Queueable completion regardless of success or failure — providing Salesforce async processing with reliable status tracking, failure alerting, and retry orchestration that eliminates silent integration failures."
Q76
What is the pattern for bulk-safe Apex triggers processing 50K+ records?
⚡ Direct Answer
Triggers process up to 200 records per execution with fresh governor limits each time. Bulk-safe pattern: pre-query Maps (one SOQL before loop), Set-based deduplication, single DML per execution regardless of batch size. Never SOQL inside a for loop.
🏗️ Architecture Points
SOQL inside a for loop = #1 bulk anti-pattern | Pre-query Map enables O(1) lookup inside loop | For volumes beyond trigger capability: delegate to Batch Apex via Platform Events | Trigger handler pattern: all logic in a separate Apex class
🏢 XYZ Company Example
At XYZ Company, data migration loaded 200K Accounts triggering Territory_Assignment__c creation. Each 200-record execution used one pre-queried Map. 1,000 executions × 1 SOQL each. No governor limit hit. Same code worked for 1 and 200,000 records identically.
🎤 "Apex bulk trigger architecture uses pre-query Maps and single SOQL/DML per execution — ensuring logic scales from 1 to 200 records per batch without modification."
Q77
How does Apex transaction control affect database integrity?
⚡ Direct Answer
Apex transaction control: Database.setSavepoint() marks a rollback point, Database.rollback(sp) reverts all DML after it. Default Apex is atomic — unhandled exception rolls back everything. Database.insert(records, false) enables partial success for bulk imports.
🏗️ Architecture Points
Savepoints cannot cross async boundaries — @future starts a new transaction | Platform Events with publishImmediately do NOT roll back when transaction rolls back — creates phantom events | Critical constraint: cannot make a callout AFTER DML in the same synchronous transaction
🏢 XYZ Company Example
At XYZ Company, Order creation needed to call ERP AFTER creating Order Lines (needed the Line IDs). Callout after DML forbidden in sync context. Fix: Apex creates Order + Lines → publishes Platform Event → Event subscriber (new transaction) makes ERP callout with Line IDs.
🎤 "Apex transactions provide all-or-nothing atomicity with partial success via Database methods — the critical constraint that callouts cannot follow DML requires async offload via Platform Events or Queueable."
Q78
What are the architectural considerations for Apex REST services?
⚡ Direct Answer
Apex REST (@RestResource) exposes Apex as custom REST endpoint. Architecture requirements: URL versioning (/v1/, /v2/), OAuth authentication, FLS enforcement on all queries, correct HTTP status codes (not just 200 for everything), input validation, and response payload optimization.
🏗️ Architecture Points
URL versioning in urlMapping is the API design practice | FLS enforcement: WITH SECURITY_ENFORCED or Security.stripInaccessible() required — endpoints are public attack surfaces | Return 200/201/400/404/500 appropriately | Input validation prevents injection attacks
🏢 XYZ Company Example
At XYZ Company, custom REST GET /apex/api/v1/products returned all 2,000 products with 50 fields. Mobile needed only 8 fields. Optimization: custom response wrapper, pagination, Cache-Control header. Response time: 2.1 seconds to 0.3 seconds.
🎤 "Apex REST services require URL versioning, FLS enforcement, appropriate HTTP status codes, input validation, and payload optimization — treating the endpoint as a public API contract that outlives the initial implementation."
Q79
How does the Salesforce rule engine process multiple automation tools and what conflicts arise?
⚡ Direct Answer
Multiple tools execute in fixed order: Before Triggers → Validation Rules → After Triggers → Assignment Rules → Workflow Rules → Flows (after-save). Conflicts arise when multiple tools on the same object interact unexpectedly — duplicate emails, conflicting field updates, or failed validations from Flow field changes.
🏗️ Architecture Points
Conflict type 1: Before Trigger sets field → Validation checks it → Flow sets same field differently → Validation runs again with new value | Conflict type 2: Workflow + Flow both send emails on same condition → duplicates sent | Principle: one automation tool per field prevents most conflicts
🏢 XYZ Company Example
At XYZ Company, Validation Rule prevented past close dates. A record-triggered Flow moved the date to yesterday AFTER validation ran — setting an invalid value post-validation. Fix: moved date calculation to Before Trigger (runs before validation). Order of execution knowledge resolved a mystery bug.
🎤 "Automation conflicts arise from the fixed execution order creating unexpected tool interactions — resolved by knowing the exact order and enforcing single-tool ownership per field or action."
Q80
What is the difference between publishImmediately and publishAfterCommit for Platform Events?
⚡ Direct Answer
publishImmediately: event fires when publish() is called — even if the transaction later rolls back, creating phantom events for data that never existed. publishAfterCommit (default): fires only after successful transaction commit — consistent with DML outcomes.
🏗️ Architecture Points
publishImmediately use case: audit logging of ATTEMPTED operations including failed ones | publishAfterCommit: subscriber can trust data is committed before processing | HVPEs require publishImmediately — no publishAfterCommit option | Subscriber runs in separate transaction 2-3 seconds after publish
🏢 XYZ Company Example
At XYZ Company, Order Platform Event published with publishImmediately. Order validation failed, transaction rolled back — but event already fired. ERP received OrderCreated for non-existent Order, creating errors. Fix: switched to publishAfterCommit. ERP only receives events for committed Orders.
🎤 "publishAfterCommit ensures Platform Events only fire for successfully committed transactions — publishImmediately creates phantom events for rolled-back transactions and should only be used for intentional pre-commit audit logging."
Q81
How does Apex Continuation enable long-running callouts in Lightning?
⚡ Direct Answer
Apex Continuation allows LWC to make external callouts up to 60 seconds without blocking the UI. The LWC calls an Apex method returning a Continuation object; Salesforce suspends the browser connection; a callback method processes the response when the external system replies. UI stays responsive throughout.
🏗️ Architecture Points
Continuation timeout: up to 60 seconds — longer than standard synchronous Apex | Up to 3 parallel callouts in one Continuation object | UI-only pattern — not supported in Batch or Queueable | Callback method gets fresh governor limits
🏢 XYZ Company Example
At XYZ Company, product configurator LWC needed real-time warehouse API response (average 8 seconds). Standard Apex: 8-second UI freeze. With Continuation: LWC shows spinner while Salesforce awaits external response. UI fully responsive during wait. User experience transformed.
🎤 "Apex Continuation enables Lightning components to await long-running external APIs up to 60 seconds without blocking the UI — Salesforce suspends the connection while waiting, with a callback processing results asynchronously."
Q82
What are the patterns for implementing Salesforce notifications?
⚡ Direct Answer
Notification architecture: Custom Notification Type (Messaging.CustomNotification) for in-app bell icon and mobile push notifications; Platform Events wire adapter in LWC for real-time in-page updates without page refresh; Email Alerts for external notifications.
🏗️ Architecture Points
Custom Notifications API: 1,000 per hour per org limit | Platform Event in LWC: wire subscribes, component updates reactively in real-time | Consolidate multiple events into one notification — prevent notification fatigue | Mobile push requires Salesforce Mobile App installed
🏢 XYZ Company Example
At XYZ Company, field reps needed immediate notification when high-value prospects submitted forms. Trigger on Lead → Messaging.CustomNotification to Lead Owner. Notification appeared in Salesforce mobile app within 3 seconds. Average rep response time: 4 hours → 18 minutes.
🎤 "Salesforce notification architecture combines Custom Notifications for bell/mobile push, Platform Events for real-time in-page LWC updates, and Email Alerts — with the 1,000/hour Custom Notification limit as the architectural ceiling."
Q83
How does Salesforce implement the Observer pattern in automation?
⚡ Direct Answer
Salesforce automation is a direct implementation of the Observer pattern: record save = Subject; Apex triggers, Flows, Validation Rules, Workflow Rules = synchronous Observers; Platform Event subscribers = asynchronous Observers. New behaviors added as new Observers without modifying existing code.
🏗️ Architecture Points
Before trigger: synchronous Observer modifying before commit | After trigger: synchronous Observer reacting post-commit | Platform Event subscriber: async Observer in separate transaction | New requirements = new Observers — existing automation untouched | Conflict risk: too many Observers on one event
🏢 XYZ Company Example
At XYZ Company, architect documented automation as Observer diagram: Record Save → Before Trigger → Validation → After Trigger → Flow → Platform Event → ERP. New requirements added as new Observers — 47 automation rules still maintainable because each owned its domain.
🎤 "Salesforce automation implements the Observer pattern — record saves trigger decoupled Observers that add behavior without modifying existing logic, with Platform Events extending this to asynchronous cross-transaction scenarios."
Q84
What happened to Salesforce Functions and what are the architectural alternatives?
⚡ Direct Answer
Salesforce Functions were deprecated September 2023. No direct replacement. Alternatives: Heroku for external compute, AWS Lambda/Azure Functions invoked via Apex callouts, MuleSoft for orchestration-heavy scenarios.
🏗️ Architecture Points
Functions deprecation lesson: never build core business logic on beta/pilot features without an exit strategy | External compute via Heroku or AWS Lambda: same @future callout pattern as any external API | Salesforce has no on-platform unbounded compute alternative — governor limits remain the constraint
🏢 XYZ Company Example
At XYZ Company, Functions pilot used for CPU-intensive PDF generation. On deprecation announcement: migrated to AWS Lambda via @future callout. Lambda generated PDFs faster at 70% lower cost. Governance rule established: no development on Salesforce preview features without a written exit strategy.
🎤 "Salesforce Functions were deprecated September 2023 — external FaaS platforms invoked via Apex callouts are the replacement, reinforcing the principle that core business logic should never depend on preview platform features without exit strategies."
Q85
How does Salesforce implement retry logic for failed automation?
⚡ Direct Answer
Retry by type: Platform Event subscribers auto-retry up to 72 hours with exponential backoff. Batch Apex execute() chunks are NOT retried — batch continues. @future and Queueable have NO automatic retry — implement via Transaction Finalizers. Scheduled Apex: failed run skipped, next scheduled execution proceeds normally.
🏗️ Architecture Points
Platform Event: only built-in retry mechanism in Salesforce automation | Queueable Transaction Finalizer retry: enqueue new Queueable if error_count < MAX_RETRIES | Always log failures to Error_Log__c with jobType, recordId, errorMessage, retryCount | Dead letter pattern: after MAX_RETRIES, move to manual review queue
🏢 XYZ Company Example
At XYZ Company, Queueable ERP sync silently failed when ERP was unavailable. Transaction Finalizer added: SUCCESS → update sync status; ERROR with retry_count < 3 → enqueue retry Queueable; ERROR = 3 → insert Error_Log__c, send alert. Failure visibility: 0% to 100%.
🎤 "Platform Event subscribers auto-retry for 72 hours; Batch, Queueable, Scheduled Apex require explicit retry implementation via Transaction Finalizers, failure logging, and dead-letter queuing for persistent failures."
🚀

Deployment & DevOps Architecture

Q86–Q100 · How great Salesforce code reaches production

Q86
What is the architectural difference between Salesforce DX source-driven development and org-based development?
⚡ Direct Answer
Org-based (traditional): metadata lives in the org — developers pull changes from sandbox, modify, push back. No version control as source of truth. Change Sets for deployment. Risk: org drift, merge conflicts, no code history. SFDX source-driven: version control (Git) is the source of truth — org metadata is generated FROM source files. Scratch orgs created from source, deployed via Salesforce CLI. Supports package-based development.
AspectOrg-BasedSFDX Source-Driven
Source of truthThe Salesforce orgGit repository
EnvironmentsSandboxes (persist)Scratch orgs (ephemeral)
DeploymentChange SetsSalesforce CLI + CI/CD
PackagesUnmanaged/ManagedUnlocked/Managed 2GP
BranchingDifficult (per-org)Git branching strategies
🏗️ Architecture Points
Scratch orgs are ephemeral (max 30 days) — designed to be created and destroyed, not used long-term | Source format vs metadata format: SFDX decomposes metadata into source format (one file per object field, for example) enabling meaningful Git diffs | Manifest-based deployment: package.xml specifies exactly what to deploy — more precise than Change Sets | CI/CD pipeline: Git push → automated tests → deploy to staging → approved deploy to production | SFDX doesn't eliminate sandboxes — integration testing still requires persistent sandbox environments
🏢 XYZ Company Example
At XYZ Company, migrating from org-based to SFDX: developers worked in scratch orgs (fresh environment per feature), committed changes to Git, GitHub Actions CI/CD pipeline ran Apex tests (minimum 75% coverage enforced), deployed to QA sandbox on merge to develop branch, deployed to production on merge to main with manual approval gate. Org drift eliminated — production metadata matched exactly what was in Git.
📌 For Interviewer
Source-driven vs org-based is the foundational DevOps architecture question | Scratch org ephemerality is the key architectural concept | CI/CD pipeline design is what separates senior developers from architects
🎤 "SFDX source-driven development makes Git the authoritative source of truth for all Salesforce metadata — enabling CI/CD pipelines, meaningful code review, scratch org ephemeral development, and package-based architecture that is impossible with traditional org-based Change Set development."
Q87
What are the architectural differences between 1st Generation Packages (1GP) and 2nd Generation Packages (2GP)?
⚡ Direct Answer
1GP (1st Gen): uploaded from a Developer Edition org, monolithic (whole org or nothing), single namespace, managed packages distributed via AppExchange. Limited modular composition. 2GP (2nd Gen): defined in sfdx-project.json, can have multiple packages in one repo, supports unlocked packages (no namespace requirement), package dependencies, granular version control, compatible with modern CI/CD. 2GP is the modern packaging architecture.
Feature1GP2GP
SourceDeveloper Edition orgGit + SFDX
ModularityMonolithicMultiple packages, dependencies
NamespaceRequired (managed)Optional (unlocked)
CI/CDDifficultNative support
Subscriber upgradePush via AppExchangeInstall via Package ID
🏗️ Architecture Points
Unlocked packages (2GP): no namespace, no AppExchange requirement — used for enterprise org modularization | Managed 2GP: namespace required, for AppExchange ISV distribution | Package dependencies: Package A depends on Package B — version compatibility enforced at install time | Package version promotion: beta → released, can't promote without 75% test coverage | Deprecating 1GP: Salesforce has not officially deprecated 1GP but all new development best practice is 2GP
🏢 XYZ Company Example
At XYZ Company (ISV context), migrating from 1GP to 2GP: existing managed package split into 3 unlocked packages (Core, Analytics, Integration) with explicit dependencies. Each package owned by a different team and released independently. Subscriber upgrades now applied per-package — the Analytics package could be updated without requiring subscribers to accept a full Core package upgrade. Release risk reduced significantly.
📌 For Interviewer
1GP vs 2GP is a technical architect certification topic | Unlocked packages for enterprise org modularization (not just ISV) is the key use case | Package dependencies as a CI/CD dependency graph is the architectural sophistication
🎤 "2nd Generation Packages enable modular Salesforce architecture through Git-based package definitions, multiple packages with explicit dependency management, and unlocked packages for enterprise org decomposition — overcoming 1GP's monolithic org-centric limitations."
Q88
How do you architect a Salesforce CI/CD pipeline and what are the key decision points?
⚡ Direct Answer
CI/CD architecture: (1) Source Control: Git (GitHub/GitLab/Bitbucket) with branch strategy (feature/develop/main); (2) CI: automated test execution on every pull request — Apex tests with 75%+ coverage enforced; (3) CD: automated deployment to QA/staging on merge, manual-approved deployment to production; (4) Tools: Salesforce CLI, GitHub Actions/Jenkins/Azure DevOps; (5) Artifact: package version or metadata ZIP deployed via Salesforce CLI.
🏗️ Architecture Points
Branch strategy: feature branches → develop (CI) → release branch → main (production) | Metadata scope: use package.xml or project-based packaging to control what deploys — never deploy all metadata | Test execution: run specified tests for changed classes or run all tests — balance speed vs thoroughness | Destructive changes: deletions require a separate destructiveChanges.xml — often forgotten in CI/CD setup | Pre/post deployment scripts: data seeding, permission assignment — implement as SFDX scripts | Production deployment window: enforce change control — CI/CD doesn't mean uncontrolled production deployments
🏢 XYZ Company Example
At XYZ Company, GitHub Actions CI/CD pipeline: developer pushes to feature branch → GitHub Action runs sf project deploy start --dry-run (validates without deploying) + runs specified Apex tests → pull request to develop triggers full test run → merge to develop auto-deploys to UAT sandbox → merge to main requires 2 approvals and deploys to production during change window. Deployment failures trigger Slack alert to the team.
📌 For Interviewer
Pipeline design is the architect interview deliverable — not just 'we use GitHub Actions' | Destructive changes handling is often the gap in CI/CD implementations | The manual approval gate for production is governance architecture
🎤 "A Salesforce CI/CD pipeline requires Git branch strategy, automated Apex test enforcement, metadata scope control via package.xml or SFDX projects, destructive changes handling, and production deployment governance — automating consistency while maintaining appropriate change control."
Q89
What is the architectural pattern for handling metadata conflicts in parallel development streams?
⚡ Direct Answer
Metadata conflicts occur when two developers modify the same metadata component (same Apex class, same object) in separate branches simultaneously. Resolution architecture: (1) Lock protocol: developers claim ownership of components in Jira/ADO before modifying; (2) Modular package architecture: different teams own different packages — inter-package conflicts impossible; (3) Source format Git diff: SFDX source format decomposes objects into individual files, making conflicts granular (field-level diffs, not full object XML); (4) Automated conflict detection in CI before merge.
🏗️ Architecture Points
SFDX source format is a significant conflict reduction tool: custom-object.xml decomposed into individual field, validationRule, and layout files — two developers adding different fields to the same object no longer conflict | Trunk-based development: short-lived feature branches (<2 days) reduce conflict probability | Component ownership matrix: document which team owns which metadata components | Post-merge validation: after conflict resolution, always run a dry-run deploy to validate merged metadata is deployable | The worst conflicts: Profiles and Permission Sets — these are monolithic XML files that two developers frequently modify simultaneously
🏢 XYZ Company Example
At XYZ Company, two teams simultaneously modified the Account object: Team A added Territory__c field, Team B added Polymer_Grade__c field. Traditional Change Set approach: whoever deployed second would overwrite the first's changes. SFDX source format approach: each field is a separate file (Territory__c.field-meta.xml, Polymer_Grade__c.field-meta.xml) — no conflict in Git. Both fields deployed successfully. The architect mandated SFDX source format adoption specifically to resolve the parallel development conflict problem.
📌 For Interviewer
Source format decomposition reducing conflicts is the key architectural insight | Profile XML conflicts are the most painful practical problem — show you know this | Modular package architecture as the ultimate conflict prevention is the advanced architectural solution
🎤 "Metadata conflict architecture in parallel Salesforce development is solved through SFDX source format decomposition into granular files, team-based component ownership, modular package boundaries, and short-lived feature branches — Profile and Permission Set files remain the most conflict-prone metadata requiring explicit coordination protocols."
Q90
How does Salesforce implement rollback for a failed production deployment?
⚡ Direct Answer
Salesforce does NOT have a native 'rollback deployment' button. Rollback architecture: (1) Pre-deployment backup: retrieve full org metadata via Metadata API before deployment; (2) Selective rollback: deploy the previous version of changed components only (stored in Git tags/releases); (3) Data rollback: Sandbox seeded with production data copy for testing rollback; (4) Feature flags: disable new features via Custom Metadata without deployment; (5) Emergency rollback script: pre-prepared deployment of the last-known-good version.
🏗️ Architecture Points
Feature flags (Custom Metadata): deploy new code but keep it disabled via configuration — enable only after validation, disable immediately if issues occur | Git tags on every production deployment: git tag -a v1.0.5 -m 'Production deployment Jan 5' — enables precise previous-version recovery | Quick action deployment: pre-staged rollback package ready to deploy — reduces rollback time from hours to minutes | Data rollback: if deployment changes data (DML in post-install script), a data rollback plan is required separately from metadata rollback | Partial deployment success: Salesforce deployments are all-or-nothing — if any component fails, nothing deploys | Test-only deployment (checkOnly) before actual deployment is the preventive architecture
🏢 XYZ Company Example
At XYZ Company, a production deployment introduced a Flow that caused validation errors for a specific record type. Rollback plan was executed: (1) Feature flag Custom Metadata set to disabled for new Flow (30 seconds — no deployment needed); (2) Previous Flow version retrieved from Git tag and deployed (8 minutes); (3) Root cause analysis: new Flow didn't handle null Account Type field. Fixed and redeployed next day. Feature flags reduced the customer impact window from hours to 30 seconds.
📌 For Interviewer
No native rollback is the key architectural insight that surprises developers | Feature flags as the fastest rollback mechanism is the architect's primary tool | Pre-staged rollback package is the operational readiness practice
🎤 "Salesforce has no native deployment rollback — the architect must implement rollback architecture through Git-tagged production deployments for precise version recovery, feature flags via Custom Metadata for instant disabling without redeployment, and pre-staged rollback packages ready to execute within minutes of a production incident."
Q91
How does scratch org source tracking support CI/CD pipelines?
⚡ Direct Answer
Scratch org source tracking logs every metadata change in the org. sf project retrieve start automatically retrieves only changed components. This enables the tight development loop: change in org → sf retrieve → commit to Git → PR review → CI/CD pipeline.
🏗️ Architecture Points
Source tracking default in scratch orgs, opt-in for Developer sandboxes (Spring 2023+) | sf retrieve with no arguments: gets all tracked changes since last retrieve | Conflict detection when local and org diverge | Meaningful git diffs: each field is a separate file in source format — enables granular PR review
🏢 XYZ Company Example
At XYZ Company before scratch orgs, developers tracked changes on sticky notes. After migration to scratch orgs: sf retrieve identifies changed files automatically, git diff shows exact change, PR review is meaningful and auditable. Development velocity increased 40%.
🎤 "Scratch org source tracking automatically identifies every metadata change — enabling precise git commits and meaningful PR reviews that make CI/CD pipelines practical rather than theoretical."
Q92
What are the patterns for managing Salesforce environments in a large enterprise?
⚡ Direct Answer
Enterprise environments: scratch orgs for feature development, Developer sandboxes for integration testing, Full sandbox for UAT, Partial Copy for pre-production staging, Production for live users. Governance: no direct production development, all changes flow through the complete environment chain.
🏗️ Architecture Points
Full sandbox refresh: 24-48 hours — plan release cycles around this | Automate data masking immediately post-refresh | Hotfix process bypasses normal chain with CCB emergency approval | Document environment matrix with owners, refresh schedule, current release version
🏢 XYZ Company Example
At XYZ Company (50+ developer team): each developer had a scratch org (5-minute creation), shared Integration sandbox refreshed Mondays, UAT Full sandbox per 2-week cycle, Staging Partial Copy 3 days before production. Environment matrix in Confluence prevented confusion.
🎤 "Enterprise Salesforce environments use scratch orgs for ephemeral development, Full sandboxes for UAT, and Partial Copy for staging — with explicit governance defining refresh cadence, data masking automation, and hotfix bypass procedures."
Q93
How do you implement blue-green deployment for Salesforce?
⚡ Direct Answer
True blue-green is not natively supported — Salesforce has one production org. Pseudo-blue-green via feature flags: deploy code with Custom Metadata IsEnabled__c = false, validate in production without user impact, flip flag to enable, monitor, flip back instantly if issues arise. No redeployment needed.
🏗️ Architecture Points
Custom Metadata feature flag: deploy code disabled, enable when validated | Dark launch: run new code on real data, compare results silently before enabling | Canary deployment: enable for 10% of users first (Rollout_Percentage__c field) | Instant disable without redeployment is the key capability
🏢 XYZ Company Example
At XYZ Company, new pricing engine deployed with NEW_PRICING_ENGINE_ENABLED = false. 48-hour dark launch: both engines ran, results compared in a comparison object. 99.8% match verified. Flag flipped — zero-incident deployment of the most complex calculation change in org history.
🎤 "Salesforce's single-production-org uses Custom Metadata feature flags to approximate blue-green — deploy disabled, validate via dark launch or canary rollout, and instantly enable or disable without redeployment."
Q94
What is the role of package versions in Salesforce release management?
⚡ Direct Answer
Package versions (Unlocked and Managed 2GP) are immutable installable artifacts with semantic versioning (major.minor.patch). Created from source, they install in any org. Release management uses versions as deployment artifacts — rollback means installing the previous version.
🏗️ Architecture Points
Promoted versions cannot be deleted — immutability guarantees | Package dependencies: version compatibility enforced at install time | Rollback: install previous package version | Subscriber upgrade: Salesforce migrates metadata on install | Semantic versioning: major = breaking changes, minor = new features, patch = bug fixes
🏢 XYZ Company Example
At XYZ Company (ISV product), when version 3.4.0 had a critical bug, subscribers installed 3.3.2. Clear rollback communication. No ambiguity about what to revert to. Package versioning made rollback a simple install operation.
🎤 "Package versions provide immutable deployment artifacts with semantic versioning — enabling rollback via previous version installation and dependency enforcement that Change Set deployments cannot provide."
Q95
How do you architect automated testing for a Salesforce CI/CD pipeline?
⚡ Direct Answer
Testing layers: Code Analyzer/PMD static analysis blocking High severity, Apex tests with 85%+ coverage enforced, deployment dry-run validation in target org, manual approval gate, actual deployment.
🏗️ Architecture Points
75% coverage is the floor — enforce 85-90%+ | TestDataFactory: self-sufficient test data, no org data dependency | sf project deploy start --dry-run: validates deployment without executing — catches target org conflicts | Parallel test execution reduces pipeline time from hours to minutes
🏢 XYZ Company Example
At XYZ Company: Code Analyzer (fail on High), Apex tests (fail <85%), dry-run to QA sandbox (fail on validation errors), manual approval, deployment. Production deployment failures: 2 per month → 0 per quarter. Dry-run caught 90% of what previously failed in production.
🎤 "Salesforce CI/CD testing requires layered quality gates: static analysis, coverage enforcement, deployment dry-run, and manual approval — each gate catching failures at the cheapest possible stage before production."
Q96
What are the implications of Salesforce's test isolation model?
⚡ Direct Answer
Salesforce tests run in complete data isolation — each test method in its own rolled-back transaction, invisible to production data. This enables safe parallel execution. SeeAllData=true anti-pattern breaks this isolation and creates environment-dependent failures.
🏗️ Architecture Points
SeeAllData=true: passes in sandbox with data, fails in fresh scratch orgs — environment-dependent | @testSetup runs once per class — all methods share clean test data | Test.startTest()/stopTest(): new governor limits + processes async jobs | System.runAs() for sharing model and profile-based testing
🏢 XYZ Company Example
At XYZ Company, 40% of test classes used SeeAllData=true — passed in sandbox but failed in CI scratch orgs (no org data). Migration to TestDataFactory patterns. CI reliability: 60% pass rate → 99% pass rate.
🎤 "Salesforce test isolation ensures self-contained rolled-back transactions — SeeAllData=true breaks this isolation creating environment-dependent failures; TestDataFactory ensures consistent execution across all environments."
Q97
How do you manage Salesforce configuration drift between environments?
⚡ Direct Answer
Drift: environments diverge from ad-hoc changes, sandbox refreshes, or partial deployments. Detection: org-to-Git comparison via Gearset Snapshot or Salesforce Optimizer. Prevention: all changes through CI/CD, no direct production changes, Git as authoritative source of truth.
🏗️ Architecture Points
Golden rule: if it's not in Git, it doesn't officially exist | Drift sources: admin changes QA directly; hotfix deployed without Git commit; sandbox refresh resets manual config | Remediation: retrieve drifted metadata, compare to Git, commit the correct version | Quarterly production audit comparing production metadata to main branch
🏢 XYZ Company Example
At XYZ Company, 3 custom Account fields existed in production but not in Git. Every deployment risked overwriting them via destructive changes. Remediation: retrieved fields, committed to Git, documented. Governance: quarterly Gearset Snapshot comparing production to main branch established.
🎤 "Salesforce configuration drift is prevented by enforcing Git as the authoritative source of truth — detected via automated org-to-Git comparison, remediated by reconciling configurations back to source control."
Q98
What is the Salesforce hotfix deployment pattern?
⚡ Direct Answer
Hotfix: branch from the production tag in Git (NOT develop — develop has unreleased features), fix in scratch org, emergency UAT in Partial Copy sandbox, CCB emergency approval, deploy, merge to develop AND main, tag the deployment. Post-mortem within 48 hours.
🏗️ Architecture Points
Branch from production tag, not develop — critical to prevent deploying unreleased features | Absolute minimum change — no refactoring while in there | Rollback plan prepared BEFORE deployment | Post-mortem within 48 hours — root cause and prevention measures
🏢 XYZ Company Example
At XYZ Company, Order float precision error. Hotfix branched from v3.4.0 tag, one method fixed, 30-minute UAT with finance manager, 10-minute CCB call, deployed in 45 minutes from defect detection. Post-mortem next day: added float precision unit tests to prevent recurrence.
🎤 "Hotfix deployment branches from the production release tag (not develop) to prevent accidental feature deployment — applies minimum change with CCB approval, deploys with prepared rollback, and requires post-mortem to prevent recurrence."
Q99
How do you architect Salesforce for multiple simultaneous development streams?
⚡ Direct Answer
Parallel development: feature branching per team in Git, package-based development with team-owned packages (eliminates cross-team metadata conflicts), Integration sandbox for merged testing, component ownership matrix, and feature flags for independent activation.
🏗️ Architecture Points
SFDX source format: two teams adding different fields to same object no longer conflict in Git | Most conflict-prone: Profiles and Permission Sets — monolithic XML files | Component ownership matrix in Confluence: which team owns which metadata | Feature flags: multiple features deployed to Integration without activating prematurely
🏢 XYZ Company Example
At XYZ Company (4 parallel teams): Sales owns Opportunity/Quote, Service owns Case/Knowledge, Operations owns Order/Invoice, Platform owns shared utilities/profiles. Team needing Account field files change request to Platform team (Account owner). Clear ownership prevented most merge conflicts.
🎤 "Parallel Salesforce development requires component ownership matrices, SFDX source format enabling granular merges, package-based team ownership, and feature flag isolation — preventing teams from simultaneously modifying the same metadata."
Q100
How does Salesforce Code Analyzer enforce architectural quality?
⚡ Direct Answer
Salesforce Code Analyzer (PMD for Apex, ESLint for LWC) enforces quality rules via static analysis. Architecturally critical rules: SOQL injection detection, missing FLS enforcement, SOQL in loops, DML in loops, hardcoded IDs, God classes.
🏗️ Architecture Points
SOQL injection: PMD flags dynamic SOQL string concatenation without String.escapeSingleQuotes() | FLS: identifies Apex querying without WITH SECURITY_ENFORCED | Pipeline gate: sf scanner run --severity-threshold 2 fails CI on High severity | Custom PMD rules for org-specific naming conventions
🏢 XYZ Company Example
At XYZ Company, first Code Analyzer run: 847 findings — 12 High (8 SOQL injection, 3 FLS gaps, 1 hardcoded Record Type ID). All 12 High fixed before next sprint. Pipeline configured to fail on High. 6 months later: 847 findings reduced to 23 (all Low severity).
🎤 "Salesforce Code Analyzer enforces quality gates detecting SOQL injection, FLS gaps, and performance anti-patterns — integrated as a CI/CD failure condition on High severity findings that prevents vulnerable code from reaching production."
📊

Scalability, Gov Limits & Performance

Q101–Q115 · The difference between demo-ware and production-grade

Q101
How do you architect a Salesforce solution for processing 10 million records?
⚡ Direct Answer
10M record processing requires Batch Apex as the foundation. Architecture: Scope size calculated to stay within governor limits (typically 200 records/batch for complex logic, up to 2,000 for simple field updates). Database.QueryLocator in start() for up to 50M records. Stateful interface for cross-batch accumulation. Chained Batch jobs for multi-stage processing. Fan-out pattern: one batch spawns multiple parallel batches for independent processing.
ScaleArchitectureProcessing Time
< 10K recordsQueueable or single BatchMinutes
10K - 1M recordsBatch Apex, scope 200Hours
1M - 10M recordsBatch + Parallel fan-outHours (parallel)
10M+ recordsBatch + External processing (Heroku/MuleSoft)Hours to days
🏗️ Architecture Points
Database.QueryLocator vs Database.Iterable: QueryLocator supports up to 50M records with cursor-based chunking; Iterable limited to 50K rows (SOQL limit) | Stateful Batch: implement Database.Stateful to maintain aggregate state across batch chunks (counts, totals) — without it each execute() is stateless | Batch Apex time limit: each execute() has 60 seconds CPU — complex logic per record must stay well within | Platform capacity: Salesforce's async infrastructure limits actual throughput — very large batches may run slower than expected | External processing: for transformations beyond Salesforce platform capability, stream data to Heroku or external compute
🏢 XYZ Company Example
At XYZ Company (data migration context), migrating 8M historical customer records from legacy CRM to Salesforce. Architecture: Batch Apex with Database.QueryLocator, scope 500 records, Stateful for migration progress tracking. Parallel fan-out: three simultaneous Batch jobs (Accounts, Contacts, Opportunities) running concurrently within the 5-job limit. Total processing time: 11 hours for 8M records. Pre-migration: Bulk API 2.0 loaded raw data into staging custom objects. Batch Apex then transformed and upserted to final objects.
📌 For Interviewer
Scope size calculation is a practical architect skill — show the math | Stateful vs non-stateful distinction is frequently tested | Fan-out pattern for parallel processing shows advanced Batch Apex architecture
🎤 "10M+ record processing in Salesforce requires Batch Apex with Database.QueryLocator, carefully calculated scope sizes to stay within governor limits, Stateful interface for cross-chunk aggregation, and parallel fan-out pattern for multi-object processing — with external compute for transformations exceeding platform capability."
Q102
How does the Platform Cache architecture reduce SOQL consumption and improve performance?
⚡ Direct Answer
Platform Cache provides two in-memory partitions: Org Cache (shared, persists across transactions up to 24 hours) and Session Cache (per-user session, up to 8 hours). Architects implement the cache-aside pattern: check cache on every request → cache hit returns data immediately; cache miss queries Salesforce and populates cache. The result: expensive SOQL queries that previously ran thousands of times per day run once per cache period.
🏗️ Architecture Points
Cache key design: hierarchical keys prevent collision — 'Pricing.v1.Territory.NORTH' is safer than 'North' | Cache partitioning: separate cache partitions (Setup) for different functional areas — pricing, permissions, configuration | Cache miss handling: graceful degradation if cache is unavailable — fallback to SOQL | Cache invalidation: scheduled rebuild (Apex job), event-driven rebuild (Platform Event subscriber), or manual clear (admin action via custom UI) | Cache capacity monitoring: Apex.OrgCachePartition.getCapacity() — alert when >80% full to prevent evictions | Platform Cache is NOT shared between sandboxes and production
🏢 XYZ Company Example
At XYZ Company, pricing calculation LWC queried 3,000 Pricebook entries on every product search. 500 sales reps × 50 searches/day = 25,000 SOQL queries/day just for pricing. Platform Cache implementation: Batch Apex rebuild cache nightly (off-peak), Org Cache stored pricing Map (product code → price). SOQL queries for pricing: 25,000/day → 1/day (nightly rebuild). API consumption reduced by 99.99% for pricing queries. Sales reps experienced search response improvement from 1.8 seconds to 120ms.
📌 For Interviewer
The cache-aside pattern is the implementation architecture to name explicitly | Cache invalidation strategy is what separates architects from developers — it's the hard part | Quantifying the SOQL reduction impact demonstrates business value of the architectural decision
🎤 "Platform Cache's cache-aside pattern reduces thousands of repeated SOQL queries to single daily executions — the architectural complexity is cache invalidation strategy: scheduled rebuild for stable data, event-driven rebuild for frequently changing data, and graceful fallback when cache is unavailable."
Q103
What makes a SOQL query non-selective and how does this affect performance at scale?
⚡ Direct Answer
A SOQL query is non-selective when it fails to limit results sufficiently using indexed fields. The Salesforce query optimizer calculates the expected result set size before execution. If the optimizer estimates >10% of total records will be returned (for standard indexed fields) or >33% (for custom indexed fields), it may choose a full table scan. In a multi-tenant shared table with 100M rows across all orgs, a full table scan for 1M rows causes severe performance degradation.
🏗️ Architecture Points
Non-selective filters: IS NULL / IS NOT NULL on large datasets, non-leading LIKE ('%value%'), OR conditions mixing indexed and non-indexed fields, formula fields in WHERE, non-indexed custom fields on objects with >1M records | Query Plan Tool (Developer Console): shows index usage before running — use in development for performance testing | The optimizer uses statistics: it estimates selectivity based on field value distribution — a WHERE Status__c = 'Active' where 90% of records are Active is non-selective even on an indexed field | Force index use: IN queries with small ID sets force index usage — can be more selective than range queries | SOQL subqueries (semi-joins): more selective than SOQL IN with Apex-collected IDs
🏢 XYZ Company Example
At XYZ Company, a sales performance report filtered: WHERE Opportunity.Stage IN ('Proposal Sent', 'Negotiation', 'Closed Won'). Three of five stages — 60% of records. Non-selective even though Stage is indexed. Query timed out at 2M records. Fix: reframe the filter — WHERE Stage NOT IN ('Prospecting', 'Closed Lost') was equally descriptive but Salesforce optimizer evaluated it differently. More importantly: the architect added Created_Quarter__c (indexed) as an additional filter — reducing scope to current quarter (8% of records). Both filters made the query selective.
📌 For Interviewer
IS NULL non-selectivity is a frequent production issue — show you know it | The 10%/33% thresholds are testable | SOQL Query Plan tool is the architect's diagnostic tool
🎤 "SOQL non-selectivity occurs when filters return >10-33% of records or use non-indexed fields — triggering full multi-tenant table scans that timeout at scale; resolution requires indexed field filters, additional date/status constraints, and query plan analysis using Developer Console's SOQL Query Plan tool."
Q104
How do you architect a Salesforce solution for record locking prevention in high-volume DML operations?
⚡ Direct Answer
Record locking occurs when multiple concurrent transactions attempt to update the same record simultaneously. Salesforce uses row-level locking — one transaction holds the lock, others wait (up to 10 seconds) then throw 'UNABLE_TO_LOCK_ROW'. Architecture patterns: (1) Async DML — move high-contention updates to Queueable/Batch; (2) Counter fields → Platform Events (avoid direct counter updates on parent records); (3) Skinny tables reduce lock duration; (4) Decompose hot records into multiple records.
🏗️ Architecture Points
Roll-up summary fields cause parent record locking — every child DML locks the parent | Anti-pattern: trigger on Order Line Item that updates Order total — 50 concurrent line item inserts = 50 threads trying to lock the same Order | Solution: Platform Event from each line item, single subscriber accumulates totals in batches | UNABLE_TO_LOCK_ROW in debug logs: the symptom of record contention | FOR UPDATE SOQL: explicitly locks records — use with caution, exposes lock duration to governor limits | Test for contention: load test with concurrent users, not sequential
🏢 XYZ Company Example
At XYZ Company, bulk order import triggered a trigger on Order_Line__c that updated Order.Total_Amount__c via DML. Importing 1,000 lines for one order simultaneously caused UNABLE_TO_LOCK_ROW exceptions for 950 of them. Architecture redesign: Order_Line__c trigger publishes LineAdded_Event__e → Platform Event subscriber batches events and updates Order total once per batch. Contention reduced from 1,000 concurrent lock attempts to 1 update per batch. Import success rate went from 5% to 100%.
📌 For Interviewer
Roll-up summary lock contention is the most common production locking issue | Platform Events as the decoupling mechanism for high-contention scenarios is the architect's solution | Load testing for contention is the only way to find this before production
🎤 "Record locking architecture prevents UNABLE_TO_LOCK_ROW exceptions by moving high-contention parent record updates to Platform Event-based batching — decoupling concurrent child record DML from parent record updates that would otherwise require simultaneous locks from dozens of threads."
Q105
How does the Apex heap size limit affect architectural decisions for large data processing?
⚡ Direct Answer
Each Apex transaction has a 6MB heap limit (synchronous) or 12MB heap limit (asynchronous). Every object instantiated in Apex consumes heap — a List of 10,000 sObjects with 50 fields can easily exceed 6MB. Architectural solutions: (1) Process records in smaller batches rather than loading all records; (2) Use only the fields needed (no SELECT *); (3) Pass IDs between methods instead of full sObjects; (4) Nullify large collections when no longer needed to free heap.
🏗️ Architecture Points
Heap calculation: each String = 2 bytes per character; each sObject field = overhead per field + value size; 10,000 Accounts with Name, Email, Phone, Address = ~10MB — exceeds sync limit | Database.Stateful and heap: stateful Batch Apex accumulates heap across execute() calls — the stateful object itself counts against per-execute heap | Pattern: accumulate only primitive types (Map) in stateful batch, not full sObjects | Nullify: explicitly set large collections to null when done — Apex GC runs immediately | Limits.getHeapSize() / Limits.getLimitHeapSize(): monitor heap usage in code for debugging
🏢 XYZ Company Example
At XYZ Company, a batch job processing Opportunity records loaded ALL related Contact records into a Map at the start. For an org with 500K Contacts (100+ fields each), the batch's start() method hit heap limit before processing a single Opportunity. Fix: load only required Contact fields (Id, Email, Phone — 3 fields instead of 100+), process Contacts in the execute() method only for the current batch scope's Opportunities, nullify the Contact map at the end of execute().
📌 For Interviewer
Heap debugging with Limits.getHeapSize() is the architect's diagnostic skill | Field selection optimization reducing heap is a practical pattern | Stateful batch heap accumulation is a subtle issue that only appears in large-scale processing
🎤 "Apex heap limits require architectural attention in data-intensive processing — select only required fields, process records in scope-appropriate batches, pass IDs rather than full sObjects between methods, and explicitly nullify large collections to prevent heap limit exceptions that only appear at production data volumes."
Q106
What are the architectural patterns for implementing Custom Metadata-based feature flags in Salesforce?
⚡ Direct Answer
Feature flags in Salesforce use Custom Metadata records to control whether a new feature is active — without a code deployment. Architecture: Feature_Flag__mdt with fields: Feature_Name__c (ExternalId), Is_Enabled__c (Boolean), Enabled_For_Profiles__c (multi-value), Rollout_Percentage__c (0-100). Apex code queries the flag before executing new logic. To disable a buggy feature in production: update the Custom Metadata record — no deployment needed.
🏗️ Architecture Points
Custom Metadata is deployable AND org-specific — ideal for environment-specific flag values | Cache the feature flag Custom Metadata in Platform Cache — avoid querying the flag on every transaction | Rollout percentage: for gradual rollouts, hash the user ID modulo 100 against the rollout percentage — deterministic, consistent per user | Profile-based flags: enable for specific profiles before org-wide rollout | Audit trail: Custom Metadata changes appear in Setup Audit Trail | Feature flag pattern also used for: A/B testing, canary releases, emergency kill switches for integrations
🏢 XYZ Company Example
At XYZ Company, the new indiaMART API v2 integration was deployed with a feature flag IS_INDIAMART_V2_ENABLED = false. After deploying, the team enabled it for the Integration Profile only (testing). After 48 hours of successful testing, rolled out to 10% (rollout percentage = 10), then 50%, then 100%. When a bug was discovered at 10%, the feature flag was set to false in 30 seconds — no deployment, no downtime, no customer impact. Total bug exposure: 30 seconds.
📌 For Interviewer
Feature flags are an architectural maturity indicator — they show understanding of safe deployment practices | Platform Cache for flag retrieval is the performance optimization | Rollout percentage with user ID hashing shows sophisticated gradual rollout thinking
🎤 "Custom Metadata feature flags provide deployment-free feature control — enabling instant production disabling of buggy features, profile-specific rollouts, and gradual percentage-based releases without Salesforce deployments, achieved by updating Custom Metadata records via Setup."
Q107
How do you architect Salesforce for sub-second page load performance?
⚡ Direct Answer
Sub-second page load architecture: @AuraEnabled(cacheable=true) for client-side Apex result caching, Platform Cache eliminating repeated SOQL, lazy loading non-visible components, pagination replacing bulk record loads, and selective SOQL fetching only needed fields.
🏗️ Architecture Points
@AuraEnabled(cacheable=true): identical calls return from cache without server round-trip | Platform Cache: expensive SOQL runs once, serves from memory for subsequent calls | Lazy loading: related lists in tabs not visible on initial load | Browser network tab: primary diagnostic tool for page load issues
🏢 XYZ Company Example
At XYZ Company, Account 360 page loading in 4.2 seconds. Browser network tab showed 6 Apex calls firing simultaneously. Optimizations: cacheable=true on 4 methods, Platform Cache eliminated 2, related lists moved to lazy-loaded tab. Result: 4.2 seconds to 0.8 seconds.
🎤 "Sub-second Salesforce page load combines @AuraEnabled caching, Platform Cache, lazy loading of non-visible components, and pagination — reducing the number and cost of server round-trips on the critical rendering path."
Q108
What are the patterns for implementing Custom Indexes in Salesforce?
⚡ Direct Answer
Custom indexes are created by Salesforce Support (not self-service). Request when: custom field used in SOQL WHERE on LDV objects (>1M records), is an integration join key, or report filters consistently slow. Fields cannot be long text, multi-select picklist, or encrypted.
🏗️ Architecture Points
Request: Salesforce Support case with object name, field name, and query patterns | Compound indexes: two fields together — more selective than individual indexes | After creation: verify usage via SOQL Query Plan tool in Developer Console | 33% selectivity limit still applies even with index
🏢 XYZ Company Example
At XYZ Company, Territory__c filter on 1.2M Account records timed out in reports. Support case with query pattern and record count. Index created in 3 business days. Report time: timeout to 8 seconds. Compound index on (Territory__c, RecordTypeId) reduced to 2.1 seconds.
🎤 "Custom indexes require a Salesforce Support case — Salesforce creates and maintains them transparently, enabling selective queries on LDV custom fields that would otherwise trigger full table scans."
Q109
How does the Salesforce query optimizer decide execution strategy?
⚡ Direct Answer
The optimizer analyzes WHERE clause predicates, evaluates available indexes, estimates result set size per predicate, selects the most selective index or falls back to full table scan, then executes. The Developer Console Query Plan tool exposes this decision with cost values (below 1.0 = efficient, 1.0 = full table scan).
🏗️ Architecture Points
Query Plan tool: Developer Console → Query Editor → Enable Query Plan | Cost < 1.0 = index used efficiently | NOT IN and != operators prevent index usage | IS NULL can use a null-safe index (Salesforce Support creates these) | Narrow date ranges are more selective than broad ranges
🏢 XYZ Company Example
At XYZ Company, Query Plan tool revealed TableScan cost=1.0 on a 450K-record query. WHERE Stage__c (unindexed) AND CreatedDate (indexed but 60% of records). Fix: added FiscalYear__c (custom indexed, returning 8%). New plan cost: 0.08. Query time: 45 seconds to 1.2 seconds.
🎤 "The Salesforce query optimizer selects execution strategy by evaluating predicate selectivity — the Developer Console Query Plan tool enables architects to diagnose non-selective queries and reformulate filters for sub-1.0 cost execution plans."
Q110
What are the architectural considerations for Salesforce storage optimization?
⚡ Direct Answer
Storage optimization: Data Storage (record archival via Big Objects or external systems, retention policies, orphaned record cleanup) and File Storage (Files Connect to S3/SharePoint for large files, file size limits, draft ContentVersion cleanup). Proactive monitoring at 80% prevents business disruption.
🏗️ Architecture Points
ContentDocument large files: single file can be hundreds of MB — file size policy needed | Draft ContentVersion accumulates — implement cleanup job | Files Connect: large files stored in SharePoint/S3, accessed via Salesforce UI | Salesforce emails at 90% — monitor at 80% proactively
🏢 XYZ Company Example
At XYZ Company, storage reached 85%. Analysis: ContentDocument = 68% (large CAD drawings). Actions: Files Connect to SharePoint for files >10MB, batch migration of existing large files, automated draft ContentVersion cleanup, 5-year Opportunity retention policy. Storage: 85% to 31% in 60 days.
🎤 "Salesforce storage optimization targets records (retention + Big Object archival) and files (Files Connect + version cleanup) — proactive 80% capacity monitoring prevents reaching the storage limit that blocks all record creation."
Q111
How does Salesforce implement Async SOQL for Big Object aggregation?
⚡ Direct Answer
Async SOQL processes queries asynchronously against Big Objects — aggregating results into Custom Objects for reporting. Submitted via REST API, runs in background, writes to a target Custom Object when complete. Handles volumes exceeding all standard SOQL limits.
🏗️ Architecture Points
Submission: POST to /services/data/vXX.0/async-queries with SOQL body | Monitor via GET on returned job URL | Result target: Custom Object — architect designs the result schema | Not all SOQL clauses supported | No JOIN across Big Objects and standard objects in single query
🏢 XYZ Company Example
At XYZ Company, 1.2 billion API call logs in a Big Object needed daily aggregation into hourly summaries. Standard SOQL impossible. Async SOQL submitted nightly at 2 AM → aggregated 1.2B records → wrote totals to API_Usage_Summary__c. Morning reports read from the Custom Object. Billion-scale reporting made practical.
🎤 "Async SOQL aggregates Big Object data asynchronously via REST API — writing summarized results to Custom Objects, bridging Big Objects' limited query capability with Salesforce's reporting and analytics layer."
Q112
What are the governor limit implications of complex multi-object Flows?
⚡ Direct Answer
Complex Flows consume governor limits from the triggering transaction's shared pool. Each Get Records element uses one SOQL query. A loop with a Get Records inside is the Flow equivalent of SOQL in a trigger loop — the critical performance anti-pattern.
🏗️ Architecture Points
Loop with nested Get Records: 100 loop iterations = 100 SOQL queries | Flow SOQL accumulates with Apex in same transaction | Sub-flows run in same governor context as parent | Flow debug mode shows governor limit consumption — use it for performance analysis | Before-save Flows: no DML limits for triggering record (in-memory)
🏢 XYZ Company Example
At XYZ Company, Flow iterated 50 related Quotes with a Get Records inside the loop. Bulk update of 10 Opportunities: 10 × 50 = 500 SOQL queries → exceeded 100-query limit → 8 of 10 Opportunities failed. Fix: moved to Apex using Maps (2 SOQL total for all Quotes and all QuoteLineItems).
🎤 "Complex Flows consume shared governor limits — loop-with-nested-Get-Records is the critical anti-pattern requiring Map-based Apex replacement when loop count approaches governor limit boundaries."
Q113
How does the Salesforce concurrent request limit affect enterprise architecture?
⚡ Direct Answer
Salesforce limits concurrent long-running requests (>5 seconds) to 10 per org. If 10 are running, an 11th gets a 503 error. Architecture: schedule complex reports for off-peak execution with email delivery, use Dynamic Dashboards that refresh overnight, and implement async report execution patterns.
🏗️ Architecture Points
10 concurrent long-running request limit: entire org combined — all users share | Complex reports run simultaneously by many users is the common trigger | Apex callout timeout: slow external system holds a slot for up to 120 seconds | Lightning async report execution: complex reports show 'Processing' instead of waiting
🏢 XYZ Company Example
At XYZ Company, month-end: 50 reps ran pipeline reports at 9 AM. 10 ran; 40 got 503 errors. Fix: schedule reports at 6 AM with email delivery, Dynamic Dashboards refreshed overnight, manager reports via Async Report API. 503 errors reduced from 40 to zero.
🎤 "Salesforce's 10-concurrent-long-running-request limit creates enterprise bottlenecks during peak usage — resolved by moving complex reports from interactive execution to scheduled background processing with email delivery."
Q114
How do you govern API limits across multiple Salesforce integration partners?
⚡ Direct Answer
Multi-partner API governance: dedicated Connected Apps per partner with Event Monitoring consumption tracking, Bulk API migration for mass operations (exempt from REST limits), Platform Events/CDC replacing polling, and middleware rate limiting enforcing per-partner quotas before calls reach Salesforce.
🏗️ Architecture Points
API Limit monitoring by Connected App: Event Monitoring shows calls per Connected App — identify top consumers | Bulk API not counted against REST limits — biggest architectural reallocation | Platform Events: zero polling API consumption, events fire only on data changes | MuleSoft rate limiting: enforce partner quotas at middleware before Salesforce is hit
🏢 XYZ Company Example
At XYZ Company, 3 partners shared 15K daily API calls. ERP consumed 80% during month-end, throttling others. Governance: ERP to Bulk API (exempt), Marketing replaced polling with CDC (zero polling calls), Analytics given 20% quota enforced via MuleSoft policy. API consumption disputes resolved with Event Monitoring data.
🎤 "Multi-partner API governance requires Connected App consumption monitoring, Bulk API for mass operations, CDC replacing polling, and middleware rate limiting to enforce partner quotas before exhausting the shared daily allocation."
Q115
How do Salesforce's query row and report row limits affect architecture?
⚡ Direct Answer
SOQL: 50K rows synchronous, 50M via Batch QueryLocator. Reports: 2,000 rows displayed; 200 rows in dashboard components. Solutions: Report Exports (200K CSV), CRM Analytics for million-row aggregations, Batch Apex pre-aggregation into Custom Objects without additional licensing.
🏗️ Architecture Points
Summary reports: aggregate millions into group rows — 2K limit applies to grouping rows, not underlying records | CRM Analytics (CRMA): processes 100M+ row datasets | Report export to CSV: up to 200K rows | Batch pre-aggregation: no additional license, nightly job writes to Custom Object
🏢 XYZ Company Example
At XYZ Company, finance needed revenue for 45K accounts — exceeding the 2K display limit. Options: CSV export (manual), CRM Analytics (license cost), Batch aggregation to Custom Object (no additional license). Chose Batch: nightly aggregation to Custom Object, finance reports from it each morning.
🎤 "Salesforce report display limits require architectural workarounds — CSV exports for 200K rows, CRM Analytics for millions, and Batch Apex pre-aggregation into Custom Objects for complex reporting without additional licensing."
🏆

Enterprise & Solution Architecture Patterns

Q116–Q125 · Where architects are made or broken

Q116
How does the Apex Enterprise Patterns (fflib) implement Service, Domain, and Selector layers?
⚡ Direct Answer
fflib (FinancialForce Apex Enterprise Patterns) implements: Selector layer — SOQL queries encapsulated in SObjectSelector subclasses (reusable, testable, enforceable FLS/sharing); Domain layer — business rules and logic on SObject collections in SObjectDomain subclasses (trigger handlers, validation); Service layer — use case orchestration calling Domain and Selector, the transaction boundary. Separation of concerns — no SOQL in triggers, no business logic in controllers.
LayerResponsibilityBase Class
SelectorAll SOQL queriesfflib_SObjectSelector
DomainBusiness rules on SObject listsfflib_SObjectDomain
ServiceUse case orchestrationPlain Apex class
ApplicationFactory for selectors/domainsfflib_Application
🏗️ Architecture Points
Trigger → Domain (thin trigger calls Domain.onAfterInsert()) → Service (Domain calls Service for cross-object logic) → Selector (Service calls Selector for SOQL) | Unit testing: mock Selectors return fake data, test Domain and Service in isolation without SOQL | Application factory: Application.Selector.newInstance(Account.sObjectType) — enables mocking in tests | fflib is not a Salesforce standard — it's an open-source pattern. Architect must evaluate adoption cost vs benefit | Large orgs with many developers benefit most from fflib's enforced structure
🏢 XYZ Company Example
At XYZ Company, an unstructured org had SOQL in triggers, triggers in controller classes, and business logic scattered everywhere. Migrating to fflib: AccountsSelector (all Account queries), AccountsDomain (validation, cascade logic), OpportunitiesService (cross-object use case orchestration). After migration: the average time to locate the code responsible for a bug dropped from 45 minutes to 5 minutes. Enforced architecture made the org navigable.
📌 For Interviewer
fflib pattern shows enterprise-grade architecture knowledge | Unit testing with mocked Selectors is the testing architecture benefit | The 'separation of concerns' argument is the core justification
🎤 "The Apex Enterprise Patterns (fflib) enforce separation of concerns through distinct Selector (SOQL), Domain (business rules), and Service (use case orchestration) layers — making large Salesforce codebases testable, navigable, and maintainable across multiple development teams."
Q117
How do you architect a multi-org Salesforce landscape and when is it justified?
⚡ Direct Answer
Multi-org architecture uses multiple Salesforce orgs for different business units, geographies, or use cases. Justified when: strict data isolation requirements (regulated industries, joint ventures), acquired companies with incompatible data models, performance isolation for extreme LDV, or different release cadences for different business units. The integration hub connects orgs — via Platform Events, REST API, or middleware like MuleSoft.
PatternUse CaseChallenge
Hub-and-SpokeMaster org + satellite orgsComplex data sync
FederatedIndependent orgs, shared SSOReporting across orgs
HierarchicalGlobal + regional orgsRoll-up reporting
🏗️ Architecture Points
Salesforce-to-Salesforce Connect (Salesforce Connect cross-org adapter): surface one org's data in another as External Objects — no data duplication | Connected App with JWT Bearer: org-to-org authentication | Cross-org reporting: Salesforce Reports cannot span orgs — external analytics (Tableau, Snowflake) needed | The cost of multi-org: 2× licensing, 2× administration, complex integration — often the wrong architectural choice | When to consolidate vs maintain multi-org: regulatory requirements and acquisition integration timelines are the two valid reasons to delay consolidation
🏢 XYZ Company Example
At XYZ Company (India + Belgium + USA operations), Belgium operated under strict GDPR data residency — EU customer data could not be stored in the same org as non-EU data. Architecture: Belgium org (EU Hyperforce region), Global org (non-EU operations). MuleSoft integration hub synced non-personal data (product catalog, pricing, aggregate reporting) between orgs. Personal contact data stayed geo-restricted. Reporting: Tableau connected to both orgs for consolidated executive dashboards.
📌 For Interviewer
Multi-org is a controversial recommendation — show you know the costs | Data residency is the strongest justification in 2026 | Salesforce-to-Salesforce integration via Connected App is the implementation mechanism
🎤 "Multi-org architecture is justified primarily by strict data isolation requirements — regulatory data residency, acquired company integration timelines, or extreme performance isolation — with the integration complexity and doubled administrative overhead as significant architectural trade-offs against single-org consolidation."
Q118
What is the architectural approach to Salesforce disaster recovery and business continuity?
⚡ Direct Answer
Salesforce DR architecture: Salesforce provides 99.9% uptime SLA with its own multi-region infrastructure — not customer-configurable. Customer DR responsibilities: (1) Data backup via scheduled Salesforce data export or third-party backup tools (OwnBackup, Veeam); (2) Configuration/metadata backup via SFDX retrieve to Git; (3) Business continuity: offline capability via Salesforce Mobile SmartStore; (4) Recovery procedures: data restore processes tested quarterly.
🏗️ Architecture Points
Salesforce Trust (trust.salesforce.com): real-time Salesforce infrastructure status — architect must monitor this during incidents | Salesforce Backup & Restore (native): Salesforce's first-party backup solution — available as an add-on | Third-party backup: OwnBackup, Spanning, Veeam for more granular recovery options (record-level restore) | Metadata backup: Git is your metadata disaster recovery — all configuration in source control | RTO (Recovery Time Objective) and RPO (Recovery Point Objective): agree these with business before designing backup frequency | Undelete via Recycle Bin: records persist 15 days in recycle bin — first-line data recovery before backup restore
🏢 XYZ Company Example
At XYZ Company, a mass data deletion incident (admin accidentally deleted 50,000 Account records) was recovered in 3 steps: (1) Recycle Bin restore of 48,000 recently-deleted records (2 minutes), (2) OwnBackup restore of the 2,000 that had passed the 15-day recycle bin window (45 minutes), (3) Post-incident: implemented Data Management policies preventing bulk deletion without secondary approval. Business impact: 47 minutes of data unavailability. Without backup tooling, the 2,000 permanently deleted records would have required recreating from source documents.
📌 For Interviewer
Salesforce manages infrastructure DR — customer manages data DR | Recycle Bin as the first recovery mechanism shows practical knowledge | RTO/RPO discussion shows enterprise governance maturity
🎤 "Salesforce disaster recovery architecture separates platform DR (Salesforce-managed multi-region infrastructure) from data DR (customer-managed via scheduled exports, third-party backup tools, and Git-based metadata backup) — with Recycle Bin providing the first 15-day recovery window before backup restoration is required."
Q119
How do you evaluate technical debt in a Salesforce org and design a remediation roadmap?
⚡ Direct Answer
Technical debt assessment framework: (1) Code quality: Apex code with >5 code smell patterns (God classes, triggers with business logic, no error handling, hardcoded IDs, 0% coverage); (2) Configuration debt: Workflow Rules and Process Builder (deprecated), deeply nested Flows with no error handling; (3) Data model debt: many-to-many via junction objects that could be normalized, formula field overuse; (4) Integration debt: point-to-point integrations, hardcoded credentials, no retry logic; (5) Security debt: @without sharing overuse, overpermissioned profiles.
🏗️ Architecture Points
Technical debt scoring: assign debt severity (critical/high/medium/low) and remediation effort (high/medium/low) — prioritize high-severity, low-effort items first | Org scanner / Salesforce Code Analyzer: automated static analysis identifies common debt patterns | Workflow Rule migration: Salesforce has announced Workflow Rule retirement — mandatory migration to Flows | Technical debt backlog: maintain as explicit backlog items in the project management tool, not as 'known issues' | The business case for debt remediation: quantify the cost of maintaining debt (slower development, more bugs) vs remediation investment
🏢 XYZ Company Example
At XYZ Company, an org health assessment revealed: 87 Workflow Rules (retirement pending), 12 Apex triggers with business logic (no handler pattern), 3 processes using hardcoded org-specific IDs, and 15 integration points using Username-Password OAuth. Remediation roadmap: Q1 — migrate 87 Workflow Rules to Flows (tooling available from Salesforce); Q2 — refactor top 5 most-modified triggers to handler pattern; Q3 — migrate integrations to JWT Bearer OAuth; Q4 — remove hardcoded IDs to Custom Metadata. 12-month planned remediation with business justification for each quarter.
📌 For Interviewer
Technical debt framing as a business risk (retirement of Workflow Rules is an imminent compliance issue) is more effective than purely technical arguments | Org Scanner as the assessment tool shows platform knowledge | Prioritization matrix (severity × effort) is the architect's decision framework
🎤 "Salesforce technical debt remediation requires systematic assessment across code quality, deprecated automation, data model efficiency, integration patterns, and security architecture — prioritized by business risk (regulatory compliance for deprecated features) and remediation ROI, executed as a planned backlog rather than ad-hoc cleanup."
Q120
What are the architectural trade-offs between declarative and programmatic solutions at enterprise scale?
⚡ Direct Answer
At enterprise scale, the declarative vs programmatic trade-off introduces additional dimensions: (1) Maintainability: Flows are maintainable by admins but can become debugging nightmares at 500+ elements; (2) Performance: complex Flows have more overhead than equivalent Apex; (3) Testing: Apex has robust unit test framework, Flow testing is limited; (4) Governance: Flow metadata is harder to review in code review; (5) Versioning: Flow versioning requires explicit activation, Apex auto-versioned via Git.
DimensionDeclarative (Flow)Programmatic (Apex)
Admin maintainableYes (trained admins)No
Unit testingLimitedRobust
Code reviewDifficult (XML)Standard PR process
PerformanceSlightly slowerFaster
Debug toolsFlow debug modeDebug logs, replay debugger
🏗️ Architecture Points
The 'declarative first' principle scales to medium complexity — at enterprise scale, architect must set thresholds | Threshold examples: Flow with >50 elements → evaluate Apex; Flow with >3 decision branches on same field → evaluate Apex | Hybrid pattern: Flow orchestrates, Apex executes — best of both worlds | Enterprise governance: require architectural review for any Flow touching more than 2 objects | Flow naming and version management: critical at enterprise scale with 100+ Flows — implement a naming convention standard
🏢 XYZ Company Example
At XYZ Company (scaling from 5 to 50 Flows), the architecture committee established: Flows for simple single-object field updates and email notifications (maintainable by admin team), Apex for cross-object logic touching more than 2 related objects, complex validation, or requiring external callouts. The 'Flow under 30 elements' rule of thumb prevented over-complex Flows while preserving admin maintainability for simple automation. Technical debt review: any Flow over 30 elements was flagged for architect review.
📌 For Interviewer
'Declarative first' has a scale boundary — showing you know WHERE that boundary is differentiates architects | Hybrid pattern with Invocable Apex is the enterprise pattern | Governance of Flows (naming, review, element limits) is often overlooked
🎤 "Declarative-first architecture has an enterprise scale boundary — Flows exceeding ~30 elements become difficult to debug, review, and version; at scale, the hybrid pattern (Flow orchestration with Invocable Apex execution) and explicit governance thresholds for when to switch to programmatic solutions maintain both admin accessibility and engineering quality."
Q121
How do you architect Salesforce for a company going through M&A?
⚡ Direct Answer
M&A options: keep separate orgs (fastest, complex integration), merge into one org (best long-term, 12-24 months), or hub-and-spoke (master for reporting, satellites for operations). Decision driven by data overlap, regulatory requirements, and timeline.
🏗️ Architecture Points
Org merge complexity increases with the acquired company's Salesforce footprint | Namespace conflicts: both orgs may have same field API names — requires remapping | Duplicate records: deduplication before migration critical | Interim integration via REST API or Platform Events during transition | Realistic timeline: large org merge = 12-24 months
🏢 XYZ Company Example
At XYZ Company acquiring Belgium subsidiary: both had Salesforce orgs. Decision: separate orgs for 18 months (GDPR data residency), then merge. Interim: Salesforce Connect cross-org adapter for product catalog, MuleSoft for customer sync. Full migration: 50K Accounts via Bulk API with field remapping, 12K Users via unified SSO.
🎤 "M&A Salesforce architecture requires choosing between parallel orgs with integration, hub-and-spoke consolidation, or full merge — with regulatory requirements and realistic 12-24 month timelines for enterprise Salesforce integration."
Q122
What is the architectural approach to Salesforce production performance monitoring?
⚡ Direct Answer
Production monitoring stack: Event Monitoring (API usage, Apex execution, page load times via Event Log Files), Apex Exception Email for unhandled exceptions, Event Log File API integration with Splunk/Datadog for enterprise observability, and Salesforce Optimizer quarterly.
🏗️ Architecture Points
Event Log Files: 30+ event types, daily logs via REST API download | Event Monitoring license required for most event types | ApexExecution event: CPU time and DML per transaction — identifies slow code | Page Load Time event: Lightning page render times per user | Alert at thresholds: API >85%, Apex exception rate >10/hr, P95 page load >4 seconds
🏢 XYZ Company Example
At XYZ Company: daily Event Log File extraction to Splunk, dashboards for API consumption, slow Apex, page load percentiles. PagerDuty alerts on threshold breaches. Performance incidents detected 3 hours before users reported them — proactive vs reactive monitoring.
🎤 "Production Salesforce monitoring requires Event Monitoring for API and Apex telemetry, Event Log File API integration with external observability platforms, and threshold alerting — enabling proactive incident detection before users experience degradation."
Q123
How do you architect Salesforce for accessibility and ADA compliance?
⚡ Direct Answer
Lightning Experience is built with WCAG 2.1 AA compliance. Custom LWC must maintain this: semantic HTML (button not div), ARIA labels on interactive elements, color not the only meaning indicator, text alternatives for images. Standard components are pre-compliant — custom HTML bypasses these guarantees.
🏗️ Architecture Points
LWC: interactive elements must be keyboard-accessible; ARIA labels on custom elements; focus management for modal dialogs | Color contrast: minimum 4.5:1 ratio for normal text | Screen reader testing: NVDA/JAWS on Windows, VoiceOver on Mac | axe DevTools browser extension for automated checks | ADA lawsuits against enterprise software increasing — legal requirement not nice-to-have
🏢 XYZ Company Example
At XYZ Company (federal contractor requiring ADA compliance): audit found 3 LWC using div+onClick instead of button (keyboard inaccessible), 2 with insufficient color contrast, 1 modal without focus trap. All 6 remediated in one sprint. Quarterly accessibility review established in the release process.
🎤 "Salesforce ADA compliance requires semantic HTML, ARIA labeling, WCAG color contrast, and keyboard navigation in all custom LWC — standard components are pre-compliant but custom components require explicit accessibility testing and quarterly governance review."
Q124
What are the trade-offs between Salesforce Shield and third-party security solutions?
⚡ Direct Answer
Shield (native): Platform Encryption (AES-256 field-level at rest), Event Monitoring (detailed audit trail), Field Audit Trail (10-year history). Third-party CASB/SIEM: cross-platform visibility across Salesforce + email + SharePoint — broader coverage but latency from batch export. Both complement, not compete.
🏗️ Architecture Points
Shield encryption limitations: cannot encrypt fields in formulas, rollup summaries, or standard report filters (unless deterministic) | Shield Field Audit Trail: 10-year history vs standard 18-month | CASB: intercepts API traffic, enforces DLP policies across all SaaS platforms | Regulated industries: Shield for Salesforce-specific compliance; CASB for enterprise-wide DLP
🏢 XYZ Company Example
At XYZ Company financial services division, regulators required 7-year audit trail. Shield Field Audit Trail: native, 10 years, no export complexity. CASB separately for cross-platform DLP (Salesforce + SharePoint + email). Complementary architecture — not either/or.
🎤 "Shield provides native field-level encryption and 10-year audit trails within Salesforce; third-party CASB provides multi-platform DLP — complementary solutions with the choice driven by whether the primary risk is Salesforce-specific or enterprise-wide."
Q125
What is the architect's responsibility in Agentforce AI implementation?
⚡ Direct Answer
Architect's role: (1) Data quality governance before AI goes live; (2) Agent User security profile with least-privilege permissions; (3) Topic design — what the agent handles; (4) Guardrails — what it CANNOT do (financial commitments, data deletion); (5) Human escalation architecture for high-risk decisions; (6) Audit trail for all agent interactions.
🏗️ Architecture Points
Agent User profile: least-privilege — Read-only where possible, no Create/Delete without explicit justification | Data quality: AI output quality = Salesforce data quality — audit before go-live | Guardrails: define explicitly what topics and actions are out of scope for the agent | Human escalation: when agent confidence < threshold, create Case for human rep | Agentforce Actions: each Apex/Flow action needs explicit permission model review
🏢 XYZ Company Example
At XYZ Company Agentforce for order inquiries: Agent User — Read-only on Orders/Accounts/Products; Topics — Order Status, Delivery, Product Info (NO pricing negotiation or refund approval — human-only); Escalation: confidence <70% → Case creation; Audit: all conversations logged to AI_Conversation__c; 23% of Orders had missing tracking numbers — data quality fixed before go-live.
🎤 "The Salesforce architect's Agentforce responsibility spans data quality governance, least-privilege agent security profile, topic and guardrail design, audit trail implementation, and human escalation architecture — ensuring AI augments rather than bypasses the organization's security and governance framework."

sfinterviewpro.com

1,400+ Salesforce interview questions. 3 free courses. Architect-level content. Always free.

All Topics Free Courses