Interviews


Salesforce Concepts and Definitions

What is a User?

  • A user is anyone who logs into Salesforce.
  • Users are typically employees (e.g., sales reps, managers, IT specialists) who need access to company records.
  • Each user has a user account with the following details:
  • Username
  • Email Address
  • First and Last Name
  • License
  • Profile
  • Role (optional)

What is a Profile?

  • Profiles determine what users can do in Salesforce.
  • They come with a set of permissions that grant access to specific objects, fields, tabs, and records.
  • Each user can have only one profile.
  • Profiles are assigned based on job functions (e.g., Standard User profile for most users).
  • Additional permissions can be granted using Permission Sets.

What are Roles?

  • Roles determine what users can see based on their position in the role hierarchy.
  • Users at the top of the hierarchy can see data owned by users below them.
  • Users at lower levels cannot see data owned by users above them unless sharing rules grant access.
  • Roles are optional but recommended for organizations with many users.

What does Salesforce do?

  • Salesforce provides CRM software and cloud-based solutions to help businesses manage customer data and track activities efficiently.

Salesforce Functionality

Can two users have the same profile? Can two profiles be assigned to the same user?

  • Yes, multiple users can have the same profile (e.g., all sales reps share a “Sales Profile”).
  • No, each user can have only one profile.

What are Governor Limits in Salesforce?

  • Governor Limits control how much data or how many records can be stored or processed in Salesforce.
  • They ensure no single client monopolizes shared resources in Salesforce’s multi-tenant architecture.
  • Types of Governor Limits:
  • Per-Transaction Apex Limits
  • Force.com Platform Apex Limits
  • Static Apex Limits
  • Size-Specific Apex Limits
  • Email Limits
  • Push Notification Limits

What is a Sandbox Org?

  • A Sandbox is a copy of the production environment used for testing and development.
  • Types of Sandboxes:
  • Developer
  • Developer Pro
  • Partial Copy
  • Full

Can you edit an Apex Trigger/Class in the Production Environment?

  • No, Apex Triggers and Classes cannot be edited directly in production. They must be developed in a Sandbox or Developer Org and deployed using tools like Change Sets or ANT.

Data Management and Reporting

What are the different data types for a standard field record name?

  • A standard field record name can have the following data types:
  • Auto Number: Automatically generates a unique number for each record.
  • Text: Limited to 80 characters.

What is WhoId and WhatId in Activities?

  • WhoId: Refers to people (e.g., LeadID, ContactID).
  • WhatId: Refers to objects (e.g., AccountID, OpportunityID).

What is the use of Sharing Rules?

  • Sharing Rules are used to extend access to records for users in public groups or roles.
  • They cannot be used to restrict data access.

What are the different types of Email Templates?

  • Text
  • HTML with Letterhead
  • Custom HTML
  • Visualforce

Reports and Dashboards

What is a Bucket Field in Reports?

  • A Bucket Field groups related records into categories without complex formulas or custom fields.
  • It simplifies filtering and arranging report data.

What are Dynamic Dashboards?

  • Dynamic Dashboards display user-specific data (e.g., personal sales quotas).
  • They cannot be scheduled as they show real-time data.

What are the different types of Reports?

  • Tabular
  • Summary
  • Matrix
  • Joined

Data Modeling and Relationships

What are the different types of Object Relationships?

  1. Master-Detail Relationship (1:n):
  • Parent controls child behavior.
  • Deleting the parent deletes the child (cascade delete).
  1. Lookup Relationship (1:n):
  • No dependency between parent and child.
  • Deleting the parent does not delete the child.
  1. Junction Relationship (Many-to-Many):
  • Created using two Master-Detail relationships.

What happens to child records when a parent record is deleted?

  • In a Master-Detail Relationship, child records are deleted.
  • In a Lookup Relationship, child records remain unaffected.

What is Data Skew?

  • Data Skew occurs when a single user or role owns most records for an object, causing performance issues during updates.

Apex and Coding

What is Apex?

  • Apex is an object-oriented programming language used to add business logic to Salesforce.

What are the types of Collections in Apex?

  • List: Ordered collection of elements.
  • Set: Unordered collection of unique elements.
  • Map: Collection of key-value pairs.

What is a Trigger?

  • A Trigger is Apex code that executes before or after DML operations (e.g., insert, update, delete).

What is a Batch Apex Class?

  • Batch Apex processes large datasets in chunks.
  • Methods:
  • start(): Collects records.
  • execute(): Processes each batch.
  • finish(): Executes post-processing tasks.

