Site icon Trailhead Titans

Top 5 MNC Salesforce Developer Interview Questions & Answers – Complete Guide to Crack Accenture, Deloitte, Cognizant, Capgemini & TCS

Preparing for Salesforce interviews? This guide brings you real questions and expert answers straight from Accenture, Deloitte, Cognizant, Capgemini, and TCS — so you can walk into your interview fully prepared and confident.

Table of Contents

Toggle

1. Trigger vs Flow – When would you choose each?

Answer:

Flow (Declarative)
Use when:

Trigger (Apex)
Use when:

Accenture Tip:

👉 Always say: “Flow first, Apex only when required”
They prefer low-code solutions.


2. What is Bulkification? Why is it critical?

Answer:

Salesforce processes 200 records at once, not one.

❌ Wrong:

for(Account a: Trigger.new){
   update a;
}

✅ Correct:

update Trigger.new;

Why important?


3. Explain Governor Limits with examples.

Answer:

Common limits:

Avoid:

Use:


4. How would you process 1 million records?

Answer:

Use:

Database.executeBatch(new MyBatch(), 200);

Why?


5. What is the Order of Execution?

Answer (high level):

  1. Validation rules
  2. Before triggers
  3. After triggers
  4. Assignment rules
  5. Workflow/Flow
  6. Rollups
  7. Commit

👉 Important for debugging issues.


6. How do you prevent recursive triggers?

Answer:

Use static variable.

public class TriggerHelper{
  public static Boolean runOnce = true;
}

Check before execution.

Why?

Prevents infinite loops → CPU limit exceeded.


7. Explain Sharing Model.

Answer:

Layers:

  1. OWD
  2. Role hierarchy
  3. Sharing rules
  4. Manual
  5. Apex sharing

Example:

OWD = Private
Share with Sales team using rule.


8. Difference between Future, Queueable, Batch?

Answer:

FeatureFutureQueueableBatch
Recordssmallmediummillions
Chaining
Monitoring

👉 Prefer Queueable over Future


9. What is Selective Query?

Answer:

Query using:

Example:

SELECT Id FROM Account WHERE CreatedDate = TODAY

Improves performance.


10. Explain Integration options in Salesforce.

Answer:

Tools:

Patterns:


11. What is LWC lifecycle?

Answer:

Hooks:

Used for:


12. Difference LWC vs Aura?

Answer:

FeatureLWCAura
SpeedFasterSlower
Modern JSYesNo
MemoryLowHigh

👉 Accenture prefers LWC always.


13. How to secure Apex code?

Answer:

Use:

Example:

Schema.sObjectType.Account.isAccessible()

14. What is Test Class best practice?

Answer:


15. How do you handle callouts?

Answer:

Because triggers cannot make synchronous callouts.


16. Explain Wrapper Class.

Answer:

Custom class holding multiple objects.

Used for:


17. What is Skinny Table?

Answer:

Used when performance is slow.


18. How to debug production issue?

Answer:

Steps:

  1. Debug logs
  2. Check limits
  3. Replicate in sandbox
  4. Add logs
  5. Fix & deploy

19. How do you deploy changes?

Answer:

Options:

Best practice:
Dev → UAT → Prod


20. Design: Email approval without login?

Answer:

Solution:

Real enterprise use case Accenture asks often.

1. A trigger is hitting CPU limit. How will you troubleshoot?

Answer:

Steps:

  1. Check debug logs → CPU time
  2. Find nested loops
  3. Move logic outside loops
  4. Use Maps/Sets
  5. Shift heavy logic to Queueable/Batch

Deloitte expects:

👉 “Analyze first, then optimize — not random fixes.”


2. Client wants real-time sync between Salesforce and SAP. How would you design?

Answer:

Architecture:

Why middleware?

Direct callouts = risky.


3. Multiple developers editing same object → deployment conflicts. Solution?

Answer:

Use:

Flow:
Dev → Merge → UAT → Prod

Benefit:

