Ask Krrish Contact
Home
Developer & Admin
Apex Triggers Mastery Asynchronous Apex SOQL & SOSL Governor Limits Flows & Process Builder
Advanced Topics
LWC Essentials Security & Sharing Managed Packages Deployment & CI/CD Integration Patterns
Interview Prep
Practice interview questions Explore Interview Prep
Resources
Sales Cloud Class Diagram 2GP Managed Packages
Blog
Available Now
Debug Log Analyzer SFX Forge New SFX Grove SFX Travel Manager
Salesforce + AI
AI Agent Development Salesforce Agentforce Development Custom RAG Solutions AI + Salesforce Integration Customer Support AI Agents AI Lead Qualification AI Knowledge Base Assistant AI Workflow Automation
Salesforce work
Issue Fix Sprint Automation Sprint LWC & integrations Overflow support for partners Agentforce & AI usage review All services →
About Ask Krrish Contact

Interview prep with AI practice

Salesforce interview questions, by role and years of experience.

Questions interviewers ask Salesforce admins, developers and Agentforce / AI engineers, from freshers to 10+ years. Each one has a short answer, what the interviewer wants to hear and a likely follow-up. Type your own answer, check it against the key points, then have Ask Krrish grade it like an interviewer.

48 questions 13 topics Fresher · 2–4 yrs · 5+ yrs Admin · Developer · AI / Agentforce
Experience
Role
Topic

Salesforce interview questions and answers

Showing all 48 questions

What are governor limits in Salesforce and why do they exist?

ApexFresher

Governor limits are runtime caps Salesforce enforces per Apex transaction because orgs share servers (multitenancy). The common ones are 100 SOQL queries (200 in Batch, Queueable and future Apex), 150 DML statements, 50,000 rows returned by SOQL and 10,000 rows processed by DML. Exceeding one throws System.LimitException, which cannot be caught.

What the interviewer wants to hear

  • Multitenancy is the reason
  • Limits are per transaction, sync vs async values differ
  • LimitException can't be caught, so design to avoid it
  • Use the Limits class to check usage

Likely follow-up

How would you find which limit is close to failing in a long transaction?

Why should you never put SOQL or DML inside a for loop?

ApexFresher

Each iteration runs a separate query or DML statement, so a loop over 200 records can exceed the 100-SOQL or 150-DML limit and throw a LimitException. Query once before the loop into a Map or Set, collect changes in a List inside the loop, and do one DML after it.

What the interviewer wants to hear

  • Ties the problem to per-transaction limits
  • Shows the Map/Set pattern
  • Single DML on a List after the loop

Likely follow-up

Rewrite a loop that queries the Account for each Contact.

What is the difference between with sharing, without sharing and inherited sharing?

Apex2–4 yrs

For system-mode database operations, with sharing enforces the user's record sharing, without sharing ignores it and inherited sharing follows the caller. They don't enforce object or field permissions (and queries on Pricebook2 ignore sharing). User-mode operations (WITH USER_MODE, AccessLevel.USER_MODE) enforce sharing, object and field permissions regardless of the class keyword.

What the interviewer wants to hear

  • Sharing keywords cover record access only
  • with sharing by default; inherited sharing only for classes safe in both modes
  • CRUD/FLS needs USER_MODE or stripInaccessible

Likely follow-up

A class has no sharing keyword. What mode does it run in?

What code coverage does Salesforce require and what makes a good test class?

ApexFresher

With the default test levels, production needs at least 75% overall Apex coverage and every trigger needs some coverage; with RunSpecifiedTests, each deployed class and trigger needs 75%. Good tests create their own data (or use @testSetup), run the logic inside Test.startTest/stopTest, cover bulk, negative and permission cases and assert results with System.assertEquals or the Assert class.

What the interviewer wants to hear

  • 75% rules per test level; a minimum, not the goal
  • Own test data; avoid SeeAllData=true
  • Bulk and negative tests
  • Real assertions, not just coverage

Likely follow-up

What does Test.startTest() actually reset?

How do you handle errors in Apex so one bad record doesn't fail the whole batch?

