Courseiva

CCNA Process Automation And Logic Questions

75 of 145 questions · Page 1/2 · Process Automation And Logic · Answers revealed

1
MCQhard

A developer implements a Queueable class that makes an external REST callout. The developer needs to test this class using Test.startTest() and Test.stopTest(). What is required for the callout to succeed in the test method?

A.Set the remote site setting active in the test context.
B.Implement the HttpCalloutMock interface and assign it using Test.setMock()
C.Use the Database.AllowsCallouts interface on the test class.
D.Wrap the callout in a try-catch block to bypass test restrictions.
AnswerB

Salesforce requires callouts in tests to be mocked using Test.setMock().

Why this answer

Callouts are not allowed in test methods unless mocked. The test must implement the HttpCalloutMock interface to simulate the response.

2
Multi-Selectmedium

Which TWO criteria help a developer decide between using a Record-Triggered Flow and an Apex Trigger? (Choose two.)

Select 2 answers
A.Apex Triggers cannot be deactivated without deploying code changes.
B.Record-Triggered Flows provide declarative maintenance and faster build times for standard business logic.
C.Record-Triggered Flows cannot run asynchronously.
D.Flows cannot execute before-save updates.
E.Apex Triggers are required when implementing complex recursive controls across multiple objects and external web service integrations.
AnswersB, E

Correct. Flows offer powerful declarative capabilities.

Why this answer

Flow vs Apex decisions often depend on declarative preference, complexity, skill set, and architectural needs.

3
Multi-Selectmedium

Which TWO statements are true about the Apex order of execution?

Select 2 answers
A.Before-save triggers run before validation rules
B.Validation rules run before before-save triggers
C.Record-triggered flows run after validation rules
D.After-save triggers run before system validation
E.Email alerts are sent before after-save triggers
AnswersA, C

Before-save triggers are among the first items to execute.

Why this answer

Before triggers and validation rules occur before the record is saved to the database.

4
MCQmedium

A developer is writing a Batch Apex class to update 50,000 records. Which method must be implemented to define the scope of records to be processed?

A.initialize
B.execute
C.finish
D.start
AnswerD

The start method provides the record set to the batch job.

Why this answer

The start method in the Database.Batchable interface returns a QueryLocator or Iterable to define the records.

5
MCQmedium

When evaluating whether to use Flow Builder or an Apex trigger for record automation, which scenario best justifies choosing an Apex trigger over a Record-Triggered Flow?

A.Sending a simple email alert when a Case status changes.
B.Executing custom callouts and complex recursive logic across multiple related parent and child objects in bulk.
C.Displaying a custom validation error message on a field.
D.Updating a field on the same record before it is saved.
AnswerB

Correct. Complex multi-object transactions and asynchronous queuing are well-suited for Apex triggers.

Why this answer

Apex triggers are recommended over flows when handling complex multi-object transactional logic, callouts, or heavy bulk operations where performance and fine-grained control are paramount.

6
MCQeasy

A developer needs to invoke an asynchronous method from a standard synchronous Apex trigger. The asynchronous method must be annotated with which keyword?

A.@AuraEnabled
B.@future
C.@InvocableMethod
D.@testVisible
AnswerB

The @future annotation designates a method to execute asynchronously when resources are available.

Why this answer

Methods intended to run asynchronously outside the current request must be annotated with @future.

7
MCQeasy

A developer needs to schedule a class to run nightly at midnight to clean up stale audit records. Which interface must the class implement?

A.System.Schedulable
B.Database.AllowsCallouts
C.Queueable
D.Database.Batchable<SObject>
AnswerA

Schedulable is the required interface for scheduling Apex jobs.

Why this answer

To use Schedulable Apex, the class must implement the Schedulable interface, which contains the execute(SchedulableContext SC) method.

8
MCQmedium

A developer needs to pass a custom SObject record with related child lists into an asynchronous execution context. Which asynchronous Apex feature supports passing non-primitive types such as custom Apex objects or sObject collections?

A.Scheduled Apex
B.Future methods
C.Queueable Apex
D.Trigger asynchronous execution blocks
AnswerC

Queueable Apex supports complex data types, including sObjects and custom Apex classes.

Why this answer

Queueable Apex supports member variables of non-primitive types, including sObjects and custom classes.

9
MCQhard

Which of the following describes the behavior of a static variable in Apex?

A.It is stored in the database
B.It is reset for each trigger event
C.It is shared across all users
D.It persists for the duration of the transaction
AnswerD

Static variables maintain state until the transaction finishes.

Why this answer

Static variables are scoped to the transaction and persist across the entire trigger execution.

10
MCQmedium

Which type of Apex class is best suited for performing complex calculations on large data sets that must run overnight?

A.Batch Apex
B.Future method
C.Queueable Apex
D.Controller extension
AnswerA

Batch Apex manages large volumes effectively.

