Site icon Trailhead Titans

Latest 2025 Salesforce Developer Interview Questions – Company-Wise (TCS, Deloitte, Capgemini, Infosys)

Salesforce interviews are becoming more scenario-driven in 2025. Instead of asking definitions, companies like TCS, Deloitte, Capgemini, Infosys now focus on real-time problem solving with Apex, LWC, SOQL, Flows, and Integration.

We’ve compiled the Top 100 Scenario-Based Questions with Answers asked in these companies to help you crack your next Salesforce interview.

🏢 TCS Salesforce Developer Interview Questions (25 Scenario-Based, 2025)

Table of Contents

Toggle

Q1. How do you avoid “Too Many SOQL Queries” error in Triggers?

Answer:
By bulkifying triggers: query outside loops, use Map/Set, and handle all records at once.

trigger AccountTrigger on Account (before insert, before update) {
    Set<String> emails = new Set<String>();
    for(Account acc : Trigger.new){
        emails.add(acc.Email__c);
    }
    Map<String, Contact> existingContacts = new Map<String, Contact>(
        [SELECT Id, Email FROM Contact WHERE Email IN :emails]
    );
    for(Account acc : Trigger.new){
        if(existingContacts.containsKey(acc.Email__c)){
            acc.addError('Duplicate Email Found!');
        }
    }
}

Tip: TCS tests governor limits awareness.


Q2. You have to update 10,000 Accounts nightly. What’s the best approach?

Answer: Use Batch Apex with scope size of 200 to avoid DML/SOQL limits.


Q3. A trigger is firing twice on the same update. How do you prevent recursion?

Answer: Use a static variable in a handler class to prevent multiple executions.


Q4. How will you design a Trigger Framework in TCS projects?

Answer:


Q5. How do you display 50,000+ records in LWC without hitting limits?

Answer:


Q6. How do you optimize a SOQL query fetching related child records?

Answer: Use parent-to-child relationship queries:

[SELECT Id, Name, (SELECT Id, LastName FROM Contacts) FROM Account];

Q7. How do you enforce field-level security in Apex before returning data to LWC?

Answer:

if(Schema.sObjectType.Account.fields.Phone.isAccessible()){
    // return Phone field
}

Q8. How do you call an Apex method from LWC and handle errors?

Answer: Use @AuraEnabled with try-catch, and in LWC use .catch(error) to display toast.


Q9. When will you prefer Future vs Queueable vs Batch Apex?

Answer:


Q10. How do you handle duplicate record prevention in TCS projects?

Answer:


Q11. Suppose governor limits are hit in Flow – what’s your solution?

Answer:


Q12. How do you handle record locking errors in bulk updates?

Answer:


Q13. How to design a trigger when multiple child records update the parent’s field (roll-up)?

Answer: Use Aggregate SOQL instead of looping.

AggregateResult[] results = [SELECT AccountId, SUM(Amount) total FROM Opportunity GROUP BY AccountId];

Q14. How do you optimize a query when asked to fetch Accounts with Opportunities and Contacts?

Answer: Use SOQL relationships:

[SELECT Id, Name, 
    (SELECT Id, Name FROM Opportunities), 
    (SELECT Id, Email FROM Contacts) 
 FROM Account];

Q15. How do you implement error handling framework in Apex?

Answer:


Q16. You have to restrict access to a custom button in LWC based on Profile. How will you do it?

Answer:


Q17. How to make SOQL queries dynamic in Apex?

Answer: Use Database.query().

String soql = 'SELECT Id, Name FROM Account WHERE Industry = \'Banking\'';
List<Account> accs = Database.query(soql);

Q18. How do you test callouts in Apex test classes?

Answer: Use HttpCalloutMock.


Q19. How do you avoid hardcoding record type IDs in Apex?

Answer:

Id rtId = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Business').getRecordTypeId();

Q20. How to handle large data export in Salesforce?

Answer:


Q21. A user complains reports are slow. How will you investigate?

Answer:


Q22. How do you implement caching in Apex for frequently used queries?

Answer: Store results in Platform Cache.


Q23. How to enforce sharing rules in an Apex class?

Answer: Declare class as with sharing.


Q24. How do you schedule a job that runs every day at midnight?

Answer:

String cron = '0 0 0 * * ?';
System.schedule('Daily Job', cron, new MySchedulableClass());

