













































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A set of practice questions and answers for the salesforce certified force.com advanced developer exam. It covers key topics such as oop principles, trigger handler frameworks, field-level security, batch apex, apex governor limits, visualforce controllers, lightning web components, soql features, asynchronous apex, process automation tools, and deployment strategies. The questions are designed to test and reinforce understanding of advanced salesforce development concepts, making it a valuable resource for exam preparation and skill enhancement.
Typology: Exams
1 / 85
This page cannot be seen from the preview
Don't miss anything!














































































Question 1. Which of the following OOP principles allows a subclass in Apex to override a method from its parent class? A) Encapsulation B) Inheritance C) Polymorphism D) Abstraction Answer: C Explanation: Polymorphism enables subclasses to override methods from parent classes, providing custom implementations. Question 2. What is the primary purpose of using a Trigger Handler framework in Salesforce Apex development? A) To schedule triggers B) To separate trigger logic from data access C) To centralize and manage trigger logic for reusability and maintainability D) To enable batch processing Answer: C Explanation: A Trigger Handler framework centralizes trigger logic, improving code organization and maintainability. Question 3. Which Apex annotation ensures that test methods do not access actual organization data? A) @isTest(seeAllData=true) B) @isTest(seeAllData=false) C) @future D) @testSetup
Answer: B Explanation: Using @isTest(seeAllData=false) ensures test methods operate on test data only. Question 4. What is the recommended approach to enforce Field-Level Security (FLS) in Apex code? A) Use SOQL queries only B) Use Security.stripInaccessible() C) Use SELECT * in SOQL D) Hardcode field values Answer: B Explanation: Security.stripInaccessible() enforces FLS by removing inaccessible fields from records in Apex. Question 5. When processing more than 50,000 records, which Apex solution should be used? A) Future methods B) Batch Apex C) Triggers D) Scheduled Apex Answer: B Explanation: Batch Apex is designed for processing large numbers of records, unlike triggers or future methods. Question 6. What keyword in an Apex class enforces sharing rules of the current user? A) without sharing B) with sharing
A) Ignore them B) Use try-catch-finally blocks C) Log to a file D) Use JavaScript Answer: B Explanation: try-catch-finally blocks should be used for robust exception handling in Apex. Question 10. What is the main advantage of using Service Layer classes in Salesforce Apex? A) They replace triggers B) They provide a single point for business logic C) They control UI D) They enforce FLS Answer: B Explanation: Service Layer classes centralize business logic, supporting reusability and separation of concerns. Question 11. What does the Apex governor limit for SOQL queries per transaction restrict? A) Number of queries in a batch B) Number of records returned C) Number of SOQL queries executed in one transaction D) Number of triggers Answer: C Explanation: Salesforce restricts the number of SOQL queries allowed per transaction to prevent resource overuse.
Question 12. In Visualforce, which controller type allows for custom business logic and data manipulation? A) Standard Controller B) Custom Controller C) List Controller D) Data Controller Answer: B Explanation: Custom Controllers allow developers to define custom logic and data access in Visualforce. Question 13. What is one key difference between Aura components and Lightning Web Components (LWC)? A) Aura uses JavaScript, LWC does not B) LWC uses modern web standards, Aura does not C) LWC cannot call Apex D) Aura components are deprecated Answer: B Explanation: LWC is built on modern web standards like ES6, while Aura predates these standards. Question 14. Which SOQL feature allows you to filter results based on a related object’s field? A) Aggregate functions B) Subqueries C) Semi-join D) SOSL
Answer: B Explanation: Selector classes ensure consistent, reusable data access logic across the application. Question 18. When should you use 'System.runAs()' in Apex test methods? A) To test large data volumes B) To test business logic as different profiles or users C) To bypass sharing rules D) To deploy code Answer: B Explanation: System.runAs() allows testing code under different user contexts for permissions and sharing. Question 19. Which Lightning Component event allows communication between sibling components? A) Application Event B) Component Event C) Platform Event D) Pub/Sub Event Answer: D Explanation: The Pub/Sub pattern allows unrelated (sibling) components to communicate in LWC. Question 20. What is a key consideration when making callouts from Apex? A) Callouts are always synchronous B) Callouts must not occur after DML statements C) Callouts can only use SOAP
D) Callouts do not require authentication Answer: B Explanation: Callouts must be made before any DML operations in the same transaction. Question 21. How can you ensure bulk-safe test methods for triggers in Apex? A) Test with single record only B) Test with lists of records C) Use only System.runAs() D) Use SOQL in test methods Answer: B Explanation: Testing with lists simulates bulk data processing and ensures triggers handle bulk operations. Question 22. What is the effect of not bulkifying an Apex trigger? A) No effect B) Trigger may hit governor limits C) Trigger runs faster D) Data is not saved Answer: B Explanation: Non-bulkified triggers risk hitting governor limits when processing multiple records. Question 23. Which deployment tool is best suited for source-driven development and CI/CD in Salesforce? A) Change Sets
B) Scheduled batch jobs C) Synchronous callouts D) Static resources management Answer: A Explanation: Platform Events enable real-time, event-driven architectures through publish/subscribe models. Question 27. What is the recommended maximum number of records to process in a single trigger execution? A) 200 B) 2, C) 10, D) 50, Answer: A Explanation: Salesforce processes triggers in batches of up to 200 records per execution for bulk operations. Question 28. Which of the following is true about the order of execution in Salesforce? A) Workflows execute before triggers B) Validation rules execute before triggers C) Triggers execute before validation rules D) Flows execute before triggers Answer: B Explanation: Validation rules execute before triggers during the save order of execution.
Question 29. Which deployment tool allows for deployments between unrelated Salesforce orgs? A) Change Sets B) Salesforce DX C) Validation Rules D) Process Builder Answer: B Explanation: Salesforce DX and tools like Ant Migration Tool can deploy between unrelated orgs, unlike Change Sets. Question 30. What does ‘Stateless’ mean in Batch Apex? A) Maintains state between execute method calls B) Does not maintain state between execute method calls C) Always runs synchronously D) Only for small data volumes Answer: B Explanation: Stateless Batch Apex does not maintain state between batch executions. Question 31. Which Visualforce feature allows partial page refresh without reloading the whole page? A) Controller Extension B) ActionRegion C) AJAX D) Standard Controller Answer: C Explanation: AJAX techniques in Visualforce enable partial page refresh for better UX.
Explanation: The Metadata API is used for deploying and retrieving metadata (code/config) between Salesforce orgs. Question 35. Which Lightning component lifecycle hook is called after the component is inserted into the DOM in LWC? A) connectedCallback B) renderedCallback C) init D) createdCallback Answer: A Explanation: connectedCallback runs when the component is inserted into the DOM in Lightning Web Components. Question 36. What is Lookup Data Skew? A) When too many records are related to one parent in a lookup relationship B) When one user owns many records C) When sharing rules are not set D) When profiles have too many permissions Answer: A Explanation: Lookup Data Skew occurs when many records reference one parent in a lookup relationship, causing performance issues. Question 37. Which Apex method is used to schedule an Apex class to run at a specified time? A) System.schedule() B) System.runBatch()
C) System.execute() D) System.setTimer() Answer: A Explanation: System.schedule() is used to schedule Apex classes for future execution. Question 38. What is the main benefit of using Lightning Data Service (LDS) in Lightning components? A) Direct SOQL queries B) Automatic handling of sharing and FLS C) Custom controllers D) Manual data refresh Answer: B Explanation: LDS manages sharing rules and FLS automatically, reducing boilerplate code. Question 39. Which SOQL feature is used to aggregate data, such as SUM or COUNT? A) Aggregate functions B) Semi-join C) SOSL D) Dynamic SOQL Answer: A Explanation: Aggregate functions in SOQL allow calculating values like SUM, AVG, COUNT, etc. Question 40. What is the recommended way to handle governor limits in triggers? A) Ignore limits B) Bulkify code and minimize SOQL/DML statements
B) Data Loader C) Salesforce DX D) Ant Migration Tool Answer: C Explanation: Salesforce DX supports deploying both metadata and test data (via scripts). Question 44. What is the default batch size for execute() in Batch Apex? A) 1 B) 10 C) 200 D) 2, Answer: C Explanation: By default, Batch Apex processes records in batches of up to 200. Question 45. Which method is used to chain Queueable jobs in Apex? A) System.schedule() B) Database.executeBatch() C) System.enqueueJob() D) this.System.enqueueJob() Answer: C Explanation: Calling System.enqueueJob() from within a Queueable class chains jobs. Question 46. What does the @AuraEnabled annotation do? A) Enables a method for use in Lightning components
B) Makes a method asynchronous C) Schedules a method D) Secures a method Answer: A Explanation: @AuraEnabled exposes Apex methods to Lightning Components (Aura/LWC). Question 47. Which mechanism allows Lightning components to display toast notifications? A) force:showToast B) showToast() C) ui:toast D) LightningToast Answer: A Explanation: force:showToast is the standard event for displaying toast notifications in Lightning. Question 48. What is the maximum number of records returned by a single SOSL query? A) 2, B) 5, C) 50, D) 20, Answer: B Explanation: A SOSL query can return up to 2,000 records per object, with a maximum of 5,000 total. Question 49. Which Salesforce feature provides at-rest encryption for data stored in the platform? A) Field-Level Security
A) Controller Extension must extend a Custom Controller B) Controller Extension adds/overrides logic on top of standard controllers C) Custom Controller cannot access SOQL D) Controller Extension is required for all Visualforce pages Answer: B Explanation: Controller Extensions extend/override logic on standard controllers. Question 53. Which governor limit applies to the number of records processed in a single trigger execution? A) SOQL queries per transaction B) DML statements per transaction C) Records retrieved by SOQL D) Maximum batch size of 200 Answer: D Explanation: Triggers process a maximum of 200 records per batch execution. Question 54. What is the purpose of the Database.Stateful interface in Batch Apex? A) Ensures stateless execution B) Maintains state across batch execute() invocations C) Schedules batch jobs D) Limits governor usage Answer: B Explanation: Database.Stateful preserves state across batch execute() calls.
Question 55. Which Salesforce tool would you use for a simple deployment between related orgs, such as sandbox to production? A) Salesforce DX B) Change Sets C) Ant Migration Tool D) Data Loader Answer: B Explanation: Change Sets are best for deployments between related Salesforce orgs. Question 56. What is true about the Lightning Message Service? A) Only works with Visualforce B) Enables communication between Visualforce, Aura, and LWC C) Only works with LWC D) Requires external libraries Answer: B Explanation: Lightning Message Service allows messaging between Visualforce, Aura, and LWC. Question 57. What is the main use of the Apex System.debug() method? A) Deploy code B) Log messages for debugging C) Handle exceptions D) Create records Answer: B Explanation: System.debug() logs information for debugging purposes in Apex.