Why this answer

Batch Apex is specifically designed for processing large data sets in chunks over time.

11
MCQmedium

In the order of execution, when are custom validation rules evaluated relative to Before Triggers?

A.After After Triggers
B.Before Before Triggers
C.Concurrently with After Triggers
D.After Before Triggers
AnswerD

Custom validation rules execute after the execution of Before Triggers.

Why this answer

Custom validation rules are evaluated after Before Triggers complete.

12
Multi-Selectmedium

Which TWO best practices should a developer follow when writing bulkified Apex triggers? (Choose TWO.)

Select 2 answers
A.Perform DML statements and SOQL queries outside of loops by utilizing collections.
B.Hardcode record IDs in trigger logic to route specific test accounts.
C.Use synchronous callouts directly inside before insert triggers.
D.Design code to process collections of records (Trigger.new) rather than single records.
E.Place SOQL queries inside loops to ensure every record gets fresh data.
AnswersA, D

Bulkifying queries and DML ensures governor limits are respected.

Why this answer

Bulkified triggers must operate on collections (Trigger.new) and avoid SOQL/DML inside loops.

13
MCQeasy

Which context variable should be used in an after update trigger to compare old field values with new field values?

A.Trigger.operationType
B.Trigger.newMap and Trigger.oldMap
C.Trigger.size
D.Trigger.new and Trigger.old
AnswerB, D

Trigger.newMap and Trigger.oldMap allow direct ID-based comparison of old and new field values.

Why this answer

Trigger.oldMap combined with Trigger.newMap allows comparing old and new values by record ID.

14
MCQeasy

A developer needs to execute logic before a record is saved to the database, with the ability to modify field values on the same record without issuing a DML statement. Which trigger event should be used?

A.Before Insert
B.After Insert
C.After Update
D.Before Undelete
AnswerA

Before insert triggers allow developers to modify field values directly on the Trigger.new records without DML.

Why this answer

Before triggers are specifically designed for updating or validating record fields prior to persistence without requiring an explicit DML statement.

15
MCQhard

In the Salesforce Order of Execution, when are validation rules evaluated relative to Apex triggers?

A.Before any Before triggers fire
B.Concurrently with After triggers
C.After Before triggers fire and before the record is saved to the database
D.After the record is committed to the database and After triggers complete
AnswerC

Validation rules run after all Before triggers have completed.

Why this answer

Validation rules are executed after the 'Before' triggers fire and before the record is saved to the database.

16
MCQeasy

What is the result of using a recursive trigger without a proper exit condition?

A.The trigger executes until the governor limit is hit
B.The trigger stops after 100 iterations
C.The trigger is automatically disabled
D.Infinite loop until memory runs out
AnswerA

Salesforce limits execution depth to prevent system loops.

Why this answer

Recursive triggers without exit conditions hit the Apex governor limit, causing the transaction to fail.

17
MCQmedium

A developer needs to process 500,000 records daily and update a custom field based on complex business logic. Which asynchronous Apex feature is specifically designed to handle large batch data processing with flexible scope sizes and built-in transaction monitoring?

A.Future Methods
B.Queueable Apex
C.Batch Apex
D.Schedulable Apex
AnswerC

Correct. Batch Apex implements Database.Batchable and handles large volumes of records systematically through chunks.

Why this answer

Batch Apex is designed for processing large numbers of records (millions) by breaking them down into manageable batches and running them asynchronously.

18
MCQmedium

A developer needs to execute a lightweight background task that does not require complex chaining or monitoring. Which asynchronous feature is easiest to implement for a single method call?

A.Batch Apex
B.Schedulable Apex
C.Custom Invocable Action
D.Future Method
AnswerD

Future methods require only an annotation and static method definition, making them ideal for simple tasks.

Why this answer

Future methods are the simplest way to run asynchronous code when no complex state or chaining is needed.

19
Multi-Selectmedium

Which THREE criteria are best suited for choosing an Apex Trigger over a Flow?

Select 3 answers
A.Requirement for high-performance, low-latency execution
B.High-volume bulk processing
C.Simple field updates on the same record
D.Sending a simple email alert
E.Complex multi-object logic that exceeds Flow limits
AnswersA, B, E

Apex is more efficient.

Why this answer

Complex bulk logic, heavy computational requirements, and performance-critical operations are best handled in Apex.

20
MCQhard

A developer wants to chain a second asynchronous job from within an executing Queueable Apex job. Which method should be used?

A.System.enqueueJob()
B.Database.executeBatch()
C.apexJob.schedule()
D.Future.runAsync()
AnswerA

System.enqueueJob is called inside the Queueable execute method to chain jobs.

Why this answer

System.enqueueJob is used inside an execute method of a Queueable class to chain another job.

21
MCQeasy

Which governor limit applies specifically to the total number of asynchronous Apex executions (such as future methods and queueable jobs) enqueued in a 24-hour period for an Enterprise Edition org?