Avoid metadata overwrite.


4. How would you design a reusable trigger framework?

Answer:

Structure:

Example:

trigger AccountTrigger on Account(before insert, after update){
   AccountHandler.handle();
}

Benefits:


5. A Flow is slow with 50k records. What would you do?

Answer:

Flows are not ideal for bulk.

Solution:

Deloitte thinking:

Right tool > declarative always.


6. Client wants audit history for 10 years. How do you design?

Answer:

Options:

Best:
Big Objects for large history.


7. When would you use Platform Cache?

Answer:

Use for:

Benefits:

Example:
Store product pricing.


8. Users complain Lightning page is slow. How optimize?

Answer:

Measure using Lightning Performance tool.


9. How to handle duplicate data in Salesforce?

Answer:

Use:

Design:
Prevent + clean existing data.


10. How do you design multi-step approval logic?

Answer:

Options:

Use Flow when dynamic steps required.


11. Client needs 24/7 integration reliability. What design choices?

Answer:

Deloitte loves reliability planning.


12. Explain difference between Custom Metadata vs Custom Settings.

Answer:

FeatureCMDTSettings
DeployableYesNo
RecommendedYesLegacy
Use caseConfig dataOld configs

Always choose CMDT.


13. How would you migrate 5M records?

Answer:

Never single transaction.


14. What is record locking? How prevent?

Answer:

Occurs when multiple updates same record.

Prevent:


15. How to secure sensitive fields (salary, SSN)?

Answer:

Security-first design.


16. Client wants dynamic UI based on role. How implement?

Answer:

Options:

Prefer declarative first.


17. How would you test callouts?

Answer:

Use:

HttpCalloutMock
Test.setMock()

Never real endpoints.

Ensures reliable testing.


18. How to handle multiple long-running jobs?

Answer:

Plan job sequencing.


19. When would you use External Objects?

Answer:

When:

Benefits:


20. Client asks: “Flow or Apex for complex business logic?” What do you say?

Answer:

Decision rule:

If:

👉 Deloitte wants justified decision making, not blind preference.

1. Write a trigger to prevent duplicate Contacts based on Email.

Answer:

trigger PreventDuplicateContact on Contact(before insert){
    Set<String> emails = new Set<String>();

    for(Contact c : Trigger.new){
        if(c.Email != null)
            emails.add(c.Email);
    }

    Map<String, Contact> existing =
        new Map<String, Contact>(
            [SELECT Email FROM Contact WHERE Email IN :emails]
        );

    for(Contact c : Trigger.new){
        if(existing.containsKey(c.Email)){
            c.addError('Duplicate Email not allowed');
        }
    }
}

Why?

👉 Cognizant loves small coding tasks like this.


2. Difference between before and after triggers with use cases?

Answer:

Before

After

Example:

Before → set default status
After → create child Opportunity


3. How do you handle Null Pointer Exception in Apex?

Answer:

Use:

Example:

if(acc != null && acc.Name != null)

Or:

String name = acc?.Name;

Why?

Prevents runtime failures.


4. How to send email automatically after record creation?

Answer:

Options:

Preferred:

Flow for simple use case.


5. Explain Map vs List vs Set with example.

Answer:

List

Set

Map

Example:

Map<Id, Account> accMap;

Use Map for fast lookup (O(1)).


6. A query returns “Too many SOQL queries 101”. How fix?

Answer:

Problem:
SOQL inside loop.

Fix:

Bad:

for(){
   [SELECT...]
}

Good:
Single query before loop.


7. How to create parent-child records together?

Answer:

Use:

insert parent;
child.ParentId = parent.Id;
insert child;

Or composite REST API.


8. What is @AuraEnabled(cacheable=true)?

Answer:

Used in LWC.

Benefits:

Only for read-only methods.


9. How do you deploy a hotfix in production quickly?

Answer:

Steps:

  1. Reproduce issue in sandbox
  2. Fix code
  3. Test class
  4. Quick deploy change set / SFDX
  5. Validate post deploy

