Security & Sharing Interview Questions
OWD, role hierarchy, sharing rules, permission sets, FLS, and secure Apex.
Concept at a glance
Record access starts locked down at OWD and is opened by roles, sharing rules, and teams; FLS guards fields.
- OWD & role hierarchy
- Sharing rules & manual sharing
- Permission sets & FLS
- with sharing & USER_MODE
Record access starts locked down at OWD and is opened by roles, sharing rules, and teams; FLS guards fields.
Difficulty Level
Topic Focus
Showing 120 of 120 Security & Sharing questions
Walk through the Salesforce record-sharing model from most restrictive to most open.
An interviewer asks you to explain how a user ends up seeing a record they do not own.
What is the difference between owner-based and criteria-based sharing rules?
Service managers in Europe need to see all Cases where Region equals EMEA, no matter who owns them.
What is implicit sharing?
A Case agent who can see a Case can also see its Account, though Account OWD is Private.
When and how do you use Apex managed sharing?
Each Project record should be shared with the users listed in a custom "Project Members" related list.
What happens when you change an Organization-Wide Default on a large object?
Security wants to change Account OWD from Public Read/Write to Private in an org with 6 million Accounts.
What are Restriction Rules and how do they differ from sharing?
Contractors with Public Read Only access to Tasks should only see Tasks related to their own projects.
How do Account Teams and Opportunity Teams grant access?
A solution engineer must edit specific Opportunities they help with, without owning them.
How does Enterprise Territory Management affect sharing?
Sales coverage is by region and industry, and accounts often need multiple sellers.
What is "Controlled by Parent" and when is it used?
Invoice Lines must follow the same visibility as their Invoice.
How would you design sharing for a partner portal where partners must not see each other's deals?
600 partner companies register deals in Salesforce through a partner site.
What are sharing sets and share groups in Experience Cloud?
Customer users must see all Cases for their company, and support agents must see Cases customers create.
How do you secure the guest user in an Experience Cloud site?
A security scan shows unauthenticated users can query Contacts through the site's API.
What is the maximum number of sharing rules and why does it matter?
A design proposes one criteria rule per sales region, 120 regions.
How do you give a manager access to records owned by their team on a custom object with hierarchy access disabled?
Expense Reports have "Grant Access Using Hierarchies" turned off, but finance managers still need their team's reports.
What is the difference between "Public Read Only" and "Public Read/Write/Transfer"?
Rapid-fire OWD question.
What is the "View All Lookup Record Names" permission and why is it sensitive?
Users can see names of Accounts they do not have access to in lookup fields.
How do you troubleshoot a user getting "insufficient privileges" on a record?
A rep clicks a link from an email and sees "Insufficient Privileges".
What is UserRecordAccess and how do you use it?
A custom component must show an Edit button only if the user can edit the record.
What is a public group, and why are nested groups a performance concern?
An org has 4-level nested groups used in 40 sharing rules; recalculations take hours.
How do you share a record with a user in Apex for standard objects, and what is the caveat?
Code inserts AccountShare rows to give partners access, but shares disappear after ownership changes.
Explain with sharing, without sharing and inherited sharing.
A code review finds a controller with no sharing keyword used by an LWC.
How do you enforce CRUD and FLS in Apex?
An @AuraEnabled method returns Salary__c to users who should not see it.
How do you prevent XSS in Lightning Web Components and Visualforce?
A component displays rich text from a Case description using innerHTML.
What is CSRF and how does Salesforce protect against it?
A Visualforce page performs a delete when loaded with a record Id in the URL.
How do you store secrets like API keys securely in Salesforce?
A developer hard-coded a payment provider API key in an Apex class.
What is Shield Platform Encryption and how is it different from Classic Encryption?
A healthcare client must encrypt patient diagnosis data at rest with their own keys.
What does Event Monitoring provide?
Security wants to know who exported large reports last month.
What is a Transaction Security Policy?
Block any user exporting more than 10,000 records from a report.
How does SAML single sign-on work with Salesforce?
The company uses Okta and wants employees to log into Salesforce without a password.
Which OAuth flows should you use for different integrations?
Three integrations: a mobile app for users, a nightly server job, and a partner web app acting on behalf of users.
What is a connected app vs an external client app?
You need to register a new integration in Salesforce.
How do you secure @AuraEnabled methods?
An LWC calls an @AuraEnabled method that accepts a record Id and updates any Account.
What is Lightning Locker vs Lightning Web Security?
A third-party JavaScript library fails in an LWC under Locker.
What are CSP Trusted Sites and CORS in Salesforce?
An LWC fails to load images from an external CDN, and a separate web app cannot call Salesforce REST APIs from the browser.
What is the AppExchange Security Review and what does it look for?
An ISV is preparing its first managed package for listing.
How do you protect against open redirects in Salesforce code?
A Visualforce page redirects to whatever URL is in the retURL parameter.
What is "Secure Coding" for Apex triggers that run in system context?
A trigger lets users indirectly modify records they cannot edit.
How do you design field-level access for sensitive personal data?
National ID numbers must be visible only to a compliance team.
What are the risks of the "Modify All Data" permission on integration users?
An integration user has System Administrator profile "to avoid permission errors".
How do you secure files and libraries?
Confidential contract files are visible through public links created by reps.
What is a Login Flow and when would you use one?
Users must accept updated terms of use at their next login, and contractors must confirm their project code.
What is the difference between authentication and authorization in Salesforce?
Basic security concept question.
How do session security levels and high-assurance sessions work?
Exporting reports and managing users should require MFA even if users logged in via SSO without MFA.
What are password policies and why are they less important with SSO?
An auditor asks about password complexity in an SSO-enabled org.
What compliance features help with GDPR and data privacy?
A European client asks how Salesforce helps meet GDPR obligations.
How do you mask data in sandboxes?
Developers have access to a full sandbox containing real customer emails and phone numbers.
What is the difference between Field Audit Trail, Field History and Setup Audit Trail?
Auditors ask which tool answers which question.
What is a certificate in Salesforce used for?
A JWT bearer integration and SAML SSO both need certificates.
How do you secure an org against a compromised user account?
A user's credentials appear in a phishing report.
What is Salesforce's shared responsibility model?
A CISO asks what Salesforce secures and what the company must secure.
How do permission set groups and muting permission sets work together?
A Sales Ops group gets many permission sets, but one includes Delete on Opportunity which Sales Ops should not have.
What are the security considerations for Apex REST services?
A custom REST endpoint lets a partner update order status.
How do you audit what an org's connected apps can access?
Security discovers dozens of connected apps installed over the years.
What is Security Center?
A company with 12 orgs wants one view of security posture.
How do you securely expose Salesforce data to an external website without login?
Marketing wants a public store locator using Account addresses from Salesforce.
What is the purpose of the "API Enabled" permission?
Security wants to stop regular users from connecting tools like Data Loader.
What is the difference between "Export Reports" and "Weekly Data Export" permissions?
You want to limit who can extract large amounts of data.
How do you securely implement a "Login as customer" feature for support agents?
Support agents want to see exactly what a customer sees on the portal.
What is the "Secure Guest User Record Access" setting?
After a release update, guest users can no longer see records they used to see.
How do you prevent sensitive data from appearing in debug logs?
Developers log full request payloads including card details in System.debug.
What are the layers of Salesforce security?
First security question in a junior admin interview.
What is manual sharing?
A rep wants a colleague to help with one Account for a week.
What is field-level security?
Basic security question.
What is a profile's object permission "Modify All" used for?
Data stewards need to clean up all Contacts regardless of owner.
What is the role of the "Grant Access Using Hierarchies" checkbox for standard objects?
An admin tries to untick it for Accounts.
What are the types of sharing rule access levels?
Rapid-fire question.
What is the difference between a profile and a permission set in terms of assignment?
Basic admin question.
What happens when a user is both in a sharing rule and owns a record?
Quick reasoning question.
What is a role vs a territory?
A candidate is asked to compare the two.
What is an External OWD?
Internal users should see all Accounts, but portal users only their own.
What is MFA and which verification methods are accepted?
Basic security question.
What is Health Check's "Baseline Standard"?
Quick question about Health Check.
Can you restrict a user from deleting records but allow edit?
Sales reps should edit Opportunities but never delete them.
What is Hyperforce and why does it matter for security and compliance?
A bank in the EU asks where its Salesforce data is stored.
What is the difference between "View Setup and Configuration" and "Customize Application"?
A business analyst needs to see configuration without changing it.
What is a sharing rule's "include records owned by users who can access the records" consideration?
An owner-based sharing rule does not share records owned by a queue.
How do you prevent users from seeing salary information in reports?
Managers can build reports showing a Salary field they should not see.
What is the difference between OAuth and SAML?
An architect asks which protocol to use for user login vs API access.
What is "Clickjack protection" and where is it configured?
A partner wants to embed a Salesforce Visualforce page in their site via iframe.
What is the Principle of Least Privilege in Salesforce terms?
A behavioural interview asks how you apply security principles day to day.
Design the sharing model for a global sales org with regional privacy and shared key accounts.
5,000 sellers in 40 countries; EU data must be visible only to EU staff, except for 200 global key accounts that need cross-region teams.
A security audit found 40 Apex classes "without sharing". How do you remediate?
You are leading a security remediation sprint.
How would you secure a high-volume customer portal handling financial data?
A bank launches a portal for 1.5 million retail customers to view statements and raise requests.
How do you design access for a shared services team that supports multiple business units?
A central finance team needs read access to Opportunities across three business units, but each BU must not see the others.
Your org must pass a SOC 2 audit. What Salesforce evidence would you prepare?
Auditors request evidence of access control, change management and monitoring.
How do you safely grant temporary admin access for an emergency fix?
A developer needs production admin access at 2am to fix a broken integration.
How do you secure Salesforce data used by AI features like Agentforce?
An agent answers customer questions using order and case data.
How do you design a secure integration between Salesforce and an on-premise system?
Salesforce must call an internal ERP behind the company firewall.
How do you handle data exposure risk in reports and list views with "View All" for support agents?
Support agents were given View All on Case to "make things easier", including VIP and HR cases.
What would you include in a secure code review for an LWC + Apex feature?
A new LWC lets users bulk-update discounts via an Apex controller.
How do you handle sharing for records created by integrations?
All Orders created by the ERP integration are owned by the integration user and invisible to sales reps.
How would you implement record-level access based on a custom "Confidential" flag?
Some Opportunities are marked Confidential and should be visible only to the owner and a deal desk group.
How do you keep sharing correct after a re-org?
The company restructures from regions to industries; 1,200 users change roles.
How do you secure Platform Events and Change Data Capture subscribers?
An external subscriber receives Account change events containing fields some users should not see.
What questions do you ask to design a sharing model from scratch?
You are starting a new implementation and the client says "everyone sees everything for now".
How do you investigate unusual data exports by a departing employee?
HR flags that a salesperson who resigned may have exported client lists.
What is the security impact of "Allow users to relax IP restrictions" on connected apps?
An integration fails due to login IP restrictions, and someone suggests relaxing them.
How would you protect PII in Salesforce reports sent by email subscriptions?
Report subscriptions email customer phone numbers to a distribution list including external addresses.
How do you enforce separation of duties in Salesforce?
Finance requires that the person who creates a vendor cannot approve payments to that vendor.
What is the role of a Salesforce security architect on a project?
A behavioural question about your responsibilities.
What happens to manual shares when a record owner changes?
Quick sharing question.
Can a user see a record through a report if they cannot open it?
Quick question.
What is the difference between Read Only and Read/Write sharing rules for Accounts and children?
A rule gives Account read access but users still cannot see Opportunities.
How do you protect a sensitive field from integration users?
An integration should not read health data stored on Contacts.
What is the "Secure guest user record access" impact on Experience Cloud forms?
A public form stopped showing related product options.
How do you investigate who changed a permission set?
A permission set suddenly grants Delete on Accounts.
What is a session hijacking risk and how does Salesforce mitigate it?
Security asks about stolen session cookies.
How do you grant temporary edit access to a single record?
A colleague must fix one account for a day.
What is the difference between Profile-based and Permission Set-based field access?
Quick permissions question.
How do you design security for an internal HR app on Salesforce?
HR cases and employee records must be highly restricted.
What is Apex sharing recalculation used for?
Apex shares became inconsistent after a data load.
How do you prevent users from exporting data via list views?
Security worries about copying list view data.
What are the security implications of "Allow Access to Customer Data" for support?
Salesforce Support needs to troubleshoot an org.
How do you design sharing for a project-based consulting company?
Consultants should see projects they are staffed on.
What is OAuth scope and why limit it?
Quick OAuth question.
How do you safely use "without sharing" in a utility class?
A utility must count all records for a dashboard regardless of user.
What is the difference between authentication providers and SSO settings?
Customers want to log in with Google.
How do you respond if a security scan finds hard-coded credentials in Apex?
A scanner finds an API key in a class.
What is the purpose of the "Require HttpOnly attribute" session setting?
Quick session security question.
How do you approach a security review before launching a customer portal?
Portal launch is in two weeks.