A.100 SOQL queries per transaction
B.6MB heap size limit
C.50 DML statements per transaction
D.10,000 or 2.5 times the number of user licenses, whichever is greater
AnswerD

Correct. The daily limit for asynchronous Apex in production orgs is 250,000 or 2.5 times the user licenses, with specific limits for developer editions.

Why this answer

The asynchronous Apex execution limit restricts the total number of future calls, queueable jobs, and scheduled jobs that can be enqueued per 24 hours.

22
MCQmedium

A developer needs to execute a batch job every Sunday at midnight. Which interface must the scheduling class implement?

A.Queueable
B.Database.Batchable<SObject>
C.Schedulable
D.Database.AllowsCallouts
AnswerC

The Schedulable interface allows classes to be run at scheduled times using cron expressions.

Why this answer

Scheduled Apex requires implementing the Schedulable interface.

23
MCQhard

A developer has written a Batch Apex class to process millions of records. During execution, some transactions fail due to temporary external web service timeouts. What is the standard behavior of Batch Apex when an unhandled exception occurs in a batch execution?

A.The specific batch scope fails, but the job continues processing subsequent scopes.
B.The entire job pauses indefinitely until an administrator manually resumes it via Setup.
C.The batch framework automatically retries the failed scope up to five times before moving on.
D.The entire batch job immediately aborts and rolls back all previously processed scopes.
AnswerA

Failed chunks do not halt the entire job by default; other scopes continue to execute.

Why this answer

By default, if an unhandled exception occurs in the execute method of a batch class, that specific batch of records fails, and the batch job continues processing the remaining batches, logging the failure.

24
MCQeasy

In the order of execution, when do record-triggered flows that are configured to run 'before' the record is saved execute?

A.After the before-save Apex triggers
B.After the after-save Apex triggers
C.Before the before-save Apex triggers
D.After the commit to the database
AnswerA

Before-save flows run after before-save Apex triggers.

Why this answer

Record-triggered flows configured to run before the record is saved execute after the before-save triggers.

25
MCQeasy

Which governor limit is associated with the total number of SOQL queries issued in a single synchronous transaction?

A.10
B.50
C.100
D.200
AnswerC

100 is the standard synchronous SOQL limit.

Why this answer

The limit for synchronous SOQL queries is 100.

26
Multi-Selectmedium

A developer is choosing between Future methods and Queueable Apex. Which TWO characteristics are unique to Queueable Apex? (Choose TWO.)

Select 2 answers
A.Queueable Apex methods can be called synchronously from inside formula fields.
B.Queueable Apex returns an AsyncApexJob ID that can be used to monitor job progress.
C.Queueable Apex allows passing complex data types such as sObjects and custom Apex objects.
D.Queueable Apex does not support asynchronous job chaining.
E.Queueable Apex restricts external HTTP callouts entirely.
AnswersB, C

System.enqueueJob returns an ID corresponding to the AsyncApexJob record.

Why this answer

Queueable Apex supports complex objects and job chaining, unlike future methods.

27
Multi-Selecthard

Which THREE limitations apply to Apex Triggers? (Choose THREE.)

Select 3 answers
A.Triggers cannot perform DML statements directly without bulkification consideration (though syntax allows it, governor limits prevent it). Let's use: Triggers cannot use return types or be called directly from user interface buttons without wrapper classes/flows.
B.Triggers cannot exceed a maximum trigger recursion stack depth of 16 without throwing an exception.
C.Triggers cannot be defined on standard objects, only custom objects.
D.Triggers cannot process more than 200 records in a single batch chunk.
E.Triggers cannot make synchronous outbound HTTP callouts.
AnswersA, B, E

Triggers are event-driven database hooks and cannot be called directly as methods from UI buttons.

Why this answer

Triggers cannot make synchronous callouts, cannot use custom web service annotations directly on trigger bodies, and have limits on stack depth.

28
MCQmedium

A developer is evaluating whether to use a Record-Triggered Flow or an Apex Trigger for a new automation requirement that involves complex callouts to an external system and heavy database operations. Which architectural guideline should the developer follow?

A.Use an Apex trigger combined with future methods or Queueable Apex to handle callouts asynchronously.
B.Use a Record-Triggered Flow with asynchronous paths for all callout requirements.
C.Use an Apex trigger with synchronous callouts to ensure immediate data consistency.
D.Use a Record-Triggered Flow because it handles synchronous HTTP callouts natively.
AnswerA

Apex is required when callouts are involved, and asynchronous features prevent blocking the main transaction.

Why this answer

Record-Triggered Flows cannot execute synchronous callouts directly. Apex must be used when callouts are required in a synchronous transactional context, or Queueable Apex can handle asynchronous callouts.

29
MCQeasy

What is the primary benefit of using Flow Builder over Apex triggers when implementing simple field validations?