What is the @future Annotation?

  • The @future annotation marks methods for asynchronous execution.

Visualforce and UI

What is Visualforce?

  • Visualforce is a framework for building custom user interfaces in Salesforce.

How to hide the Header and Sidebar in Visualforce?

  • Use the following attributes:
  <apex:page showHeader="false" sidebar="false">

How to call a Controller Method from JavaScript?

  • Use actionFunction:
  <apex:actionFunction name="callFromJS" action="{!controllerMethod}" />

Integration and APIs

What is an External ID?

  • An External ID is a custom field used as a unique identifier for integrating external systems.

What is OAuth?

  • OAuth is an open-standard authorization protocol for secure API access.

What is a Connected App?

  • A Connected App integrates external applications with Salesforce using OAuth and SAML.

Testing and Deployment

Why do we write Test Classes?

  • Test classes ensure code quality and meet Salesforce’s 75% test coverage requirement for deployment.

What are the ways to deploy in Salesforce?

  • Change Sets
  • Force.com IDE
  • ANT Migration Tool
  • Salesforce Packages

Advanced Topics

What is a Wrapper Class?

  • A Wrapper Class is a custom class that groups multiple objects or fields for display on a Visualforce page.

What is the difference between SOQL and SOSL?

  • SOQL: Queries one object at a time.
  • SOSL: Searches multiple objects simultaneously.

What is Apex Managed Sharing?

  • Apex Managed Sharing allows developers to programmatically share records with users or groups.

Behavioral and Scenario-Based Questions

Q: How would you design a scalable solution to track Sales Reps’ performance?

  1. Create a Custom Object for performance metrics.
  2. Use Automation (Flow or Apex) to update metrics based on Opportunity changes.
  3. Build Dashboards for real-time performance tracking.
  4. Ensure Sharing Rules align with organizational hierarchy.

Q: How would you integrate Salesforce with an external Order Management System (OMS)?

  1. Use REST/SOAP APIs for data exchange.
  2. Implement Platform Events for real-time notifications.
  3. Use Middleware (e.g., Mulesoft) for data transformation and error handling.
  4. Ensure Security with OAuth 2.0 and encryption.


Salesforce General Questions

  1. What is the difference between a Lead and an Opportunity?
  • Lead: A potential prospect not yet qualified.
  • Opportunity: A qualified sales deal linked to an Account and Contact.
  1. How does the Sales Process work in Salesforce?
  • Leads → Qualification → Conversion to Account/Contact/Opportunity → Opportunity Stages → Closed-Won/Closed-Lost.
  1. What is a Profile in Salesforce?
  • Defines user permissions and access to objects, fields, and records.
  1. What is a Role in Salesforce?
  • Determines data visibility based on the role hierarchy.
  1. What is a Permission Set?
  • Extends user permissions without modifying their profile.
  1. What is a Sandbox?
  • A copy of the production environment for testing and development.
  1. What are Governor Limits?
  • Salesforce-imposed limits to ensure fair resource usage in a multi-tenant environment.
  1. What is a Custom Object?
  • A database table created to store unique business data.
  1. What is a Junction Object?
  • Used to create many-to-many relationships between two objects.
  1. What is a Roll-Up Summary Field?
    • Aggregates data from child records in a master-detail relationship.

Integration Questions

  1. How would you integrate Salesforce with an external system?
    • Use REST/SOAP APIs, Middleware (e.g., Mulesoft), or Platform Events.
  2. What are Platform Events?
    • Asynchronous messages for real-time integration between systems.
  3. What is OAuth?
    • An open-standard protocol for secure API authentication.
  4. What is a Connected App?
    • An external application integrated with Salesforce using OAuth.
  5. What is an External ID?
    • A unique identifier for integrating external systems.
  6. What is the difference between REST and SOAP APIs?
    • REST: Lightweight, uses HTTP methods (GET, POST).
    • SOAP: More structured, uses XML.
  7. How do you handle large data volumes in integrations?
    • Use Bulk API for asynchronous processing of large datasets.
  8. What is an Outbound Message?
    • A workflow action that sends data to an external system.
  9. What is the difference between Trigger and Process Builder?
    • Trigger: Code-based automation.
    • Process Builder: Declarative automation with a user interface.
  10. What is the use of Middleware in integrations?
    • Handles data transformation, error handling, and retries.