Apex2–4 yrs

Use Database.insert/update with allOrNone set to false, then loop the SaveResult array and log or report the failed rows. Wrap callouts and risky logic in try/catch, catch specific exceptions first, and use addError on trigger records to show a clear message instead of failing silently.

What the interviewer wants to hear

  • Database methods with allOrNone=false
  • Inspect SaveResult errors
  • addError for user-facing validation
  • Logging strategy (custom object or Platform Event)

Likely follow-up

Why publish a Platform Event for error logs instead of inserting a log record?

What are Apex trigger best practices?

TriggersFresher

One trigger per object, no logic in the trigger body (delegate to a handler class), bulkify for 200 records, no SOQL or DML in loops, use context variables like Trigger.new and Trigger.oldMap, prevent recursion, and choose before triggers for same-record field updates and after triggers when you need the record Id or touch other records.

What the interviewer wants to hear

  • One trigger per object + handler
  • Bulkification
  • Before vs after use cases
  • Recursion control

Likely follow-up

Show a handler pattern you've used.

When do you use a before trigger and when an after trigger?

TriggersFresher

Use before triggers to validate or change fields on the records being saved; changes to Trigger.new are saved without extra DML. Use after triggers when you need system values such as the record Id or CreatedDate, or when you create or update related records. Records in Trigger.new are read-only in after triggers.

What the interviewer wants to hear

  • Before: same-record updates, no DML needed
  • After: Id available, related records
  • Trigger.new is read-only after save

Likely follow-up

Why can't you update Trigger.new in an after update trigger?

How do you prevent recursive triggers?

Triggers2–4 yrs

Make the logic idempotent first. A static Boolean blocks all re-entry, including the next 200-record chunk. A narrow guard, such as a static Set<Id> per operation for records with Ids, is safer; partial-save retries keep static state, so test them. Field-change checks help but alone are not enough: on a workflow re-fire Trigger.old still holds the original values.

What the interviewer wants to hear

  • Why a static Boolean is risky
  • Static Set<Id> approach
  • Why oldMap checks alone fail on workflow re-fires

Likely follow-up

A workflow field update re-fires your trigger. What happens to your static variables?

Explain the Salesforce order of execution.

Triggers2–4 yrs

In short: system validation, before-save record-triggered flows, before triggers, custom validation rules, duplicate rules, save (not committed), after triggers, assignment and auto-response rules, workflow rules (which can re-run triggers once), escalation rules, after-save flows (API 54.0+; older ones run after entitlements), entitlement and roll-up updates, then commit and post-commit work such as emails and async jobs.

What the interviewer wants to hear

  • Before-save flows run before before triggers
  • Validation rules after before triggers
  • Record saved but not committed for after triggers
  • Commit happens last; async runs after commit

Likely follow-up

Where do before-save flows run compared to before triggers?

How would you design a trigger framework for a large org?

Triggers5+ yrs

A single trigger per object calls a handler that routes by context (before insert, after update and so on). Add a bypass mechanism through custom metadata or a custom permission for data loads, recursion control by record Id, and keep business logic in service classes so it can be called from Flow, batch jobs and APIs too.

What the interviewer wants to hear

  • Routing by context
  • Configurable bypass (custom metadata/permission)
  • Logic in service classes, reusable
  • Testability

Likely follow-up

How would an admin switch off one handler in production without a deployment?

What is the difference between SOQL and SOSL?

SOQLFresher

SOQL queries one object (plus related objects through relationships) when you know where the data is, like SQL SELECT. SOSL is a text search across many objects and fields at once using the search index, returning a list of lists. Use SOQL for precise filters and SOSL to find a term anywhere.

What the interviewer wants to hear

  • SOQL: one object, exact filters
  • SOSL: many objects, text search index
  • Return types differ
  • Each has its own governor limits

Likely follow-up

Which would you use for a global search box and why?

How do you query parent and child records in one SOQL query?

SOQLFresher

Child to parent uses dot notation on the relationship name, for example SELECT Name, Account.Name FROM Contact. Parent to child uses a subquery on the child relationship name, for example SELECT Name, (SELECT LastName FROM Contacts) FROM Account. Custom relationships end in __r.