A.Flows can be managed and updated declaratively without code deployment.
B.Flows bypass all system validation rules automatically.
C.Flows do not count against governor limits.
D.Flows execute faster than compiled Apex triggers.
AnswerA

Flows offer a declarative interface that reduces maintenance overhead and code dependencies.

Why this answer

Flow Builder allows administrators and developers to build validations declaratively without writing and maintaining code.

30
MCQhard

A developer needs to chain multiple asynchronous jobs sequentially where Job B must run only after Job A finishes successfully. Which interface should the developer use to achieve this?

A.System.Queueable
B.Database.AllowsCallouts
C.System.Schedulable
D.Database.Batchable
AnswerA

Correct. Queueable Apex allows a job to chain another job by invoking System.enqueueJob inside its execute method.

Why this answer

Queueable Apex provides the ability to chain jobs by calling System.enqueueJob() from within the execute method of a currently running Queueable job.

31
MCQmedium

A developer needs to ensure that a custom logging operation runs asynchronously and can be monitored using job IDs. Which interface is best suited?

A.Schedulable
B.Database.AllowsCallouts
C.Database.Batchable
D.Queueable
AnswerD

Queueable Apex returns an AsyncApexJob ID when enqueued, enabling monitoring.

Why this answer

Queueable Apex provides job IDs upon enqueueing, allowing for tracking and monitoring.

32
MCQeasy

Which context variable in an Apex trigger contains the old map of records for update operations?

A.Trigger.oldMap
B.Trigger.old
C.Trigger.new
D.Trigger.newMap
AnswerA

Trigger.oldMap holds the map of ID to record instances prior to the update.

Why this answer

Trigger.oldMap provides a map of ID to the old version of records during update and delete triggers.

33
MCQhard

A developer has a trigger that updates parent Account records when Child Contacts are modified. To prevent infinite recursion, the developer uses a static boolean variable in a helper class. What is a key limitation of using static variables for recursion control in Salesforce?

A.Static variables persist across multiple user transactions, causing triggers to never fire again.
B.Static variables cause governor limit exceptions on heap size.
C.Static variables reset at the end of each transaction, and do not protect against separate transactions or certain bulk test setups.
D.Static variables are prohibited in trigger helper classes.
AnswerC

Static variables are transaction-scoped and do not prevent recursive triggers if executed across multiple discrete transaction contexts.

Why this answer

Static variables persist only for the duration of a single transaction; if a secondary transaction or test context restarts, the static variable resets.

34
MCQhard

A developer writes a Queueable Apex job that queries 50,000 records, performs calculations, and updates them. During testing, the job hits a heap size limit. What is the standard asynchronous heap size limit in Apex?

A.12 MB
B.50 MB
C.36 MB
D.6 MB
AnswerA

The asynchronous heap size limit is 12 MB.

Why this answer

The asynchronous transaction heap size limit is 12 MB, compared to 6 MB for synchronous transactions.

35
MCQeasy

When should a developer choose Flow Builder over an Apex Trigger for business automation?

A.When implementing straightforward record-triggered field updates declaratively.
B.When performing complex callouts to external REST APIs.
C.When writing custom web service classes for external clients.
D.When processing millions of records nightly in batches.
AnswerA

Flow Builder is designed for declarative, point-and-click automation like record-triggered updates.

Why this answer

Flow Builder is declarative and preferred for standard point-and-click record updates and screen interactions when complex custom code is unnecessary.

36
MCQeasy

What is the synchronous governor limit for the total number of SOQL queries issued in a single Apex transaction?

A.200 locs
B.200
C.100
D.50
AnswerC

100 is the standard synchronous SOQL query limit.

Why this answer

The synchronous governor limit for SOQL queries per transaction is 100.

37
MCQeasy

An asynchronous method needs to be invoked from a standard trigger to perform callouts to an external web service. Which annotation is required for this asynchronous method?

A.@TestSetup
B.@future(callout=true)
C.@InvocableMethod
D.@ReadOnly
AnswerB

The @future annotation with callout=true allows asynchronous execution and external web service callouts.

Why this answer

Future methods annotated with @future(callout=true) are used to perform asynchronous callouts from triggers.

38
MCQmedium

When should a developer choose Flow Builder over Apex for implementing business automation logic?

A.When implementing custom encryption algorithms.
B.When standard screen interactions, record modifications, and maintenance by administrators are prioritized.
C.When complex web service callouts with complex XML namespaces need to be parsed.
D.When processing millions of records asynchronously in background batches.
AnswerB

Flows empower administrators to maintain logic visually without writing code.

Why this answer

Flow Builder is recommended for standard record transformations, screen prompts, and declarative logic because it is faster to build and maintain.

39
MCQmedium

A developer has a requirement to pass a complex SObject list containing parent and child records into an asynchronous method for further processing. Which asynchronous feature supports passing non-primitive data types such as Lists of SObjects?

