Question 1: What is Async Apex and when would you use it?
Answer:
Async Apex (e.g., Future methods, Batch Apex, Queueable, Scheduled Apex) is used for long-running operations like callouts, data processing, or handling large datasets asynchronously to avoid hitting governor limits.
Question 2: How does a Future method differ from Queueable Apex in Salesforce?
Answer:
Future methods are simple and used for callouts or async processing. Queueable Apex offers more control, supports chaining, and allows complex logic with custom job handling.
Question 3: What are common integration patterns in Salesforce?
Answer:
Common patterns include Remote Process Invocation (Request & Response), Fire and Forget, Batch Data Synchronization, UI Update Based on Data Changes, and Data Virtualization.
Question 4: How do you handle REST API callouts in Apex?
Answer:
Use HttpRequest and HttpResponse classes within a @future(callout=true) or Queueable context. Ensure the remote site is added in Remote Site Settings or use Named Credentials.
Question 5: What is Lightning Web Component (LWC) and how is it different from Aura?
Answer:
LWC is a modern, lightweight framework using native web standards (ES6, Shadow DOM). Aura is older, uses proprietary syntax, and is less performant. LWC is preferred for new development.
Question 6: How do you pass data between LWC components?
Answer:
Use public properties (@api), custom events, or Lightning Message Service (LMS) for communication between components.
Question 7: What are Custom Metadata Types and how are they different from Custom Settings?
Answer:
Custom Metadata is deployable and version-controlled, ideal for configuration. Custom Settings are org-specific and not deployable via metadata API.
Question 8: When would you use Hierarchy Custom Settings?
Answer:
Use them to store user-specific or profile-specific settings, like feature toggles or thresholds, with fallback to org-wide defaults.
Question 9: Explain Role Hierarchy and its impact on record visibility.
Answer:
Role hierarchy allows users higher in the hierarchy to access records owned by users below them. It’s used for implicit sharing.
Question 10: What are Sharing Rules and when are they used?
Answer:
Sharing rules grant additional access to records based on criteria or ownership. Used when role hierarchy isn’t sufficient.