What the interviewer wants to hear

  • Dot notation for parent fields
  • Subquery with plural child relationship name
  • __r suffix for custom relationships

Likely follow-up

What is the relationship name of a custom lookup Invoice__c on Account?

What makes a SOQL query selective and why does it matter?

SOQL5+ yrs

A selective query filters on an indexed field (Id, Name, lookups, external Ids, unique fields or custom indexes) and the filter returns a small enough share of rows for the optimizer to use the index. On large objects, non-selective queries in triggers fail, and they are slow everywhere. Avoid leading wildcards, negative filters and filtering on null.

What the interviewer wants to hear

  • Indexed fields
  • Threshold idea, large data volumes
  • Query Plan tool
  • Anti-patterns: != , NOT LIKE, leading %

Likely follow-up

How do you check a query's cost before deploying it?

Future vs Queueable vs Batch vs Scheduled Apex: when do you use each?

Async Apex2–4 yrs

Future: simple fire-and-forget work such as a callout from a trigger, primitive parameters only. Queueable: like future but accepts objects, returns a job Id and can chain jobs. Batch: processing very large record sets in chunks, each with fresh limits. Scheduled: running any of these at a set time.

What the interviewer wants to hear

  • Future limits (primitives, no chaining)
  • Queueable chaining and monitoring
  • Batch for large data volumes
  • Scheduled is a trigger for the others

Likely follow-up

Why can't you call a future method from a batch execute method?

How does Batch Apex work and what is the scope size?

Async Apex2–4 yrs

start returns a QueryLocator or Iterable, execute runs once per chunk with its own governor limits, and finish runs once at the end. The default scope is 200 records; with a QueryLocator you can set up to 2,000. Use Database.Stateful to keep values like counters across chunks.

What the interviewer wants to hear

  • start/execute/finish
  • Fresh limits per execute
  • Default 200, max 2,000 with QueryLocator
  • Database.Stateful

Likely follow-up

When would you lower the scope size below 200?

How do you make an HTTP callout when a record is saved?

Async Apex2–4 yrs

Callouts aren't allowed in a trigger's synchronous transaction, so hand the work to async Apex: a Queueable that implements Database.AllowsCallouts (preferred) or a future method with callout=true. Pass record Ids, re-query inside the job, and handle retries and failures. Platform Events or Flow with an async path are alternatives.

What the interviewer wants to hear

  • Why the trigger can't call out directly
  • Queueable with AllowsCallouts
  • Pass Ids, not records
  • Retry and error handling

Likely follow-up

How do you stop duplicate records if the external system retries?

What do @api, @track and @wire do in Lightning Web Components?

LWCFresher

@api makes a property or method public so a parent component can set or call it. @wire connects a property or function to a data source such as an Apex method or Lightning Data Service and re-runs when reactive parameters change. Fields are reactive by default now; @track is only needed to observe changes inside objects or arrays.

What the interviewer wants to hear

  • @api = public API, parent to child
  • @wire = reactive data
  • @track only for deep object/array changes

Likely follow-up

Can a child component change a property it received through @api?

How do Lightning Web Components communicate with each other?

LWC2–4 yrs

Parent to child: set @api properties or call @api methods. Child to parent: dispatch a CustomEvent and handle it in the parent. Between unrelated components on a page: Lightning Message Service on a message channel. Avoid pub-sub libraries in new code.

What the interviewer wants to hear

  • Properties down, events up
  • CustomEvent with detail
  • Lightning Message Service across the DOM

Likely follow-up

How would an LWC talk to an Aura component or a Visualforce page?

When do you call Apex imperatively instead of using @wire?

LWC2–4 yrs

Use @wire for read-only data that loads automatically; the Apex method must be cacheable=true. Call Apex imperatively for user-triggered calls, DML, or when you control timing. After imperative DML, call refreshApex on the wired Apex result and notifyRecordUpdateAvailable for Lightning Data Service records (both if both are used).

What the interviewer wants to hear

  • @wire needs cacheable=true and is read-only
  • Imperative for actions and DML
  • refreshApex for Apex wires, notifyRecordUpdateAvailable for LDS