A.Email Services
B.Schedulable Apex
C.Queueable Apex
D.Future Methods
AnswerC

Correct. Queueable Apex allows member variables of complex data types, including SObjects and custom objects.

Why this answer

Queueable Apex supports the execution of jobs asynchronously and allows passing non-primitive data types such as lists of SObjects through class member variables.

40
Multi-Selectmedium

Which TWO triggers are executed during a record merge operation in Salesforce? (Choose two.)

Select 2 answers
A.Before Insert and After Insert triggers on the losing record.
B.Undelete triggers on both records.
C.Lead conversion triggers instead of merge triggers.
D.Before Delete and After Delete triggers on the losing record.
E.Before Update and After Update triggers on the winning record.
AnswersD, E

The losing record is deleted during a merge, firing delete triggers.

Why this answer

Merging records deletes the loser record (firing delete triggers) and updates the winner record (firing update triggers).

41
MCQhard

What is the maximum CPU time limit for a synchronous Apex transaction in a developer edition org?

A.60,000 milliseconds
B.10,000 milliseconds
C.120,000 milliseconds
D.5,000 milliseconds
AnswerB

The synchronous Apex CPU time limit is 10,000 milliseconds.

Why this answer

The synchronous CPU time limit is 10,000 milliseconds for standard transactions.

42
MCQmedium

An Apex trigger needs to prevent deletion of Account records that have related active Contacts. When should this check occur?

A.After Insert
B.After Update
C.Before Insert
D.Before Delete
AnswerD

Before delete triggers allow developers to inspect related records and call addError() to block deletion.

Why this answer

Before delete triggers are used to validate and prevent the deletion of records based on related criteria.

43
MCQeasy

A developer needs to execute lightweight asynchronous logic that is chainable and allows passing complex objects to the background job. Which asynchronous feature should the developer implement?

A.Schedulable Apex
B.Queueable Apex
C.Future methods
D.Batch Apex
AnswerB

Queueable Apex allows complex data types and supports chaining of jobs.

Why this answer

Queueable Apex supports complex member variables including sObjects and custom Apex types, and it can be chained. Future methods only support primitive types and collections of primitive types.

44
MCQmedium

In what order does Salesforce execute system validation rules relative to Before Triggers during an insert operation?

A.System validation rules run after Before Triggers but before custom validation rules.
B.System validation rules execute before Before Triggers.
C.Before Triggers execute before system validation rules.
D.Before Triggers and system validation rules run concurrently.
AnswerB

Standard system validation rules (like required fields) run prior to the execution of Before Triggers.

Why this answer

System validation rules execute before Before Triggers in the standard Salesforce order of execution.

45
MCQhard

What is the maximum number of batch Apex jobs that can be queued or active concurrently in the Apex flex queue?

A.50
B.100
C.5
D.500
AnswerB

The flex queue can hold up to 100 batch jobs in 'Holding' status.

Why this answer

The Apex flex queue holds up to 100 batch jobs waiting to be processed.

46
MCQeasy

Which trigger context variable is available exclusively in before insert, before update, and before delete triggers to modify field values?

A.Trigger.new
B.Trigger.old
C.Trigger.oldMap
D.Trigger.newMap
AnswerA

Modifications to sObjects in Trigger.new within before triggers are automatically saved to the database without needing an explicit DML statement.

Why this answer

Trigger.new contains sObjects that can be modified in-flight during before insert and before update triggers.

47
MCQhard

During the execution of a trigger, an unhandled exception occurs in an after update trigger. What happens to the database transaction?

A.Only the records that caused the exception are rolled back; successful records are committed.
B.The transaction pauses until the exception is manually resolved by an admin.
C.The records are saved, and an email is sent to the system administrator without rolling back.
D.The entire transaction is rolled back, and no changes are saved to the database.
AnswerD

Apex transactions are atomic; any unhandled exception causes a complete rollback.

Why this answer

An unhandled exception in any trigger causes the entire database transaction to roll back entirely.

48
MCQeasy

Which trigger context variable should be used to check if a trigger is running in a before-insert context?

A.Trigger.isBeforeInsert
B.Trigger.isBefore && Trigger.isInsert
C.Trigger.context == 'beforeInsert'
D.Trigger.beforeInsert
AnswerB

These variables correctly identify the context.

Why this answer

Trigger.isBefore and Trigger.isInsert are standard context variables.

49
MCQhard

A developer wrote a batch job that encounters unhandled exceptions on specific records. To ensure that processing of other records continues despite errors in a chunk, what parameter should be configured in the start method or execution?

A.Database.allowsCallouts
B.System.abortJob()
C.Database.upsert with allOrNone set to false
D.Database.rollback()
AnswerC

Setting allOrNone to false during DML operations in batch allows partial success and failure logging.

Why this answer

