1. How do components communicate in LWC?
- Parent to Child: Use public properties with @api.
- Child to Parent: Use custom events.
- Sibling Components: Use custom events via a common parent.
- Unrelated Components: Use Lightning Message Service (LMS) or PubSub.
2.What is Batchable in Apex?
- It’s an Apex interface used to process large data volumes asynchronously.
- Methods: start(), execute(), and finish().
- Helps avoid governor limits by processing data in manageable chunks.
3. Why do we use interfaces in Apex?
- To define a contract for classes.
- Enables abstraction, polymorphism, and test mockability
- Common interfaces: Batchable, Schedulable, Queueable.
4. What is a Promise and Promise.all in LWС?
- Promise handles asynchronous operations.
- Promise.all runs multiple promises in parallel and resolves when all succeed.
- Useful for concurrent Apex or API calls.
5. What are decorators in LWC?
- @track: Used for tracking changes in complex objects (mostly deprecated).
- @api: Exposes properties/methods to parent components.
- @wire: Connects to Salesforce data reactively.
6. What does LAST_N_MONTHS:N do in SOQL?
- Retrieves records from the start of the current month going back N months.
- Example: LAST_N_MONTHS:6 includes the current and past 5 months.
7. Any unique ideas you implemented in your project?
- Role-Based Access Control with Apex + Custom Metadata.
- Bulk email scheduler using Batch + Future.
- Real-time LWC dashboards using polling logic.
8. How would you build a cab booking system in Salesforce?
- Create objects: User_c, Cab_ c, Booking_c, Discount_c.
- Use lookups between Booking_c and Cab/User.
- Apply discounts using Apex logic and Custom Metadata.
- Use flows/workflows for special conditions like new users.
9.How would you update 9 related Opportunities without direct DML?
- Update records in memory and return to Flow or parent for final DML.
- Or use Flow to update related records declaratively.
- Or enqueue a Queueable job to defer updates.
10. How do you handle critical bugs in production?
- Prioritize and analyze impact.
- Reproduce in sandbox and trace via logs.
- Apply fix, test, deploy safely with monitoring post-deployment.
11. How do you ensure your Salesforce solution is optimized?
- Use bulkified code and avoid nested loops.
- Index filters in SOQL, cache data.
- Prefer declarative tools, ensure test coverage >90%.
12. If development is delayed in a sprint, how do you handle it?
- Notify Scrum Master early.
- Identify blockers and re-prioritize.
13. Difference between Synchronous and Asynchronous in Apex?
Synchronous:
- Runs immediately
- Blocks user
- Strict governor limits
- Examples: Triggers, Apex classes
Asynchronous:
- Queued for later
- Non-blocking
- Relaxed limits
- Examples: Batch, Future, Queueable
14. How do you debug in LWC?
- Use console.log() and debugger.
- Inspect with Chrome DevTools.
- Check Apex logs.
- Use LWC Inspector Extension.
15.What is the difference between a Workflow Rule and a Process Builder?
- Workflow Rule:
- Can only update fields, send emails, create tasks, or outbound messages.
- Simple automation.
- Process Builder:
- Can perform advanced actions like creating records, updating related records, invoking Apex, calling flows.
- More powerful but being retired in favor of Flows.
16. What is a Trigger in Salesforce?
A trigger is an Apex code block that executes before or after record changes (insert, update, delete, undelete).
Example: A trigger can automatically create a related task when an Opportunity is won.
17.What is SOQL vs SOSL?
- SOQL (Salesforce Object Query Language): Retrieves records from a single object or related objects (like SQL SELECT).
- SOSL (Salesforce Object Search Language): Searches across multiple objects and fields (like Google search).
18. What are Sharing Rules in Salesforce?
- Sharing rules extend record-level access beyond the role hierarchy.
- They grant access (Read Only / Read-Write) to users in specific roles, groups, or territories.
Example: Share “Leads” owned by East Sales Team with West Sales Team.
19. What is the difference between a Standard Object and a Custom Object?
- Standard Objects – Predefined by Salesforce (Accounts, Contacts, Opportunities, Leads).
- Custom Objects – Created by users to store company-specific data (e.g., “Projects__c”).
20.What is the difference between Before Trigger and After Trigger?
- Before Trigger: Executes before the record is saved in the database. Used for data validation or updating values.
- After Trigger: Executes after the record is saved. Used when referencing record IDs or creating related records.
21.What is a Junction Object in Salesforce?
A junction object is a custom object with two master-detail relationships. It is used to create many-to-many relationships between objects.
Example: A “Course_Enrollment__c” object linking “Student__c” and “Course__c”.
22. What are Salesforce Flows?
Flows are automation tools that allow declarative automation without code.
- Types: Screen Flows, Record-Triggered Flows, Scheduled Flows.
- Capabilities: Update records, call Apex, send emails, create records.
(Salesforce is migrating Workflow & Process Builder to Flows).
23. What is the difference between Role Hierarchy and Sharing Rules?
- Role Hierarchy: Opens access vertically (manager can see subordinate’s records).
- Sharing Rules: Opens access laterally (peers or other groups can share records).
24. What is the difference between Permission Sets and Profiles?
- Profile: Mandatory; defines baseline access (objects, fields, apps).
- Permission Set: Optional; provides extra permissions without changing the profile.
Example: All Sales reps have “Sales Profile,” but only a few get “Campaign Management” via Permission Set.
25.What is the difference between Standard Controller and Custom Controller?
- Standard Controller: Provides default CRUD operations for Salesforce standard/custom objects.
- Custom Controller: Written in Apex to override standard behavior or implement complex logic.