1. What is the difference between a Salesforce Administrator and a Salesforce Developer?
An Administrator manages users, configurations, and org settings through the UI without coding, while a Developer writes Apex code, creates Lightning components, and customizes business logic programmatically. For example, an Admin might create a custom field, but a Dev would write a trigger to calculate values based on that field.
2. What is a Salesforce Org and what are the different types of orgs?
An Org is a Salesforce instance or environment where your CRM data and customizations live. Common types include Production (live data), Sandbox (testing environment), and Developer Edition (free learning environment). A junior developer would typically test code in a Sandbox before deploying to Production.
3. Explain what Apex is and give an example of when you would use it.
Apex is Salesforce's proprietary, object-oriented programming language that runs on the Salesforce platform. You'd use it to write triggers (to execute logic when a record is created or updated) or scheduled jobs, for instance automating lead scoring when an Opportunity is closed won.
4. What is a trigger in Salesforce and what are the different trigger events?
A trigger is an Apex code block that executes automatically before or after a DML event on a record. Events are before insert, before update, before delete, after insert, after update, after delete, and after undelete; for example, you'd use before insert to validate data before saving a new Account.
5. What are governor limits in Salesforce and why do they matter?
Governor limits are restrictions Salesforce enforces to ensure platform stability, such as a maximum of 100 SOQL queries per transaction or 50,000 DML rows. They matter because exceeding them causes your code to fail; for instance, querying in a loop can quickly hit the SOQL limit, so you batch queries outside loops.
6. What is the difference between SOQL and SOSL, and when would you use each?
SOQL (Salesforce Object Query Language) searches single objects and returns records in order, like SQL; SOSL (Salesforce Object Search Language) searches multiple objects and fields for a keyword. Use SOQL to fetch all Accounts with Industry='Technology', and SOSL to search all Contacts, Accounts, and Leads for 'John' simultaneously.
7. You write a trigger that updates related records, but you're hitting governor limits. How would you troubleshoot and optimize this?
First, identify the bottleneck using debug logs or profiling; typically the issue is querying inside a loop. Refactor by bulkifying—fetch all related records outside the loop into a Map keyed by parent ID, then iterate once and look up values, reducing queries from hundreds to one or two.
8. What is a custom field in Salesforce and what are some common field types?
A custom field stores business-specific data on standard or custom objects. Common types include Text (names), Number (amounts), Currency (prices), Picklist (dropdown values), Date (dates), and Checkbox (true/false); for example, you'd use a Currency field to track deal size on an Opportunity.
9. Explain the difference between a Lookup field and a Master-Detail relationship.
A Lookup field is an optional link to another object that can be empty; a Master-Detail field is a required, parent-child relationship where deleting the parent deletes child records. Use Lookup when a Contact can optionally reference an Account, and Master-Detail when all Cases must belong to an Account.
10. What is a Lightning Web Component and when would you use it instead of Visualforce?
Lightning Web Component (LWC) is a modern, lightweight JavaScript framework for building UI on Salesforce; Visualforce is older and heavier. Use LWC for new projects—it's faster, mobile-friendly, and easier to maintain—like a custom dashboard displaying real-time pipeline data.
11. You deploy a code change to Production and users report unexpected behavior. What is your first step?
Check the Apex debug logs for the affected user to find errors or unexpected values, then trace through the code logic step-by-step to identify the root cause. For example, if a trigger fires on insert but the field calculation is wrong, logs would show what values were passed and where the logic failed.
12. What is the purpose of a test class in Apex and what is the minimum code coverage requirement?
A test class validates that your Apex code works correctly in isolation; Salesforce requires at least 75% code coverage (lines executed) before deploying to Production. For example, a test class for an Opportunity trigger would create test opportunities, invoke the trigger logic, and assert that calculations are correct.



