Salesforce Developer Interview Questions for MNCs

1. How do you debug an integration if any failure occurs?
2. Best practices in SQL queries
3. Querying Product & Product Line data
4. What is the Maximum number of Batch classes can be created in an org?
5. What is the maximum number of triggers can be created on an object?
6. Actual difference between Batch vs Queueable
7. Asset Object scenario:
▪ India region → show only Hardware
▪ China region → show only Software
8. How to enforce this during record creation?
9. Asset Object scenario:
▪ User1 → should see only Software records
▪ User2 → should see only Hardware
10.How to achieve?
11. Difference between View vs View All
12.Difference between View All vs View All Data
13.Difference between Modify All vs Modify All Data
14. If a user is deactivated → how to reactivate, and how to check why they were deactivated?
15. Common errors found during code reviews
16. In a Community profile → if a user cannot see an Account, how do you debug?

A user updates a field, but related records should also update. How will you design this (Trigger vs Flow)?
2️⃣ You need to prevent duplicate Lead creation from multiple channels (API, UI, Integration). How will you handle this?
3️⃣ A record is inserted via Integration, but validation rules should not fire. How do you manage this?
4️⃣ A manager should auto-approve requests if the amount is less than $5000 but should route to Director if above. How will you configure?
5️⃣ You need to send OTP verification before creating a Lead. How will you implement it in LWC + Apex?
6️⃣ Batch job fails at the 18,000 th record due to limits. How will you debug and fix it?
7️⃣ You need to migrate data from Legacy to Salesforce with parent-child relationships. How will you approach this?
8️⃣ An LWC should show fields dynamically based on picklist selection. How will you achieve this?
9️⃣ A scheduled job should run daily but must skip weekends. How will you implement?
🔟 How will you handle a scenario where SOQL query is hitting governor limits in a trigger?
1️⃣1️⃣ A Flow is failing because of too many DML operations. How will you optimize?
1️⃣2️⃣ A user should see only those opportunities that belong to their team. How will you set this up (Sharing Rules vs Apex Sharing)?
1️⃣3️⃣ You need to integrate Salesforce with an external REST API to fetch data on button click. How will you implement?
1️⃣4️⃣ A trigger should run only when a specific field changes, not for every update. How will you design this?
1️⃣5️⃣ In a bulk update scenario, you need to ensure child records are also updated without hitting limits. How will you design the solution?

1️⃣ Reverse a string in Apex without using built-in methods.
2️⃣ Find the first non-repeating character from a string.
3️⃣ Write an algorithm to detect duplicates in a List of Integers.
4️⃣ Implement a stack using Apex classes.
5️⃣ How would you check if a string is a palindrome?
6️⃣ Sort a list of custom objects by a specific field (without using sort() directly).
7️⃣ Given two sorted arrays, merge them into one sorted array.
8️⃣ Find the maximum occurring character in a string.
9️⃣ Implement recursion in Apex with an example (like factorial or Fibonacci).
🔟 Optimize SOQL queries with DSA-like thinking (bulkification + maps + sets).

  1. How would you handle a situation where a trigger on Opportunity causes recursive updates ?
  2. How do you handle large data processing (5M + records) in salesforce ?
  3. You need to integrate Salesforce with an external payment gateway. Which approach will you use ?
  4. A client wants real time notifications from salesforce to an external system. How can you implement it ?
  5. Explain a scenario where you optimized a slow SOQL query ?
  6. How do you handle file attachments migrations when moving from Classic to Ligtning ?
  7. How do you ensure Security in Apex code ?
  8. You need to schedule a daily job to clean up old records. Which approach will you use ?
  9. How will you design a custom approval process when the standard approval process doesn’t fit ?
  10. How would you implement pagination in LWC when dealing with thousands of records ?
  11. A trigger needs to insert related child records after a parent is created. How will you handle bulk insert ?
  12. How do you debug Apex issues in production ?
  13. Can you design a solution to handle dynamic forms in LWC ?
  14. How do you handle errors in Asynchronous Apex ?
  15. If two triggers exist on the same object, how do you control execution order ?

Apex Trigger Interview Questions

  1. Write a trigger that prevents an opportunity from being deleted if the opportunity stage is ‘closed won’ ?
  2. Write a trigger to ensure that the Account’s “AnnualRevenue” is updated every time an Opportunity is closed.
  3. Create a trigger to prevent the creation of duplicate contact records based on Email.
  4. Write a trigger that ensures a custom “Status” field on Account is updated when an opportunity is closed.
  5. Implement a trigger that calculates the total value of opportunities related to an Account and updates a custom field on the Account.
  6. Write a trigger to automatically populate the “Lead Source” field on an Account when a new contact is created.
  7. Write a trigger that prevents an opportunity from being created if the related Account has a “Status” of ‘inactive’.
  8. Create a trigger that updates a custom field on Opportunity when a related account is updated.
  9. Write a trigger that automatically sends an email when an opportunity is closed-won and its amount exceeds a certain value.
  10. Create a trigger to update a custom field on the Account when a related opportunity is closed-lost.
  11. Write a trigger that prevents creating a duplicate opportunity for the same Account and opportunity Name.
  12. Create a trigger that updates an Account’s “priority” when an Opportunity reaches a “Closed-won” stage.
  13. Implement a trigger that populate a custom “Total value” field on Account, summing up the “Amount” of related Opportunities.
  14. Write a trigger that prevents the deletion of a contact if there is an active opportunity related to that Contact.
  15. Write a trigger to ensure that the Opportunity ‘Close Date’ is always updated to a future date

Salesforce Interview Questions to crack Developer Role :

  1. How do you control trigger execution if multiple triggers exist on the same object ?
  2. How do you handle bulk insert/update operations efficiently in triggers ?
  3. Explain the difference between before and after triggers with an example where one must be preferred over the other ?
  4. How can you prevent recursion in triggers using static variables or handler frameworks ?
  5. What is a trigger execution context, how do you identify the current context during trigger execution ?
  6. How would you structure a Trigger framework to handle large-scale logic separation ?
  7. What are some best practices to make triggers reusable and maintainable ?
  8. How can you avoid SOQL injection and query limits in Apex ?
  9. What are the main differences between SOQL and SOSL in terms of performance and use cases ? Can you give an example scenario where SOSL is better than SOQL ?
  10. Explain how parent-to-child and child-to-parent relationships are queried using SOQL Subqueries ?
  11. What is the difference between Custom Metadata Types and Custom Settings in terms of deployment, accessibility and use cases ?
  12. What is the difference between DML statements and Database methods like Database.insert() or Database.update() and when should you use one over the other ?
  13. How can you control partial success and rollback in bulk DML operations using the allOrNone parameter ?
  14. What is Savepoint and Rollback, and how are they used for transaction control in Apex ?
  15. Explain OOPs concepts in Apex with real trigger or class-based examples ?
  16. What is the difference between public, private, protected and global access modifiers in Apex ?
  17. What are different types of Sandboxes and their best use cases ?
  18. Can we create a sandbox in a Developer Org ? Why or Why not ?
  19. How do you analyze and optimize code using Debug logs, and what key parameters shoul you look for ?
  20. What are the differences between Queueable, Future, Batch and Schedulable Apex ? When would you use each ?
  21. What are Governor Limits in Salesforce ? How do you monitor and handle them inside your code ?
  22. What’s the difference between synchronous and asynchronous Apex from a transaction and performance perspective ?
  23. How would you design a bulk data process that runs asynchronously while ensuring data integrity and avoiding governor limits ?

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top