Likely follow-up

Why can't a cacheable method do DML?

What are the lifecycle hooks in LWC?

LWCFresher

constructor runs first (no DOM or public properties yet), connectedCallback when the component is inserted into the DOM (good for initial data calls), renderedCallback after every render (guard it to avoid loops), disconnectedCallback when removed (clean up listeners), and errorCallback to catch errors from child components.

What the interviewer wants to hear

  • Order of hooks
  • What is available in each
  • renderedCallback can run many times

Likely follow-up

Where would you subscribe to a Lightning Message Service channel and where unsubscribe?

What types of Flow are there in Salesforce?

FlowFresher

Screen flows (guide a user through screens), record-triggered flows (run when a record is created, updated or deleted), schedule-triggered flows (run on a schedule for a batch of records), platform event-triggered flows, and autolaunched flows with no trigger, called from Apex, buttons, other flows or Agentforce actions.

What the interviewer wants to hear

  • Names each type with a use case
  • Autolaunched flows are reusable building blocks

Likely follow-up

Which type would you use for a nightly clean-up job?

What is the difference between before-save and after-save record-triggered flows?

Flow2–4 yrs

Before-save (Fast Field Updates) changes fields on the triggering record before it is saved, with no extra DML, so it is much faster. After-save (Actions and Related Records) runs after the save, so it can create or update other records, send emails and call actions, and the record Id is available.

What the interviewer wants to hear

  • Fast Field Updates = before save
  • Same-record updates should be before-save
  • After-save for related records and actions

Likely follow-up

A flow updates the same record in an after-save path. What's the problem?

When would you choose Flow over Apex, and when Apex over Flow?

Flow2–4 yrs

Choose Flow for straightforward record automation and guided screens that admins should maintain. Choose Apex for complex logic, heavy data volumes, complex collections or algorithms, callouts that need fine error handling, and code that needs proper unit tests and reuse. Many teams combine them with invocable Apex called from Flow.

What the interviewer wants to hear

  • Maintainability by admins
  • Complexity and volume push to Apex
  • Invocable Apex as the bridge

Likely follow-up

How do you call Apex from a Flow?

How do you handle errors in a Flow?

Flow2–4 yrs

Add a fault path to every element that can fail (Get, Create, Update, Delete records and actions). In the fault path, log the {!$Flow.FaultMessage} to a custom log object or send it to an admin, and show a friendly message on screen flows. Without a fault path users see a generic unhandled fault error.

What the interviewer wants to hear

  • Fault connectors
  • $Flow.FaultMessage
  • Logging and user messaging

Likely follow-up

How would you test that your fault path works?

Is Process Builder still supported? What should you do with old processes?

FlowFresher

Salesforce retired Workflow Rules and Process Builder in favour of Flow. Existing automations still run but no longer get fixes, and new Process Builder processes can't be created (developer orgs keep a narrow exception for managed-package testing). Use Migrate to Flow where it supports the process, rebuild unsupported parts by hand, then test and deactivate the old automation.

What the interviewer wants to hear

  • Flow is the strategic tool
  • Migrate to Flow where supported; rebuild the rest
  • Test then deactivate

Likely follow-up

Which old automations can't the migration tool convert?

What is the difference between a profile and a permission set?

SecurityFresher

Every user has exactly one profile, which sets baseline settings like page layouts and login hours. Permission sets add permissions on top and a user can have many. Salesforce recommends minimal profiles and granting access through permission sets and permission set groups.

What the interviewer wants to hear

  • One profile, many permission sets
  • Permission set groups
  • Minimum-access profile direction

Likely follow-up

What is a muting permission set?

Explain the Salesforce sharing model.

Security2–4 yrs

Object and field access come from profiles and permission sets. Record access starts from organization-wide defaults, then opens up through the role hierarchy, sharing rules, teams, manual and Apex sharing. Those only widen access. Restriction rules, on supported objects, do the opposite: they filter which records a user can see.

