← All CSA Flashcard Decks

Apex Programming Flashcards

7 cards from real CSA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Apex Programming flashcards as text
  1. Which Apex interface must be implemented to use Database.executeBatch()?

    Answer: Database.Batchable

    A class must implement Database.Batchable to be executed with Database.executeBatch().

  2. What is the purpose of the @testSetup annotation in Apex test classes?

    Answer: Creates test data once and rolls it back after each test method

    @testSetup creates test data once for the class and rolls back changes between individual test methods to improve test performance.

  3. What does the 'without sharing' keyword do when applied to an Apex class?

    Answer: Runs the class in system mode ignoring the user's sharing rules

    'without sharing' runs the class in system mode, ignoring the running user's sharing rules and accessing all records.

  4. Which Apex data type is used to store a reference to a Salesforce record ID?

    Answer: Id

    The Id data type is a specialized 18-character string type designed to store Salesforce record IDs with built-in validation.

  5. What is the correct way to prevent a SOQL query from being inside a for loop in a trigger?

    Answer: Use a List to collect IDs, then query outside the loop

    Best practice is to collect all needed IDs into a collection first, then execute a single SOQL query outside the loop.

  6. Which method in the Database.Batchable interface defines the records to process?

    Answer: start()

    The start() method returns a QueryLocator or Iterable that defines the scope of records the batch job will process.

  7. What happens when you call System.enqueueJob() from within a Queueable class's execute method?

    Answer: It chains a new Queueable job to run after the current one finishes

    Calling System.enqueueJob() from inside a Queueable execute() method chains a new job that runs after the current job completes.

How this page was made: written with AI tools. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. help.salesforce.com — Exam information · verified Oct 2026
  2. help.salesforce.com — Test delivery, eligibility, fees · verified Oct 2026