Using Database.executeBatch with the default scope or handling exceptions within the execute method using try/catch ensures successful records are committed while failed ones can be logged.

50
Multi-Selectmedium

Which THREE items are valid considerations when designing Batch Apex?

Select 3 answers
A.The execute method accepts a list of SObjects
B.The finish method is optional
C.Batch apex can be called from a trigger synchronously
D.The start method returns a QueryLocator or Iterable
E.Governor limits are reset for each execute method call
AnswersA, D, E

This is required for the execute method.

Why this answer

Batch Apex requires start, execute, and finish methods and is subject to specific heap and query limits.

51
MCQmedium

A developer has written a Before Insert trigger on the Contact object that needs to validate user input and potentially prevent the record from saving. Which method on the Trigger context or record instance should the developer use to flag an error?

A.ApexPages.addMessage()
B.Record.addError()
C.Trigger.addError()
D.System.assert()
AnswerB

addError() prevents the DML operation and displays an error message on the record or page.

Why this answer

To prevent a record from saving in a before trigger, the developer must use the addError() method on the sObject record instance.

52
MCQeasy

What is the primary benefit of using a Flow over an Apex trigger for simple field updates?

A.Higher governor limits
B.Declarative configuration
C.Access to private methods
D.Better performance
AnswerB

Declarative tools reduce technical debt and maintenance.

Why this answer

Flows are declarative, easier to maintain, and require no code, making them faster to deploy.

53
MCQeasy

What is a key advantage of using Queueable Apex over future methods?

A.Queueable Apex allows passing sObjects and custom Apex types as member variables.
B.Queueable Apex executes synchronously on the user thread.
C.Queueable Apex has no governor limits.
D.Queueable Apex cannot make callouts.
AnswerA

Unlike future methods which only accept primitives, Queueable Apex accepts complex sObjects and collections.

Why this answer

Queueable Apex supports non-primitive data types and job chaining.

54
MCQeasy

A developer needs to execute long-running computations that require complex chaining and the ability to pass non-primitive data types to the job. Which asynchronous feature should the developer implement?

A.Queueable Apex
B.Schedulable Apex
C.Future methods
D.Batch Apex
AnswerA

Queueable Apex supports non-primitive types and provides job chaining via System.enqueueJob.

Why this answer

Queueable Apex supports the Database.AllowsCallouts interface, allows chaining of jobs, and accepts member variables of non-primitive types such as custom objects.

55
MCQeasy

A developer needs to execute logic after a record is inserted into the database but before the database commits the transaction. Which trigger event is most appropriate?

A.before insert
B.after insert
C.before update
D.after update
AnswerB

after insert is used for post-processing and accessing the record ID.

Why this answer

The after insert trigger event executes after the record is saved to the database but before the final commit.

56
Multi-Selecteasy

Which TWO features are characteristic of Flow Builder compared to Apex triggers? (Choose two.)

Select 2 answers
A.Flows execute entirely on client-side browsers.
B.Flows provide a visual canvas for building automation logic without writing code.
C.Flows require compilation into bytecode and deployment via metadata APIs or developer toolchains.
D.Flows allow administrators to debug executions using built-in visual debugging tools.
E.Flows cannot interact with custom objects or custom fields.
AnswersB, D

Flow Builder is a visual drag-and-drop tool for declarative automation.

Why this answer

Flow Builder is declarative, provides visual debugging, and allows point-and-click creation.

57
MCQeasy

Which tool provides a declarative alternative to Apex triggers for creating records when another record is created?

A.Validation Rules
B.Record-Triggered Flow
C.Assignment Rules
D.Approval Processes
AnswerB

Record-triggered flows can create and update related records declaratively.

Why this answer

Record-triggered flows in Flow Builder allow declarative creation of related records.

58
MCQmedium

A developer needs to call an external web service from an Apex trigger. Why must this be done asynchronously?

A.To increase governor limits for DML
B.Because triggers are limited to 10 callouts
C.To prevent callouts from blocking the transaction
D.To allow the trigger to run faster
AnswerC

Salesforce prevents synchronous callouts in triggers to ensure transaction integrity.

Why this answer

DML operations and external callouts cannot be mixed in the same transaction; callouts require asynchronous processing.

59
Multi-Selecthard

Which THREE statements are accurate regarding asynchronous Apex governor limits and best practices? (Choose three.)

Select 3 answers
A.Asynchronous Apex transactions have higher limits for SOQL queries and heap size compared to synchronous transactions.
B.Batch Apex scope size can be customized from 1 to 2000 records.
C.Future methods can call other future methods recursively.
D.Infinite chaining of Queueable jobs without exit conditions can exhaust daily asynchronous limits.
E.Asynchronous Apex jobs execute immediately without waiting in a queue.
AnswersA, B, D

Correct. Asynchronous transactions generally receive higher governor limits.

Why this answer