What the interviewer wants to hear

  • Object/field vs record access
  • OWD is the floor
  • Role hierarchy, sharing rules, manual/Apex sharing
  • Sharing widens access; restriction rules narrow it

Likely follow-up

A user can see a record they shouldn't. How do you find out why?

How do you write a validation rule that only fires when a field changes?

AdminFresher

Use ISCHANGED(Field__c) in the formula, combined with the condition you want to block, for example AND(ISCHANGED(Amount), Amount > 100000, NOT($Permission.Can_Approve_Large)). The rule fires when the formula returns true. ISCHANGED only works on edits, so use ISNEW() if you also need to check new records.

What the interviewer wants to hear

  • Formula true = error
  • ISCHANGED / PRIORVALUE
  • Bypass with custom permission

Likely follow-up

How would you let a data migration user bypass the rule?

What is the difference between a lookup and a master-detail relationship?

AdminFresher

In master-detail the child can't exist without the parent, inherits its sharing and owner, is deleted with it, and the parent can have roll-up summary fields. A lookup is a looser link: the child has its own owner and sharing, the field can be optional, and deleting the parent doesn't delete the child by default.

What the interviewer wants to hear

  • Ownership and sharing inheritance
  • Cascade delete
  • Roll-up summaries on master-detail

Likely follow-up

Can you convert a lookup to master-detail when some children have no parent?

What are Named Credentials and External Credentials?

Integration2–4 yrs

A Named Credential stores the endpoint URL; an External Credential stores how to authenticate (OAuth, JWT, custom headers, API key) and which users get it via a permission set mapping. Apex then calls callout:Your_Named_Credential/path and Salesforce adds the auth, so no secrets live in code and you don't need a Remote Site Setting.

What the interviewer wants to hear

  • Endpoint vs authentication split
  • Permission set principal access
  • callout: syntax, no secrets in code

Likely follow-up

How would you store an OpenAI or Claude API key for Apex?

Which integration patterns does Salesforce describe and when do you use each?

Integration5+ yrs

Request and reply (call and wait for the answer), fire and forget (send and continue, for example Platform Events or outbound messages), batch data synchronization (bulk loads with Bulk API or ETL), remote call-in (an external system calls Salesforce APIs), UI update based on data changes (streaming), and data virtualization (Salesforce Connect, no copy).

What the interviewer wants to hear

  • Names the patterns
  • Sync vs async trade-offs
  • Picks tools per pattern

Likely follow-up

An ERP needs order updates in near real time. Which pattern and tools?

What are Platform Events and Change Data Capture, and how do they differ?

Integration2–4 yrs

Platform Events are custom event messages you define and publish from Apex, Flow or APIs, for decoupled event-driven integration. Change Data Capture publishes standard change events automatically when records are created, updated, deleted or undeleted. Use CDC to sync record changes; use Platform Events for business events you design.

What the interviewer wants to hear

  • Custom events vs automatic change events
  • Subscribers: triggers, flows, CometD/Pub/Sub API
  • Replay and retention

Likely follow-up

How does an external system subscribe to these events?

Which OAuth flow would you use for a server-to-server integration?

Integration5+ yrs

For server-to-server with no user present, use the OAuth 2.0 JWT Bearer flow (certificate-signed assertion for a pre-authorized integration user) or the Client Credentials flow on an External Client App or connected app with a run-as user. Avoid the username-password flow. Give the integration user minimal permissions.

What the interviewer wants to hear

  • No interactive login
  • JWT bearer vs client credentials
  • Dedicated, least-privilege integration user

Likely follow-up

How do you rotate the certificate without downtime?

How do you stop duplicate records when an integration retries?

Integration5+ yrs

Make writes idempotent. Send a stable key from the source system and upsert on a field marked External ID and Unique, so a retry updates instead of inserting. For callouts out of Salesforce, send an idempotency key the other system can de-duplicate on, and record request status so retries skip work already done.

What the interviewer wants to hear

  • External ID + Unique field, upsert
  • Idempotency keys
  • Retry with status tracking

Likely follow-up

The external system times out but the record was created. What happens on retry?

How do you deploy changes between Salesforce orgs?