Q25. How do you ensure your code passes Salesforce code coverage requirements (75%)?

Answer:

💡 Deloitte Salesforce Developer Interview Questions (25 Scenario-Based, 2025)

Q1. How do you handle error logging in asynchronous Apex (Batch, Queueable, Future)?

Answer:
I’d use a custom Error_Log__c object to capture: Class, Method, Error Message, Stack Trace.

try {
   // business logic
} catch (Exception ex) {
   insert new Error_Log__c(
       Class_Name__c = 'MyBatch',
       Method_Name__c = 'execute',
       Error_Message__c = ex.getMessage(),
       Stack_Trace__c = ex.getStackTraceString()
   );
}

Tip: Deloitte checks enterprise-level error handling frameworks.


Q2. How do you design a solution when multiple automation tools (Flow, Process Builder, Triggers) are conflicting?

Answer:


Q3. Requirement: When Opportunity Stage = “Closed Won”, create a Contract & send email. How will you design this?

Answer:


Q4. How do you manage deployment of large Flows from Sandbox to Production?

Answer:


Q5. How do you design an approval process that changes dynamically based on Opportunity Amount?

Answer:


Q6. How do you avoid hitting governor limits when updating 1M records?

Answer:


Q7. How do you manage data migration in Deloitte projects?

Answer:


Q8. You need to integrate Salesforce with SAP. How will you handle authentication?

Answer:


Q9. How do you monitor asynchronous jobs in Production?

Answer:


Q10. How to handle governor limits in a Flow with 10,000 records?

Answer:


Q11. How do you implement single sign-on (SSO) in Salesforce?

Answer:


Q12. How do you design multi-currency solutions?

Answer:


Q13. How do you secure Salesforce APIs exposed to external systems?

Answer:


Q14. How do you implement error handling in Flows?

Answer:


Q15. How do you prevent recursive triggers in Deloitte projects?

Answer:

public class TriggerHelper {
   public static Boolean isExecuted = false;
}

Q16. You need to mask sensitive fields like SSN. How do you implement this?

Answer:


Q17. How do you handle record sharing dynamically in Apex?

Answer:

AccountShare share = new AccountShare(
   AccountId = acc.Id,
   UserOrGroupId = userId,
   AccessLevel = 'Read'
);
insert share;

Q18. How do you improve performance of a query-heavy system?

Answer:


Q19. How do you enforce GDPR compliance in Salesforce?

Answer:


Q20. How do you schedule jobs across multiple orgs in Deloitte clients?

Answer:


Q21. How do you avoid hardcoding profile/role IDs?

Answer:

Id profileId = [SELECT Id FROM Profile WHERE Name = 'System Administrator'].Id;

Q22. How do you migrate metadata between multiple environments efficiently?

Answer:


Q23. How do you manage governor limits in a trigger handling multiple objects?

Answer:


Q24. How do you implement caching for external API calls?

Answer:


Q25. How do you test async Apex (Future/Queueable/Batch) in test classes?

Answer:

🌍 Capgemini Salesforce Developer Interview Questions (25 Scenario-Based, 2025)

Q1. How do you integrate Salesforce with an external REST API?

Answer:

Http http = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:WeatherAPI/current');
req.setMethod('GET');
HttpResponse res = http.send(req);

if(res.getStatusCode() == 200){
   Map<String,Object> result = (Map<String,Object>)JSON.deserializeUntyped(res.getBody());
   System.debug('Temp: ' + result.get('temperature'));
}

Tip: Capgemini often tests integration patterns.


Q2. How do you handle JSON response with nested objects?

Answer: Use Wrapper Class.

public class WeatherWrapper {
   public String city;
   public Forecast forecast;
   public class Forecast {
      public String condition;
      public Double temperature;
   }
}
WeatherWrapper data = (WeatherWrapper) JSON.deserialize(res.getBody(), WeatherWrapper.class);

Q3. How do you secure external callouts in Salesforce?

Answer:


Q4. How do you enforce field-level security in LWC dynamically?

Answer:

if(Schema.sObjectType.Account.fields.Phone.isAccessible()){
   return acc.Phone;
}

Q5. How do you implement OAuth 2.0 integration in Salesforce?

Answer:


Q6. You need to call an external API after inserting a record. How do you design it?

Answer:


Q7. How do you prevent excessive API calls in integration?

Answer:


Q8. How do you expose Salesforce data to an external system securely?