Cognizant cares about support mindset.


10. How to convert Lead automatically when criteria met?

Answer:

Use:

Example:

Database.LeadConvert lc = new Database.LeadConvert();
Database.convertLead(lc);

11. What is Database.insert(list, false)?

Answer:

Partial success.

Used in bulk loads.


12. How to avoid hardcoding IDs?

Answer:

Use:

Never:

'001xx000003ABC'

13. Explain @TestSetup usage.

Answer:

Creates common test data once.

Benefits:

Example:

@TestSetup
static void setup(){
   insert new Account(Name='Test');
}

14. How to handle large file uploads in Salesforce?

Answer:

Use:

Avoid Attachments (deprecated).


15. How to restrict picklist values by role?

Answer:

Options:

Preferred:
Record Types + picklist values.


16. What happens if two triggers exist on same object?

Answer:

Execution order not guaranteed.

Best practice:
👉 One trigger per object + handler class.


17. How to schedule job daily at midnight?

Answer:

System.schedule('DailyJob','0 0 0 * * ?', new MySchedulable());

Uses CRON expression.


18. How to rollback transaction manually?

Answer:

Use Savepoint.

Savepoint sp = Database.setSavepoint();
Database.rollback(sp);

Used for safe error handling.


19. Explain difference between Profiles and Permission Sets.

Answer:

Profile:

Permission Set:

Best practice:
Minimal profile + permission sets.


20. Client says “System slow during data load”. What steps?

Answer:

Focus:

Performance + stability.

1. Client wants to automate record creation when Opportunity is Closed Won. How would you implement?

Answer:

Options:

Best approach:

👉 Record-triggered Flow

Steps:

  1. Trigger on update
  2. Condition → Stage = Closed Won
  3. Create related record (Invoice/Project)

Why?

Capgemini prefers low-code first.


2. How do you migrate metadata between orgs safely?

Answer:

Tools:

Process:

Dev → SIT → UAT → Prod

Steps:

Why?

Reduces production risk.


3. What is the difference between Sandbox types?

Answer:

TypeDataUse
DevNoCoding
Dev ProMore storageTesting
PartialSample dataUAT
FullFull copyPerformance/Prod-like

Choose based on requirement.


4. How would you implement field-level auditing?

Answer:

Options:

For enterprise:
👉 Shield for long-term history.


5. A Flow is throwing “Too many DML rows”. What’s your fix?

Answer:

Cause:
Flow updating too many records.

Fix:

Lesson:

Flow not good for massive bulk.


6. Explain the use of Custom Labels.

Answer:

Used for:

Example:

Label.Welcome_Message

Helpful for global clients.


7. Client wants different page layouts for Sales and Support teams. How design?

Answer:

Use:

Preferred:
👉 Record Types + Layout assignment

More scalable.


8. What is a Junction Object? When use?

Answer:

Used for:
Many-to-Many relationship.

Example:
Student ↔ Course
Create Enrollment object.

Requires 2 Master-Detail relationships.


9. How do you handle data validation?

Answer:

Options:

Best:
Validation Rules for simple checks.

Example:

ISBLANK(Phone)

10. Client needs file storage for documents. Which approach?

Answer:

Use:

Avoid:
Attachments (deprecated)

Benefits:


11. What is the difference between Public Group and Queue?

Answer:

Public Group:

Queue:

Example:
Cases assigned to Support Queue.


12. How to improve report performance?

Answer:

Large reports slow down dashboards.


13. Explain use of Permission Set Groups.

Answer:

Combine multiple permission sets.

Benefits:

Better than assigning many sets individually.


14. How would you schedule weekly data cleanup?

Answer:

Options:

For small → Flow
For large → Batch Apex

Example:
Delete old logs weekly.


15. What is Metadata API?

Answer:

Used for:

Tools:
SFDX, VS Code

Used heavily in enterprise releases.


16. Client wants dependent dropdowns. How implement?

Answer:

Use:
Field Dependency

Example:
Country → State

No code required.


17. What is Rollback behavior in Salesforce transactions?

Answer:

If error occurs:
All DML rolled back automatically.

Manual:

Savepoint sp = Database.setSavepoint();
Database.rollback(sp);

Ensures safe operations.


18. How to manage large picklist values dynamically?

Answer:

Options:

Best:
Store in Custom Metadata for flexibility.


19. Client wants multilingual support. How handle?

Answer:

Use:

Common in global Capgemini projects.


20. Describe your approach to production support issues.

Answer:

Steps:

  1. Understand issue
  2. Check logs
  3. Reproduce in sandbox
  4. Fix
  5. Test
  6. Deploy hotfix
  7. Monitor

Capgemini values structured troubleshooting.

1. What happens when a record is deleted in Master-Detail vs Lookup?

Answer:

Master-Detail

Lookup

Use case:

Order → Order Items → Master-Detail
Contact → Account → Lookup


2. How do you fetch related child records in SOQL?

Answer:

Use subquery.

Example:

SELECT Name, (SELECT LastName FROM Contacts)
FROM Account

Benefit:

Single query instead of multiple queries.

Improves performance.


3. User says “I can’t see a field”. How do you troubleshoot?

Answer:

Check:

  1. Field-Level Security
  2. Page Layout
  3. Profile/Permission Set
  4. Record Type
  5. Sharing

TCS expects:

Step-by-step debugging approach.


4. Difference between Workflow Rule and Flow?

Answer:

Workflow:

Flow:

Recommendation:

Always Flow.


5. How do you call Apex from LWC?

Answer:

Use:

import methodName from '@salesforce/apex/ClassName.methodName';

Two ways:

Use @wire for read-only.


6. What is the purpose of Schema Builder?

Answer:

Visual tool to:

Good for quick design.


7. How do you restrict record deletion?

Answer:

Options:

Best:
Permission control first.


8. How would you clone a record with related child records?

Answer:

Steps:

  1. Clone parent
  2. Query children
  3. Clone children
  4. Assign new parent Id

Example:

child.ParentId = newParent.Id;

9. Explain use of Formula Fields.

Answer:

Used for:

Example:
Total = Qty * Price

Benefits:
Real-time calculation.


10. How to handle “Mixed DML Operation” error?

Answer:

Occurs when:
Setup + Non-setup objects together.

Example:
User + Account

Fix:

Use:


11. What is the use of Static Resource?

Answer:

Store:

Used in:
LWC/Visualforce

Example:
Bootstrap, jQuery


12. How do you create a custom REST API in Salesforce?

Answer:

Use:

@RestResource(urlMapping='/account/*')
global with sharing class MyAPI {}

Methods:

Used for integrations.


13. How to prevent users from editing Closed records?

Answer:

Validation Rule:

ISPICKVAL(Status,'Closed')

OR before trigger.

Preferred:
Validation Rule.


14. What is Data Skew and how to fix?

Answer:

Occurs when:
Too many child records linked to one parent (10k+)

Problems:

Fix:


15. How do you export large data?

Answer:

Tools:

For millions:
Bulk API best.


16. What is Lightning Data Service (LDS)?

Answer:

Used to:

Benefits:

Used in LWC.


17. How do you handle validation across multiple objects?

Answer:

Options:

Because validation rule cannot check cross-object easily.


18. How to track who modified a record?

Answer:

Standard fields:

Or enable Field History Tracking.


19. What is the difference between Hard Delete and Soft Delete?

Answer:

Soft delete:

Hard delete:

Use Bulk API Hard delete carefully.


20. Client reports “Automation running twice”. How troubleshoot?

Answer:

Check:

Fix:

TCS expects:

Root cause analysis.

✨Looking for real interview questions, real answers, and real success stories?
You’re one click away from leveling up your Salesforce career.

🔗 www.trailheadtitanshub.com
Learn from real interviews. Prepare like a pro.

Exit mobile version