DevOps2–4 yrs

Options are change sets (simple, org-to-org, no version control), Salesforce CLI with source tracking and a Git repository (the standard for teams), unlocked or managed packages, and Salesforce release tools or a CI/CD pipeline such as GitHub Actions running sf project deploy start with tests. Use validation (check-only) deploys and quick deploy for production.

What the interviewer wants to hear

  • Change sets vs CLI + Git
  • Packages for modular delivery
  • Validate then quick deploy

Likely follow-up

Which test level would you run for a production deployment?

Unmanaged vs unlocked vs managed packages: what's the difference?

DevOps5+ yrs

Unmanaged packages are a one-time copy; the installed code can be edited and can't be upgraded. Unlocked packages are versioned and upgradable, meant for an org's own modular development. Managed packages (first or second generation, 2GP recommended) are for ISVs: namespaced, upgradable, code protected and listable on AppExchange.

What the interviewer wants to hear

  • Upgradeability
  • Who each is for
  • Namespace and IP protection

Likely follow-up

Why would an internal team choose unlocked packages over plain CLI deploys?

What is Agentforce and how is an agent built?

AgentforceFresher

Agentforce is Salesforce's platform for AI agents that understand a request, decide what to do and take actions in Salesforce. An agent is configured with topics (called subagents in newer releases: jobs it handles), instructions (rules for each topic) and actions it can run, such as Flows, Apex invocable methods, prompt templates and APIs, grounded in your Salesforce data.

What the interviewer wants to hear

  • Topics, instructions, actions
  • Reasoning engine picks topic and actions
  • Grounded in CRM data

Likely follow-up

What's the difference between a topic instruction and an action instruction?

How do you add a custom action to an Agentforce agent?

Agentforce2–4 yrs

Build the logic as an autolaunched Flow, an Apex class with an @InvocableMethod, or a prompt template, then add it as an agent action and assign it to a topic. Write clear action and input/output descriptions, because the reasoning engine uses them to decide when to call the action and what to pass.

What the interviewer wants to hear

  • Flow, invocable Apex, prompt template
  • Descriptions drive action selection
  • Permissions of the running user

Likely follow-up

Your agent never calls the action. What do you check first?

What is the Einstein Trust Layer?

Agentforce2–4 yrs

It is the set of safeguards between Salesforce and the language model: secure data retrieval that respects user permissions, dynamic grounding, zero data retention agreements with model providers, toxicity scoring and an audit trail. Data masking of sensitive fields applies to some generative AI features, but Salesforce disables it for agents.

What the interviewer wants to hear

  • Permission-aware grounding
  • Masking: where it applies, and that it is off for agents
  • Zero data retention
  • Toxicity detection and audit

Likely follow-up

Does the Trust Layer apply when you call OpenAI directly from Apex?

What is Prompt Builder and what template types does it have?

Agentforce2–4 yrs

Prompt Builder creates reusable prompt templates grounded with merge fields, related records, Flow or Apex. Types include Sales Email, Field Generation, Record Summary and Flex templates. Templates can run from record pages, Flow, Apex and as Agentforce actions, and each run goes through the Einstein Trust Layer.

What the interviewer wants to hear

  • Template types
  • Grounding sources (merge fields, Flow, Apex)
  • Where templates can be invoked

Likely follow-up

How would you ground a template with data from a related object?

How would you call OpenAI, Claude or Gemini from Apex?

AI integration2–4 yrs

Store the endpoint in a Named Credential and the API key in an External Credential, build the JSON request, send it with HttpRequest to callout:Your_Credential, parse the response and handle timeouts and errors. Run it asynchronously (Queueable) when triggered by record changes, and keep a human review step for anything customer-facing.

What the interviewer wants to hear

  • Named + External Credentials
  • Async for trigger-driven calls
  • Error handling and limits
  • Human review, data sent to the vendor

Likely follow-up

What data would you avoid sending to an external model?

What is RAG and how do you do it in Salesforce?

AI integration5+ yrs