Asynchronous Apex provides higher governor limits, but developers must avoid chaining loops and respect daily limits.

60
MCQmedium

An architect is designing an automation solution and wants to decide between a Record-Triggered Flow and an Apex Trigger. Which scenario heavily favors choosing an Apex Trigger?

A.Creating a task for the record owner upon lead conversion
B.Updating a field on a related parent record when a child record is created
C.Sending a standard email alert when a picklist value changes
D.Performing sequential HTTP callouts and complex JSON parsing in response to record inserts
AnswerD

Apex natively handles complex callout chaining and exception handling better than declarative flows.

Why this answer

Complex integrations, callouts, and heavy algorithmic processing across multiple disparate objects often necessitate Apex triggers over declarative flows.

61
MCQmedium

A developer needs to process 2 million records asynchronously, performing complex calculations and updating parent records in batches of 2,000. Which feature should the developer implement?

A.Queueable Apex
B.Batch Apex
C.Future methods
D.Scheduled Apex
AnswerB

Batch Apex allows processing of millions of records using Database.Batchable and custom batch sizes up to 2,000.

Why this answer

Batch Apex is designed for processing large datasets in chunks asynchronously.

62
MCQeasy

A developer needs to invoke a long-running external web service callout from an existing scheduled Apex job that implements the Schedulable interface. What is the correct approach to implement this callout?

A.Mark the Schedulable execute method with the @future(callout=true) annotation.
B.Implement Database.AllowsCallouts directly in the Schedulable class and execute the callout inside the execute method.
C.Enquie a Queueable Apex class that implements Database.AllowsCallouts from within the Schedulable execute method.
D.Invoke the external web service using a standard synchronous SOQL statement.
AnswerC

Correct. Enqueueing a Queueable job that implements Database.AllowsCallouts allows callouts to be made successfully from scheduled contexts.

Why this answer

Schedulable Apex cannot directly make synchronous callouts because the thread must wait for the network response. Developers must chain a Queueable class that implements Database.AllowsCallouts.

63
Multi-Selecthard

A developer needs to write a Batch Apex class that processes records and ensures atomicity per batch chunk. Which TWO statements are true regarding Database.Batchable execution and error handling? (Choose TWO.)

Select 2 answers
A.Batch Apex chunks automatically roll back entirely if a single record fails, regardless of DML settings.
B.Using Database.DMLOptions or Database.insert(list, false) enables partial processing of records within a chunk without failing the entire batch.
C.Implementing the Database.Stateful interface allows instance variables to retain their values between batch chunks.
D.Batch Apex jobs cannot be monitored programmatically via Apex code.
E.The finish method executes before all execute chunks have completed.
AnswersB, C

Using partial DML allows successful records in the chunk to commit while failing ones are logged.

Why this answer

Using Database.insert(records, false) allows partial success within a batch chunk, and state can be maintained across chunks if Database.Stateful is used.

64
Multi-Selecthard

A developer is analyzing the Salesforce order of execution for a record update. Which TWO events occur AFTER custom validation rules are evaluated? (Choose TWO.)

Select 2 answers
A.Execution of Before Triggers.
B.Execution of custom validation rules
C.Execution of Assignment Rules and Escalation Rules.
D.Execution of initial system validation (such as required field checks).
E.Execution of Record-Triggered After Flows and Apex After Triggers.
AnswersC, E

Assignment and escalation rules run after validation and before after-triggers.

Why this answer

After triggers and assignment rules occur after custom validation rules in the save order of execution.

65
Multi-Selecthard

Which THREE limitations apply when writing Future methods in Apex? (Choose three.)

Select 3 answers
A.Future methods cannot accept sObjects or custom non-primitive data types as parameters.
B.Future methods return an AsyncApexJob ID immediately upon invocation.
C.Future methods cannot be used if the caller is already executing in an asynchronous context (e.g., inside a batch or queueable job).
D.Future methods execute asynchronously when system resources become available.
E.Future methods can be called synchronously from within another future method.
AnswersA, C, D

Future methods only accept primitive data types or collections of primitives.

Why this answer

Future methods cannot accept sObjects, cannot be tracked easily with job IDs, and cannot be called from other future methods.

66
MCQhard

A developer needs to access the old values of a record in an Apex trigger. Which collection provides this?

A.Trigger.old
B.Trigger.oldMap
C.Trigger.map
D.Trigger.newMap
E.Trigger.new
AnswerA

Trigger.old holds the previous versions of the records.

Why this answer

Trigger.old contains the list of records before the update or deletion.

67
MCQmedium

A developer writes an Apex trigger that performs a SOQL query inside a standard for-loop processing Trigger.new. Which governor limit is most likely to be exceeded?

A.Total number of SQL queries issued (100)
B.Total heap size (6 MB)
C.Total number of records retrieved by SOQL queries (50,000)
D.Total CPU time (10,000 milliseconds)
AnswerA

