An Apex trigger needs to query related Account records for a list of newly inserted Contact records. What is the most robust way to handle the relationship query in SOQL to avoid governor limits?
A developer needs to retrieve 10 Account records starting from the 21st record to implement pagination in a custom component. Which SOQL clause should be used?
A developer wants to ensure that a custom Apex REST service method properly handles authentication and executes securely in the context of the calling user. How should the class be defined?
A developer needs to query Task records related to Account records using a parent-to-child relationship. What is the standard child relationship name for Tasks on the Account object?
An Apex trigger needs to execute logic only when a specific custom field (Discount_Percent__c) on an Opportunity changes its value. Which comparison should the developer use?
A developer needs to run an Apex class in system mode, ignoring user-level object and field-level permissions, but enforcing organization-wide sharing rules. How should the class be declared?
A developer needs to update 5,000 Account records and wants to ensure that if any single record fails validation, none of the records are committed to the database. Which method should be used?
An Apex transaction performs a DML operation, followed by a callout to an external REST API, followed by another DML operation. What exception will Salesforce throw?
A developer needs to determine if the current user has delete permissions on the Opportunity object in Apex before calling a deletion method. Which method should be used?
A developer needs to convert a string variable containing an alphanumeric Salesforce ID into an ID primitive data type. Which approach is valid in Apex?
An application has a requirement to query records owned by subordinate users in the role hierarchy using Apex. Which SOQL feature supports this capability?
Which TWO tools or features are part of the Model-View-Controller (MVC) architecture implementation in Salesforce declarative and programmatic development? Choose 2 answers.
A developer needs to write an Apex trigger that fires before an Account is inserted and accesses the value of the custom field 'Rating__c'. Which collection type is best suited to iterate over the incoming records in the trigger context variable?
A developer has written an Apex method that executes a SOQL query to retrieve all Contacts associated with an Account. The method needs to be invoked securely without bypassing the user's organization-wide defaults and sharing settings. How should the developer execute this query?
A developer needs to ensure that a custom Apex controller safely checks whether the current user has read access to the 'Salary__c' field on the 'Employee__c' object before displaying it in a Lightning Web Component. Which method should the developer use?
An enterprise application requires dynamic execution of a SOQL query where the object type and fields to query are determined at runtime based on user input. Which feature should the developer use to prevent SOQL injection vulnerabilities?
A developer creates a custom Lightning Web Component that includes a wired property to retrieve account records. The component needs to react dynamically when the record data is updated via another component on the page. Which decorator should be used on the JavaScript property to receive reactive updates?
A developer needs to retrieve a list of Accounts along with their related Contacts using a single SOQL query in Apex. Which query structure is syntactically correct?
A developer is implementing a custom logging framework in Apex. Due to high transaction volumes, multiple asynchronous log entries need to be queued without hitting the maximum number of queueable jobs allowed in a single transaction. What is the execution limit for chained Queueable jobs?
A developer needs to write a secure SOQL query that prevents unauthorized data exposure by respecting both sharing rules and field-level security. Which TWO approaches can the developer combine to achieve this? (Choose two.)
A developer is writing an Apex trigger that needs to execute logic only when records are updated and a specific custom field 'Status__c' changes from 'Draft' to 'Submitted'. Which THREE elements are required to implement this check correctly? (Choose three.)
A developer implements a custom Apex controller for a Visualforce page that performs DML operations. Which THREE best practices should be followed to ensure robust data management and security? (Choose three.)
A developer needs to ensure that an Apex class can be invoked by a Lightning Web Component and can also process a large number of records without hitting governor limits. The class must be exposed to the component and must perform its logic asynchronously. Which annotation should the developer use on the method?
A developer is building an Apex class that must process a large number of records and perform callouts to an external system. The developer wants to ensure the solution is bulk-safe and respects governor limits. Which two techniques should the developer use? (Choose two.)
A developer needs to write an Apex method that queries all Account records where the Industry field is 'Technology'. The method must be bulk-safe and should not exceed governor limits. Which SOQL query is most appropriate?
A developer needs to write an Apex class that performs a callout to an external web service and then updates a custom object record based on the response. The callout must be made asynchronously to avoid mixed DML errors. Which approach should the developer use?
A developer needs to ensure that an Apex class respects organization-wide defaults, role hierarchies, and sharing rules when querying custom objects. Which keyword should be added to the class definition?
An enterprise application requires Apex code to check whether the current user has read access to a specific custom field before displaying it in a custom Lightning Web Component. What is the most appropriate class to use?
A developer writes an Apex method that executes a SOQL query using user-supplied search parameters. How can the developer protect against SOQL injection vulnerabilities?
A developer needs to store a collection of unique customer email addresses in Apex and check for existence efficiently. Which collection type should the developer use?
A developer is writing code that processes untrusted data and wants to automatically strip fields and relationships that the current user cannot access, without throwing an exception. Which feature should be used?
A developer needs to find all records across multiple objects (Contact, Lead, and Account) that contain the exact phrase 'Acme Corp'. Which feature should be used?
An Apex trigger processes a list of Case records. The developer wants to group the cases by their AccountId. Which data structure is best suited for this grouping?
A developer writes an Apex method with the 'inherited sharing' keyword. What is the behavior of this class when invoked from a class declared with 'with sharing'?
An Apex trigger needs to prevent duplicate records from being inserted based on a custom external ID field. Which approach should the developer take to optimize query performance and respect governor limits?
A developer needs to implement a custom logging framework. Which Apex data type should be used to represent a variable that can store any primitive value, sObject, or collection dynamically?
An application has complex business logic where an Apex class called from a trigger needs to know whether it was invoked from an insert or update trigger context. How can the developer determine this?
A developer is writing a batch Apex class. During the execute method, a record fails validation. The developer wants to ensure that successfully processed records in the same batch are committed while failing records are logged without aborting the entire batch. How should the DML be performed?
An Apex trigger invokes a helper method that performs a DML operation, but the developer wants to establish a rollback point so that prior changes can be reverted if a subsequent error occurs. Which feature should be used?
A developer needs to store a collection of Account IDs where duplicates are automatically prevented and lookups are extremely fast. Which collection type should the developer use?
An Apex trigger needs to check whether the current user has read access to the 'AnnualRevenue' field on the Account object before performing a calculation. Which method should the developer use?
A developer writes an Apex method that executes a SOQL query inside a for-loop over a list of 200 Account records. Which governor limit is most likely to be immediately breached?
A developer is writing a trigger on the Contact object that needs to reference old field values during an update operation. In which trigger context variable are these previous values stored?
A developer needs to dynamically instantiate an sObject type based on a string variable representing the object name (e.g., 'Account'). Which method should be used?
A developer writes a SOQL query to fetch Account records and wants to bind a list of strings called 'targetNames' as filter criteria. Which syntax is correct?
A developer wants to ensure that a custom Apex controller method can be invoked securely from a Lightning Web Component. Which annotation must be applied to the method?
A developer needs to query all Contact records, including those that have been deleted from the database via the Recycle Bin. Which SOQL clause must be added?
An Apex trigger executes during a bulk insert of 300 records. To adhere to best practices regarding governor limits and bulkification, how should SOQL queries be written?
An Apex trigger needs to prevent records from being saved if a specific validation condition fails. How should the developer reject the DML operation on a specific record?
An Apex trigger executes a query inside a for-loop to fetch related child records for every parent Account in Trigger.new. The developer notices that when a data load of 200 accounts occurs, the governor limit for total SOQL queries issued is exceeded. How should the developer refactor the code?
A developer wants to define a constant value in an Apex class that can be accessed globally without instantiating the class. Which combination of keywords should be used?
A developer is writing an Apex method and needs to store a collection of unique email addresses while maintaining fast lookup times. Which collection should the developer choose?
A developer wants to retrieve up to 5 recently viewed records of any object type using SOSL. Which SOSL clause specifies the maximum number of records to return?
A developer needs to assign a default value to a custom picklist field via Apex when creating a Lead record. What data type should be assigned to the picklist field in Apex?
A developer is writing a test class for an Apex trigger and needs to insert test Account records. Best practices recommend bypassing hardcoded IDs. Which annotation should be placed on the test setup method to create common test data efficiently?
An Apex trigger processes a large volume of Opportunity updates. The developer uses Database.update(opps, false) to allow partial success. How should the developer inspect the results to handle any failures?
A developer is writing an Apex trigger and needs to optimize performance and prevent governor limit violations. Which TWO practices should the developer follow? (Choose two.)
A developer is building a custom Lightning Web Component and wants to communicate data from a child component up to its parent component. Which THREE steps are required? (Choose three.)
A developer needs to apply a custom discount to a list of Opportunity records and then persist the changes to Salesforce. The logic must be reusable both from an Apex trigger and from an Apex controller invoked by a Lightning web component. Which approach best satisfies the requirement while following Apex best practices?
A developer is writing an Apex trigger on the Case object that updates the Case's Status field based on the Priority. The trigger must handle bulk updates and avoid recursion. Which approach should the developer take to prevent the trigger from firing again when the Case records are updated by the trigger itself?