Coding Questions

  • Write an Apex Trigger to update an Opportunity Stage.
  • trigger UpdateOpportunityStage on Task (after update) { Set<Id> oppIds = new Set<Id>(); for (Task t : Trigger.new) { if (t.WhatId != null && t.WhatId.startsWith('006') && t.Subject == 'Final Review' && t.Status == 'Completed') { oppIds.add(t.WhatId); } } if (!oppIds.isEmpty()) { List<Opportunity> opps = [SELECT Id, StageName FROM Opportunity WHERE Id IN :oppIds]; for (Opportunity opp : opps) { opp.StageName = 'Closed-Won'; } update opps; } }
  • Write a SOQL query to retrieve Accounts with Opportunities in the ‘Negotiation’ stage. SELECT Id, Name, (SELECT Id, StageName, Amount FROM Opportunities WHERE StageName = 'Negotiation') FROM Account;
  • What is the difference between “with sharing” and “without sharing” in Apex?
    • With Sharing: Enforces user-level permissions.
    • Without Sharing: Ignores permissions (system context).
  • What is a Batch Apex Class?
    • Processes large datasets in chunks.
    • Methods: start(), execute(), finish().
  • What is the @future Annotation?
    • Marks methods for asynchronous execution.
  • What is a Wrapper Class?
    • A custom class that groups multiple objects or fields.
  • What is a Map in Apex?
    • A collection of key-value pairs.
  • What is a Set in Apex?
    • A collection of unique elements.
  • What is a List in Apex?
    • An ordered collection of elements.
  • What is a Trigger?
    • Apex code that executes before or after DML operations.

Design Questions

  1. How would you design a scalable solution to track Sales Reps’ performance?
    • Use a Custom Object, Automation (Flow/Apex), and Dashboards.
  2. How would you design a Salesforce-to-Salesforce integration?
    • Use Data Mapping, Platform Events, and Middleware.
  3. What is the difference between Page Layout and Record Type?
    • Page Layout: Controls the layout of fields and buttons.
    • Record Type: Defines different business processes for the same object.
  4. What is a Dynamic Dashboard?
    • Displays user-specific data in real-time.
  5. What is a Bucket Field in Reports?
    • Groups related records into categories.
  6. What is a Sharing Rule?
    • Extends record access to users in public groups or roles.
  7. What is a Validation Rule?
    • Ensures data integrity by enforcing business rules.
  8. What is a Workflow Rule?
    • Automates actions based on record changes.
  9. What is a Process Builder?
    • A declarative tool for automating complex business processes.
  10. What is a Flow?
    • A declarative tool for building business processes with a visual interface.

Testing and Deployment

  1. Why do we write Test Classes?
    • To ensure code quality and meet Salesforce’s 75% test coverage requirement.
  2. What is the minimum test coverage required for deployment?
    • 75%.
  3. What are the ways to deploy in Salesforce?
    • Change Sets, Force.com IDE, ANT Migration Tool, Salesforce Packages.
  4. What is a Change Set?
    • A group of components migrated between Salesforce orgs.
  5. What is a Debug Log?
    • Tracks Apex code execution for troubleshooting.
  6. What is a Test Method?
    • A method annotated with @isTest to validate Apex code.
  7. What is a Test Data Factory?
    • A utility class to create test data for unit tests.
  8. What is a Sandbox Refresh?
    • Updating a Sandbox with the latest data from production.
  9. What is a Deployment Checklist?
    • A list of steps to ensure a smooth deployment.
  10. What is a Rollback in Deployment?
    • Reverting to the previous version if the deployment fails.

Advanced Topics

  1. What is Apex Managed Sharing?
    • Programmatically sharing records with users or groups.
  2. What is a Visualforce Page?
    • A custom user interface built using HTML and Apex.
  3. What is a Lightning Component?
    • A reusable UI component for Lightning Experience.
  4. What is a Lightning Web Component (LWC)?
    • A modern framework for building Lightning components.
  5. What is the difference between SOQL and SOSL?
    • SOQL: Queries one object.
    • SOSL: Searches multiple objects.
  6. What is a Static Resource?
    • Files (e.g., images, CSS) uploaded to Salesforce for use in Visualforce or Lightning.
  7. What is a Custom Label?
    • A reusable text value for multilingual applications.
  8. What is a Custom Setting?
    • A reusable set of data accessible across the org.
  9. What is a Custom Metadata Type?
    • A reusable configuration dataset deployable across environments.
  10. What is a Data Skew?
    • Performance issues caused by uneven data distribution (e.g., one user owning most records).