Retrieval-augmented generation first finds relevant passages from your content, then asks the model to answer only from them, ideally with citations. In Salesforce you can use Data Cloud search indexes and retrievers grounding Agentforce or prompt templates, or build it yourself with an external vector store called from Apex.

What the interviewer wants to hear

  • Retrieve, then generate
  • Chunking and indexing
  • Permission-aware retrieval
  • Evaluation with test questions

Likely follow-up

How do you stop RAG answers from leaking records a user can't see?

How do you add AI to a business process safely?

AI integration2–4 yrs

Start with a narrow task, ground the model in the right records, keep a human approval step before anything is sent or saved, log prompts and outputs, cap tokens and cost, and test with real examples before go-live. Treat the AI output as a draft, not a decision.

What the interviewer wants to hear

  • Human in the loop
  • Logging and monitoring
  • Cost limits
  • Test set before go-live

Likely follow-up

Who reviews the AI output and where is that decision stored?

How do you test an Agentforce agent before go-live?

Agentforce5+ yrs

Write test cases of real utterances with the expected topic, actions and outcome, run them in Agentforce Testing Center (or the testing API and CLI), review the reasoning trace for wrong topic choices, and test as users with different permissions. Re-run the suite after every change to instructions or actions.

What the interviewer wants to hear

  • Expected topic and action per utterance
  • Testing Center / CLI
  • Permission-based tests
  • Regression after changes

Likely follow-up

The agent picks the wrong topic for 10% of tests. What do you change?

What is Data Cloud and how does it help AI in Salesforce?

Data Cloud2–4 yrs

Data Cloud (now Data 360) brings data from Salesforce and external sources into one model, resolves identities into unified profiles and makes it available for segments, insights and AI. For Agentforce and prompts, it provides grounding data, including unstructured content through search indexes and retrievers.

What the interviewer wants to hear

  • Ingest, harmonize, unify
  • Identity resolution
  • Grounding for AI and RAG

Likely follow-up

What is a data model object (DMO) compared to a data lake object (DLO)?

How do you control the cost of AI features in Salesforce?

AI integration5+ yrs

Know the billing model first (Agentforce usage or model tokens from the vendor). Then keep prompts short, use the cheapest model that meets the quality bar, cap output tokens, avoid calling the model when a rule or cache can answer, log usage per feature and set spend alerts or limits.

What the interviewer wants to hear

  • Billing model awareness
  • Smaller prompts and models
  • Caching and skipping calls
  • Usage logging and alerts

Likely follow-up

How would you report AI cost per business unit?

You need to update 5 million records. How do you do it?

Apex5+ yrs

Use Batch Apex (or Bulk API 2.0 from outside) with a selective QueryLocator, a sensible scope size, Database.update with allOrNone=false and error logging, and run it off-hours. Consider turning off non-essential automation with a bypass, test on a full sandbox, and monitor the job from Apex Jobs.

What the interviewer wants to hear

  • Batch Apex / Bulk API
  • Partial success + logging
  • Automation bypass
  • Sandbox rehearsal and monitoring

Likely follow-up

How do you restart from where it failed?

A user reports an error when saving a record. How do you debug it?

Apex2–4 yrs

Reproduce it, set a trace flag for that user and capture the debug log, then read the log for the exception and the last executed line, checking triggers, flows and validation rules in order of execution. Check the user's permissions and sharing too, fix, add a test that reproduces the bug, then deploy.

What the interviewer wants to hear

  • Reproduce + trace flag
  • Read the log in order of execution
  • Permissions as a cause
  • Regression test

Likely follow-up

The log is truncated at 20 MB. What do you do?

Salesforce interview questions by years of experience

Interviewers change the questions as experience grows. Freshers are asked definitions and basics, mid-level candidates get "how would you build it" questions, and senior people get design, scale and trade-off questions.

Go deeper: interview guides by topic

Stuck on a question?

Ask Krrish, our Salesforce + AI assistant, to explain any topic, grade an answer or walk you through code. Or read the full guides, each with interview questions.

SFX Support — Salesforce + AI solutions. Independent: not affiliated with, endorsed by, or a partner of Salesforce, Inc. Salesforce and Agentforce are trademarks of Salesforce, Inc.