Placing a SOQL query inside a loop causes a query to run for every record in the batch, hitting the 100 SOQL query limit.

Why this answer

Querying inside loops easily exhausts the total SOQL queries issued per transaction limit of 100.

68
MCQeasy

Which method is used in an Apex trigger to display a custom error message on a specific record during a before insert event?

A.throw new TriggerException()
B.ApexPages.addMessage()
C.addError()
D.rejectRecord()
AnswerC

addError() prevents the save operation and displays an error on the UI or API response.

Why this answer

The addError() method on an sObject instance prevents the DML operation and displays an error message.

69
MCQmedium

A developer is troubleshooting a Batch Apex job where records are failing to update intermittently due to record locking contention with concurrent updates. What is the recommended strategy to mitigate record locking?

A.Increase the batch size to the maximum of 2,000 to complete faster.
B.Process records in smaller batch sizes and ensure parent records are sorted or processed in a deterministic order.
C.Convert the batch job into a synchronous trigger.
D.Disable all validation rules on the object permanently.
AnswerB

Smaller batch sizes reduce the window of record locks held simultaneously.

Why this answer

Sorting records in the start method query using FOR UPDATE or structuring batches by parent groups can reduce locking, and processing smaller batch sizes can also help.

70
MCQeasy

A developer needs to execute logic before a record is inserted into the Database to validate field values and prevent invalid records from saving. Which trigger event should the developer use?

A.after update
B.after insert
C.before update
D.before insert
AnswerD

Correct. Before insert triggers execute before the record is saved to the database, making them ideal for validation and field updates.

Why this answer

Before insert triggers are used to perform validation, update field values, and prevent records from saving by using the addError() method on the records.

71
Multi-Selectmedium

A developer needs to schedule an Apex class to run weekly. Which THREE elements are required to implement Schedulable Apex? (Choose THREE.)

Select 3 answers
A.The class must extend the Controller class.
B.The class must implement Database.Batchable<SObject>.
C.The public class must implement the Schedulable interface.
D.The job must be invoked using System.schedule() with a valid Cron expression.
E.The class must define the global or public void execute(SchedulableContext sc) method.
AnswersC, D, E

Implementation of the Schedulable interface is mandatory.

Why this answer

Schedulable Apex requires implementing the Schedulable interface, defining the execute method, and scheduling via System.schedule with a Cron expression.

72
MCQmedium

In the Salesforce order of execution, when are assignment rules evaluated relative to Apex triggers?

A.Concurrently with workflow rules.
B.After all triggers have completely finished.
C.Before any triggers execute.
D.After Before Triggers and before After Triggers.
AnswerD

Assignment rules are processed after before triggers and standard validation rules.

Why this answer

Assignment rules run after the insert or update before triggers and standard validations, but before after triggers.

73
MCQmedium

In an after insert trigger on the Account object, a developer attempts to modify a field on Trigger.new[0] and performs an update DML statement. What happens?

A.The transaction is rolled back due to governor limits.
B.A System.SObjectException is thrown because Trigger records are read-only in after triggers.
C.The trigger fires infinitely without stopping.
D.The record updates successfully without issues.
AnswerB

Trigger records in after triggers cannot be modified directly without re-querying or instantiating a new sObject instance for DML.

Why this answer

Modifying Trigger.new records in an after trigger and running DML causes a read-only exception or recursive trigger loop.

74
MCQhard

A developer writes a trigger that calls a future method. Inside the same transaction, the trigger also performs a DML operation on records that are referenced by the future method. What exception might occur?

A.System.AsyncException due to calling a future method from another asynchronous context or batch
B.System.LimitException due to query row limits
C.System.NullPointerException
D.System.TypeException
AnswerA

Future methods cannot call other future methods or be called from batch/scheduled contexts in certain nested ways.

Why this answer

Passing sObject IDs to a future method when the underlying records are locked or modified rapidly in mixed DML or same-transaction contexts can lead to System.AsyncException or unexpected state issues, though specifically mixed DML involves setup and non-setup objects.

75
Multi-Selectmedium

Which TWO actions can be performed inside a before insert Apex trigger without causing a runtime exception? (Choose two.)

Select 2 answers
A.Modifying field values on records in Trigger.new directly without a DML statement.
B.Accessing Trigger.oldMap to compare previous values.
C.Performing an immediate synchronous HTTP callout to an external REST service.
D.Executing an explicit update DML statement on records in Trigger.new.
E.Calling the addError() method on a record in Trigger.new to prevent saving.
AnswersA, E

Before triggers are specifically designed to update field values on the same records in memory without explicit DML.

Why this answer

Before insert triggers allow modifying field values on Trigger.new directly and adding errors via addError(). DML statements and sending emails require after context or incur exceptions/limit issues.

Page 1 of 2 · 145 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Process Automation And Logic questions.