Answer:


Q9. How do you test callouts in Apex test classes?

Answer: Implement HttpCalloutMock.

Test.setMock(HttpCalloutMock.class, new MyMockResponse());

Q10. How do you handle long-running external API calls?

Answer:


Q11. How do you parse large JSON responses in Salesforce?

Answer:


Q12. How do you handle API authentication when tokens expire?

Answer:


Q13. How do you integrate Salesforce with AWS?

Answer:


Q14. How do you ensure data security in Salesforce Integrations?

Answer:


Q15. How do you implement real-time sync between Salesforce and external system?

Answer:


Q16. How do you handle bulk API callouts in Salesforce?

Answer:


Q17. How do you log API callouts for audit purposes?

Answer:


Q18. How do you design a middleware-based integration in Capgemini projects?

Answer:


Q19. How do you consume SOAP services in Salesforce?

Answer:


Q20. How do you prevent DML inside loops in integrations?

Answer:


Q21. How do you restrict user access to external API integration?

Answer:


Q22. How do you schedule daily data sync with an external API?

Answer:

String cron = '0 0 2 * * ?'; // daily at 2AM
System.schedule('DailySync', cron, new MySchedulable());

Q23. How do you manage governor limits in large API integrations?

Answer:


Q24. How do you optimize queries in an integration-heavy org?

Answer:


Q25. How do you handle retry logic for failed API calls?

Answer:

🌐 Infosys Salesforce Developer Interview Questions (25 Scenario-Based, 2025)

Q1. How do you schedule a job to run every Monday at 6 AM?

Answer:
Use Schedulable Apex with CRON expression.

global class WeeklyJob implements Schedulable {
   global void execute(SchedulableContext sc) {
       System.debug('Weekly Job Running...');
   }
}
String cron = '0 0 6 ? * MON';
System.schedule('WeeklyJob', cron, new WeeklyJob());

Q2. A user reports that a Flow fails when processing 5,000 records. How do you optimize it?

Answer:


Q3. How do you avoid hitting CPU time limit in a Trigger?

Answer:


Q4. How do you prevent data skew issues?

Answer:


Q5. How do you debug a Flow error in Production?

Answer:


Q6. How do you schedule a Flow in Infosys projects?

Answer:


Q7. How do you migrate 1 million records to Salesforce?

Answer:


Q8. How do you ensure high test coverage for async jobs?

Answer:


Q9. How do you secure custom REST APIs in Salesforce?

Answer:


Q10. How do you design a solution when multiple systems update the same record?

Answer:


Q11. How do you optimize an LWC fetching 10,000 records?

Answer:


Q12. How do you avoid SOQL injection in Apex?

Answer:

String industry = 'Banking';
List<Account> accs = [SELECT Id, Name FROM Account WHERE Industry = :industry];

Q13. How do you handle async chaining in Infosys projects?

Answer:


Q14. How do you log Flow errors automatically?

Answer:


Q15. How do you enforce FLS (Field Level Security) in SOQL queries?

Answer:

if(Schema.sObjectType.Contact.fields.Phone.isAccessible()){
   // query Phone field
}

Q16. How do you implement record-level sharing dynamically?

Answer:


Q17. How do you design for scalability in Infosys enterprise projects?

Answer:


Q18. How do you debug CPU time limit exceeded in Production?

Answer:


Q19. How do you implement a retry mechanism for failed async jobs?

Answer:


Q20. How do you ensure Apex triggers scale for large datasets?

Answer:


Q21. How do you enforce GDPR compliance in Infosys Salesforce projects?

Answer:


Q22. How do you handle governor limits when exporting large data sets?

Answer:


Q23. How do you test platform events in Apex test classes?

Answer:


Q24. How do you avoid recursive updates in Flows?

Answer:


Q25. How do you design approval processes that scale across multiple business units?

Answer:

📚 More Resources for You

🚀 Trusted by 1000+ learners to crack interviews at TCS, Infosys, Wipro, EY, and more.

Here are some resources to go deeper:

🔗 100 Scenarios (1–4 YOE)
🔗 100 Scenarios (4–8 YOE)
🔗 LWC Q&A (Real Answers Explained)
🔗 600+ Qs from Recruiter Calls
🔗 TCS, Infosys, EY Interview Qs
🔗 Salesforce Project – Hindi + English

Exit mobile version