Prepare for Salesforce interview questions grouped by experience level.
Salesforce Interview Question & Answers
0-2 Years
Salesforce is a cloud-based customer relationship management (CRM) platform, letting a business track and manage customer relationships, sales opportunities, support cases, and marketing activity all in one connected system, accessed entirely through a web browser rather than software installed on a local machine.
A CRM (Customer Relationship Management) system centralizes genuinely all information about customers and prospects, contact details, past interactions, deal history, in one place. Businesses genuinely use one to avoid customer information being scattered across spreadsheets, emails, and individual employees' own memory, which becomes genuinely unmanageable as a company grows.
Sales Cloud manages the genuine sales process, leads and opportunities. Service Cloud manages genuine customer support cases. Marketing Cloud handles genuine marketing campaigns and customer engagement. Each is genuinely built on the exact same underlying Salesforce platform, sharing a common data model and core architecture.
An org (short for organization) is a genuinely single, complete Salesforce instance, essentially a company's own dedicated environment, including its own data, users, and customizations, genuinely separate and isolated from every other company's own org.
A production org holds a genuinely company's real, live data and is used by actual end users daily. A sandbox is a genuinely separate, isolated copy used for development and testing, letting changes be genuinely tried out safely without any risk of affecting real, live production data.
AppExchange is a genuine marketplace of pre-built applications and components that can be genuinely installed directly into a Salesforce org, extending its functionality without needing to actually build that same capability entirely from scratch.
An object is genuinely Salesforce's equivalent of a database table, defining a specific type of record, like Account or Contact, along with its genuine fields. Each individual record of that object genuinely corresponds to a row in that underlying table.
A standard object, like Account, Contact, or Opportunity, comes genuinely built into Salesforce by default. A custom object is genuinely created by an admin or developer to store data specific to that particular organization's own genuine business needs, not covered by any of Salesforce's own standard objects.
Text, for genuinely short text values. Number, for a genuine numeric value. Picklist, for selecting genuinely one value from a predefined list. Checkbox, for a genuine true-or-false value. Date and Date/Time, for storing a genuine date or a specific point in time.
A picklist lets a user select genuinely exactly one value from a predefined list of options. A multi-select picklist lets a user genuinely select several values from that same list at once, storing them together as a genuinely combined set of selections on the record.
A formula field automatically calculates its own value based on a genuine expression referencing other fields, always staying genuinely up to date automatically whenever those referenced fields actually change, without requiring any code or a manual update to actually keep it correct.
A required field genuinely must have a value before a record can actually be saved. You'd make a field required either by genuinely checking the required checkbox directly on the field's own definition, or through a genuinely separate validation rule enforcing that same condition.
A lookup relationship genuinely, loosely links two objects, and the child record can genuinely exist independently even if the parent is deleted, or the relationship field is left genuinely blank. A master-detail relationship is genuinely tighter, the child record's own security and sharing follow the parent's, and deleting the parent genuinely deletes all its related child records too.
A junction object implements a genuinely many-to-many relationship between two objects, since Salesforce's own native relationship types only genuinely support a direct one-to-many connection. It's genuinely a custom object with two master-detail relationships, one to each of the two objects it's genuinely connecting.
A Roll-Up Summary field automatically calculates a value, like a sum or a count, from a set of genuinely related child records, directly on the parent. It genuinely only works across a master-detail relationship, not a lookup relationship, since it depends on the tighter, more genuinely defined parent-child structure that master-detail specifically provides.
A Record Type lets a genuinely single object support different sets of picklist values and a different page layout depending on which type a genuine record is actually assigned. It solves the genuine problem of one object needing to behave somewhat differently for genuinely different business processes or product lines.
A page layout controls which genuine fields, sections, and related lists actually appear on a record's own detail page. A Record Type controls which genuine picklist values are available and which page layout is genuinely used, letting different Record Types on the exact same object each show a genuinely different, tailored layout.
A Related List shows genuine child records connected to the current record through a lookup or master-detail relationship, appearing directly on that parent record's own detail page, letting a user genuinely see, for instance, every Contact associated with a specific Account without navigating away.
The Object Manager is the genuine setup area where an admin actually creates and manages objects, their fields, relationships, and page layouts, serving as the genuine central place for actually configuring an org's own core data model.
Apex is Salesforce's own genuinely proprietary, Java-like programming language, used to actually write custom business logic that goes genuinely beyond what point-and-click, declarative tools like Flow can accomplish, running directly on Salesforce's own servers.
Declarative development uses genuinely point-and-click tools, like Flow or the Object Manager, requiring genuinely no code at all. Programmatic development involves genuinely writing actual code, in Apex or JavaScript for Lightning Web Components, used when a requirement genuinely exceeds what the declarative tools alone can actually handle.
A trigger is genuinely Apex code that automatically executes in response to a specific database event on a specific object, like before or after a record is genuinely inserted, updated, or deleted, letting you actually enforce custom logic automatically whenever that particular event genuinely occurs.
A before trigger runs genuinely before a record is actually saved to the database, letting you genuinely modify the record's own field values directly before that save actually happens. An after trigger runs genuinely after the record has already been saved, used for logic genuinely needing the record's final, actual ID or for updating a genuinely different, related record.
Governor limits are genuine restrictions Salesforce enforces on how much of a shared resource, like the number of database queries or the amount of CPU time, a single transaction can actually consume. They exist because Salesforce genuinely runs many different customers on the exact same shared, multi-tenant infrastructure, and these limits prevent one customer's own code from genuinely degrading performance for everyone else.
An Apex class defines a genuinely reusable blueprint containing variables and methods, conceptually genuinely similar to a class in Java, since Apex's own syntax was actually deliberately modeled closely after Java's own familiar syntax and object-oriented structure.
Visualforce is Salesforce's genuinely original framework for building custom user interface pages, using an HTML-like markup syntax combined with Apex controllers. It's genuinely been the standard custom UI approach for many years, though Lightning Web Components have now genuinely become the preferred, more modern approach for new development.
An LWC is a genuinely modern custom component built using standard web technologies, HTML, JavaScript, and CSS, following current web standards rather than Salesforce's own genuinely older, proprietary Visualforce syntax, and generally offering genuinely better performance.
Visualforce uses a genuinely Salesforce-specific markup language and requires an Apex controller to actually supply data. LWC uses genuinely standard, modern web component technology, generally performs better, and is Salesforce's own genuinely current, recommended approach for building custom user interface elements.
The Lightning App Builder is a genuinely point-and-click tool for actually assembling a Lightning page, arranging standard and custom components, including Lightning Web Components, onto a page layout without writing any code to actually do the arranging itself.
Lightning Experience is Salesforce's genuinely modern, current user interface, offering a more visual, customizable experience than Salesforce Classic, the genuinely older interface. Classic is genuinely being phased out over time as Salesforce continues investing entirely in Lightning going forward.
A Lightning Record Page is built visually in the Lightning App Builder, letting an admin arrange standard and custom components, including different components for desktop versus mobile, on a per-app or per-profile basis. A traditional page layout is genuinely simpler and more fixed, defining which fields and related lists appear, without that same component-level, app-aware flexibility Lightning pages provide.
A Lightning App groups genuinely related tabs, objects, and components together into one genuinely focused navigation experience tailored to a specific role or business process, like a genuinely dedicated Sales app showing only the tabs and features a salesperson actually needs day to day.
A Profile controls genuinely baseline permissions for a user, which objects and fields they can genuinely access, what actions they can perform, and which apps and tabs are genuinely visible to them. Every Salesforce user genuinely has exactly one assigned profile.
A Permission Set grants genuinely additional permissions on top of a user's existing profile, without needing to actually change their base profile itself. It's genuinely useful for granting a specific extra capability to only some users who genuinely share the exact same base profile.
OWD sets the genuinely baseline, most restrictive level of record access for an object across the entire org, either Private, Public Read Only, or Public Read/Write. Additional access is then genuinely granted on top of that baseline through role hierarchy, sharing rules, or a manual share.
The role hierarchy defines a genuine reporting structure, and by default, a user genuinely above another user in that hierarchy automatically gains access to records genuinely owned by users below them, mirroring a genuinely typical management structure's own natural visibility into a team's work.
Object-level security, controlled through a Profile or Permission Set, controls whether a user can genuinely access an object at all. Field-level security controls whether they can genuinely see or edit a specific field. Record-level security, controlled through OWD and sharing rules, controls which genuinely specific individual records they can actually access.
3-6 Years
Bulkifying means genuinely writing Apex code so it correctly handles a batch of many records at once, rather than assuming genuinely only one record will ever be processed at a time. It matters because a trigger can genuinely fire on a batch of up to 200 records at once, and code that isn't genuinely bulkified can quickly exceed governor limits, like the limit on SOQL queries per transaction.
Placing a SOQL query or a DML statement genuinely inside a for loop means it executes once per genuine record being processed, which can quickly exceed the genuine governor limit on the total number of queries or DML statements allowed per transaction once a batch contains more than a genuinely small handful of records.
A trigger framework provides a genuinely consistent, structured pattern for organizing trigger logic, typically routing all triggers for an object through one genuinely central handler class. It's adopted to avoid genuinely multiple, uncoordinated triggers on the exact same object executing in an genuinely unpredictable order, and to make trigger logic genuinely easier to test and maintain.
A recursive trigger problem happens when a trigger's own logic genuinely causes an update that fires that exact same trigger again, potentially looping indefinitely or genuinely exceeding governor limits. It's genuinely prevented using a static variable to track whether the trigger has already genuinely run once during the current transaction.
Create genuine test data using Test.startTest() and Test.stopTest() to isolate asynchronous limits, insert or update a record to actually trigger the logic being tested, then use System.assertEquals() (or Assert.areEqual()) to genuinely verify the expected outcome actually occurred.
SOQL (Salesforce Object Query Language) queries Salesforce's own data, genuinely similar in spirit to SQL but with a genuinely simpler, more restricted syntax, since it's specifically designed to actually query Salesforce's own object model rather than a genuinely general-purpose relational database.
SOQL queries genuinely one specific object (or its related objects through a relationship), returning genuinely structured, filtered records. SOSL performs a genuinely full-text search across multiple different objects at once, returning records genuinely matching a search term regardless of which specific object they actually belong to.
SELECT Name, (SELECT LastName FROM Contacts) FROM Account genuinely retrieves each Account along with its genuinely related Contacts nested directly within the same query result, avoiding the genuine need for a separate, additional query to fetch that related data.
Salesforce genuinely limits the total number of SOQL queries (and the total number of records a query can return) within a single transaction. Avoiding this limit genuinely means querying once for a batch of records rather than genuinely querying separately inside a loop, and using selective, indexed filter conditions to actually keep returned record counts reasonable.
A query filtering on a genuinely indexed field, like a standard ID or a field explicitly marked as an external ID, can use that index to actually narrow results efficiently. A query filtering on a genuinely non-indexed field may require Salesforce to actually scan a much larger set of records, which can genuinely become slow on an object with a very large number of records.
connectedCallback runs when the component is genuinely inserted into the DOM. renderedCallback runs after every genuine render. disconnectedCallback runs when the component is genuinely removed from the DOM. Each lets you actually run specific logic at that particular genuine point in the component's own lifecycle.
The @wire decorator lets a component genuinely, declaratively retrieve Salesforce data, automatically re-fetching it whenever a genuinely referenced reactive property actually changes, without needing to manually write imperative fetch-and-subscribe logic yourself for that same reactive behavior.
A wired property genuinely, automatically re-fetches data whenever its own reactive parameters change, and provisions its result reactively. An imperative call genuinely happens only when explicitly, manually invoked, like in response to a button click, giving genuinely more direct control over exactly when that call actually happens.
A parent passes data down to a child through a genuine public property, decorated with @api. A child communicates back up to its parent by genuinely dispatching a custom event, which the parent listens for using an event listener genuinely attached where the child component is actually used.
LDS lets an LWC genuinely read, create, update, or delete a record directly, without writing any Apex code at all, while automatically genuinely handling caching and keeping data consistent across every component using LDS that references the exact same record.
Flow is Salesforce's genuinely current, primary declarative automation tool, letting an admin build genuinely complex business logic and process automation through a visual, point-and-click interface, without writing any Apex code at all for most genuinely common automation needs.
A Screen Flow genuinely guides a user through an interactive, step-by-step process with actual input screens. A Record-Triggered Flow runs genuinely automatically in the background whenever a specified record event occurs, like a record being created or updated, with genuinely no user interface or interaction involved at all.
Salesforce genuinely consolidated its automation tools into Flow specifically because maintaining several genuinely separate, overlapping automation tools created real confusion about which tool to actually use for a given need, and Flow itself genuinely covers everything the older tools could do, and considerably more, in one single, unified tool.
Flow genuinely handles the vast majority of common automation needs declaratively. Apex becomes genuinely necessary for a requirement that's too genuinely complex for Flow to express cleanly, needs genuinely better performance at a very large data volume, or requires logic Flow simply genuinely doesn't support at all.
The REST API lets an external system genuinely interact with Salesforce data over standard HTTP, retrieving, creating, updating, or deleting records programmatically, commonly used to actually integrate Salesforce with another genuinely separate external system or a custom-built application.
The REST API uses genuinely lightweight, JSON-based HTTP requests, and is generally simpler to actually work with for most modern integrations. The SOAP API uses a genuinely more rigid, XML-based protocol, and still shows up in genuinely older enterprise integrations that were built before REST became the widely-preferred, dominant standard.
An external ID field stores a genuine unique identifier from an external system, letting an integration match and update the correct Salesforce record based on that genuine external system's own identifier, rather than needing to already know Salesforce's own internal, system-generated record ID.
Upsert genuinely combines insert and update into one operation, based on whether a genuine matching record already exists, typically matched on an external ID. It's useful because an integration can genuinely run the exact same operation repeatedly without needing to first separately, explicitly check whether a given record already exists.
6-8 Years
Future methods run genuinely simple, isolated logic asynchronously. Queueable Apex offers genuinely more flexibility, including the ability to chain jobs together. Batch Apex processes genuinely very large data volumes in manageable chunks. Scheduled Apex runs code at a genuinely defined, recurring time. Each fits a genuinely different specific need around timing, data volume, and complexity.
Batch Apex processes a genuinely very large number of records by breaking the total job into smaller batches, each running as its own genuinely separate transaction with its own fresh set of governor limits. It solves the genuine problem of processing millions of records, something a single synchronous transaction's own limits would genuinely make impossible.
A Future method is genuinely simpler but more limited, accepting only primitive parameter types and offering genuinely no way to chain additional jobs. Queueable Apex accepts genuinely complex object parameters and can chain one job to start another once the first genuinely finishes, offering meaningfully more flexibility for a genuinely more complex asynchronous workflow.
The Limits class provides genuine methods like Limits.getQueries() and Limits.getLimitQueries(), letting code genuinely check how many of a specific governor limit resource it has already actually consumed versus the genuine total available, useful for defensively avoiding an unexpected limit exception in a genuinely complex, data-heavy operation.
Using Database.insert(records, false) (or the equivalent update or upsert with allOrNothing set to false) genuinely processes every record independently, returning a genuine list of individual results indicating which specific records actually succeeded and which genuinely failed, rather than one single failure rolling back the entire batch together.
A custom exception class, extending Exception, lets you genuinely throw and catch a specific, named error type relevant to your own particular business logic, making error handling code genuinely clearer and letting calling code distinguish a genuinely specific failure type from a generic, unrelated exception.
A Finalizer runs genuinely guaranteed cleanup or follow-up logic after a Queueable job completes, whether it succeeded or failed, letting you actually handle a failed asynchronous job gracefully, like logging the failure or retrying it, rather than the failure simply going genuinely unnoticed with no follow-up action taken at all.
A Sharing Rule automatically grants genuinely additional record access to a specific group of users, beyond the baseline OWD setting, typically based on the record owner's role or genuine group membership, or based on a specific criteria the record itself actually meets.
An owner-based sharing rule genuinely grants access based on who owns the record, sharing every record owned by a genuinely specific role or group with another specified group. A criteria-based sharing rule genuinely grants access based on the actual field values on the record itself, regardless of who genuinely owns it.
Field-Level Security, controlled through a Profile or Permission Set, genuinely determines whether a user can see or edit a specific field at all, at the absolute strictest level. Even if a page layout genuinely includes that field, a user genuinely without visibility to it through Field-Level Security still won't actually see it on the page.
Apex sharing lets code genuinely grant record access programmatically for a scenario too genuinely complex for a standard, declarative sharing rule to express, like a genuinely dynamic condition calculated through custom logic that changes based on factors a simple criteria-based rule genuinely can't evaluate.
Salesforce's own Sharing Calculation and Why can't I see this record? tooling helps trace exactly why access was genuinely denied, checking Organization-Wide Defaults, role hierarchy, sharing rules, and any manual share, in genuine sequence, to identify precisely where the expected access is actually missing.
8-10 Years
It means keeping trigger logic, business logic, and data access genuinely separated into distinct layers, rather than combining everything directly inside the trigger itself. A genuine trigger framework typically routes execution through a thin trigger, into a handler class containing the actual logic, itself calling genuinely separate service or selector classes for specific business rules and queries.
A Selector class centralizes all SOQL queries for a genuinely specific object into one place, rather than scattering the exact same (or genuinely near-identical) query across many different classes. It solves the genuine problem of a query needing to change consistently everywhere it's actually used, and makes query logic genuinely easier to test and optimize in one central location.
A Unit of Work collects genuinely multiple, related DML operations across different objects and commits them together at the actual end of a transaction, in the genuinely correct order respecting relationships between them, rather than issuing genuinely separate DML statements scattered throughout the code, which can be harder to reason about and less efficient.
Route every trigger context through one genuinely single trigger per object, delegating to a genuinely ordered list of separate handler classes, each responsible for one genuinely specific, focused piece of automation logic, so adding or removing one specific piece of automation doesn't genuinely require touching the trigger itself or any other unrelated handler.
fflib provides a genuinely structured set of base classes implementing patterns like Selector, Domain, and Service layers consistently. Adopting it solves the genuine problem of a large team independently reinventing genuinely similar architectural patterns inconsistently, giving everyone a shared, genuinely well-tested foundation to actually build on instead.
I'd default to Flow first, given it genuinely covers most requirements and is far genuinely easier for an admin to maintain without a developer. I'd move to Apex only once a genuinely specific limitation, complex recursive logic, a very large data volume, or a genuinely specific integration requirement, makes Flow's own declarative approach genuinely impractical.
I'd model the genuinely core, stable entities carefully upfront, while deliberately avoiding over-engineering for a genuinely hypothetical future requirement that may never actually materialize. A data model that's easy to genuinely extend later, through a new custom object or a new field, tends to serve better than one that tries to genuinely anticipate every possible future need from the very start.
Platform Events let Salesforce publish and subscribe to genuine custom events, enabling a genuinely real-time, event-driven integration pattern where a change in Salesforce can immediately, automatically notify an external system, or the reverse, rather than relying on genuinely slower, periodic polling for changes.
Change Data Capture automatically publishes an event genuinely whenever a record is created, updated, deleted, or undeleted, without needing genuinely custom code to actually trigger that publication. A Platform Event is genuinely custom-defined and published explicitly by your own code or declarative automation for a genuinely specific business event you actually define yourself.
Ensure queries genuinely use selective, indexed filters, consider Salesforce's own skinny tables and indexing options for a genuinely frequently-queried object, and design any batch processing to genuinely respect governor limits by processing data in appropriately-sized chunks, considering the actual specific performance characteristics of an object at that genuine scale.
An integration layer, like MuleSoft or a genuinely similar middleware platform, sits between Salesforce and each external system, so Salesforce genuinely connects to just that one middleware layer, and the middleware itself handles genuinely routing and transforming data to and from each specific downstream system independently.
The Bulk API is genuinely optimized for loading or extracting a very large number of records asynchronously, processing data in genuinely large batches rather than one record (or a small batch) per individual API call the way the standard REST API genuinely works. It's the appropriate choice for a genuinely large, bulk data migration or a large, recurring data sync.
Identify genuinely older, less frequently accessed data and move it to a genuinely separate archive, either an external system or Salesforce's own Big Objects, keeping the genuinely active, frequently-queried data in standard objects lean and fast, while still preserving the archived historical data for compliance or occasional reference.
10+ Years
I'd weigh how closely the requirement genuinely relates to the core CRM data and workflow already living in Salesforce against the real cost and complexity of building it natively there versus in a genuinely more specialized external system, then integrating the two rather than forcing an unnatural fit.
I'd prioritize the areas causing the genuinely most real pain first, frequent bugs, a specific object that's genuinely become hard to safely change, rather than attempting a single, genuinely disruptive rewrite of the entire org's automation all at once, migrating incrementally to a genuinely consistent trigger framework as each specific area is actually touched.
I check whether it's genuinely consistent with patterns already established elsewhere in the org, whether it accounts for governor limits and genuine data volume at actual production scale, and whether the design will genuinely hold up as business requirements continue to evolve, rather than only solving today's genuinely specific, narrow need.
Enforce genuinely hard requirements, like minimum code coverage, automatically through the deployment pipeline itself, so they aren't purely a matter of individual opinion during manual review. For architectural conventions that genuinely resist full automation, I'd document the handful of decisions that actually matter most, along with the real reasoning behind each one.
I'd weigh the genuine benefit of a single, unified view of customer data and reduced duplicated administrative effort against the real cost and genuine risk of a consolidation project, and whether the separate orgs genuinely exist for a real, valid reason, like a genuinely distinct regulatory or business separation requirement, that would still genuinely justify keeping them apart.
I'd check whether production data volume genuinely differs meaningfully from the test data used, since a query or a loop that's genuinely fine on a small test dataset can quickly exceed a limit once the real, much larger production data volume is genuinely involved, a genuinely common cause of exactly this kind of environment-specific discrepancy.
Log every genuine integration attempt and its outcome, and set up an alert genuinely triggering when the failure rate crosses a defined threshold, rather than relying purely on someone manually noticing missing data days later. Salesforce's own outbound message and platform event delivery failure notifications also genuinely provide a built-in signal worth actually monitoring.
Treat the class's actual public methods, or the object's actual fields, as a genuine contract with every consumer. Adding something new is generally safe. Changing or removing an existing method's signature or a field needs a documented deprecation period and direct communication with everyone genuinely depending on it before actual removal.
I'd check the deployment's own genuine change log first, since a recent deployment is the most likely, genuine suspect, and consider quickly deactivating the specific problematic automation as an immediate mitigation while investigating the actual root cause, rather than leaving it genuinely broken and actively blocking users while a proper fix is being developed.
I'd monitor genuine storage usage and query performance trends proactively, and plan for Large Data Volume best practices, selective indexing, appropriate archiving, well before an object's genuine record count actually reaches a point where performance starts visibly degrading for real, actual users.
This is a judgment question interviewers use to see how you reason under genuine uncertainty, not to test a specific textbook fact. A strong answer names the actual constraint that forced the decision, the realistic options that were genuinely on the table, why you picked one knowing it wasn't guaranteed to be right, and what you'd do differently with what you know now.
I'd walk through an actual production failure together, showing concretely how the exact same code fails once a genuinely realistic batch size is actually involved, rather than explaining bulkification as an abstract best practice in isolation. Seeing their own code genuinely fail on a realistic batch tends to build that habit far more effectively than a general rule alone.
I wouldn't lead with governance as an abstract best practice. I'd point to a specific, real, already-experienced incident where undocumented, uncoordinated automation caused a genuine conflict or an unexpected side effect, and show concretely how a more disciplined approach would have genuinely prevented that exact same specific problem.
I'd lay out the actual, concrete trade-off directly: the quick workaround's genuine short-term speed against the real, likely maintenance cost or fragility down the line, letting the stakeholder make a genuinely informed decision rather than unilaterally overriding their own preference. Often there's a genuinely reasonable middle ground once both sides understand the real trade-off clearly.
I'd translate the debt into terms leadership already tracks: a specific incident or delayed feature that traced directly back to it, and how much longer a typical change in that specific area now takes compared to a genuinely well-structured part of the same org. Framed as a velocity problem with a real, already-incurred cost, it competes far better for prioritization than framed as a general code-quality concern.




