Salesforce Decode
Salesforcedecode
All topics

Learn Apex

Bulkification, governor limits, async processing, and large data volume patterns.

179 questions in this topicDrill in practice mode →
Code editor representing Apex development

Visual guide for Apex

Concept at a glance

Apex triggers and services must bulkify DML and SOQL to stay within governor limits at scale.

  • Triggers & Handler pattern
  • Bulkification
  • Async: Queueable / Batch
  • Governor limit design
Apex architecture diagram

Apex triggers and services must bulkify DML and SOQL to stay within governor limits at scale.

Difficulty Level

Focus Area (Triggers, Async, etc.)

Showing 44 of 179 Apex questions

Beginnerbasicsapexcode

What is Apex and when would you use it?

An admin hits Flow limits on complex validation. The lead asks when Apex is the right tool.

Beginnerbulkificationtriggersbest-practices

What is bulkification in Apex?

A data load updates 200 Accounts and a trigger fails. You explain why bulk-safe code matters.

Beginnergovernor-limitsplatform

What are governor limits?

A junior's integration works for one record but fails on batch jobs. You explain governor limits.

Beginnertriggersclasses

What is the difference between a trigger and a class?

A new hire puts all logic inside a trigger file. You explain separation of concerns.

Beginnersoqlqueries

What is SOQL and how is it different from SQL?

You need Accounts in California with open Opportunities. The interviewer asks how you query in Apex.

Beginnerdmlinsertupdate

What is DML in Apex?

After processing Opportunities, you need to create Tasks. You explain DML operations.

Beginnertestingcoverage

What is a test class and why is 75% coverage required?

Deployment fails due to insufficient test coverage. You explain Apex testing basics.

Beginnertriggersbeforeafter

What is the difference between before and after trigger context?

You must set a field before save and send email after save. You choose trigger contexts.

Beginnerfutureasync

What are future methods and when use them?

A trigger must call an external API but callouts cannot run with pending DML. You mention @future.

Beginnersecuritycrudfls

What is CRUD and FLS security in Apex?

A class with sharing disabled exposes salary fields to users who should not see them. You explain security checks.

Beginnerexceptionserror-handling

What is an Apex exception and basic error handling?

Users see a generic "Script-thrown exception" on save. You describe handling errors properly.

Beginnerdebuggingdeveloper-tools

What debugging tools help Apex developers?

Your trigger works in sandbox but not production data. You list how you would debug as a junior.

Beginnerenumsconstantsclean-code

Apply Apex enum and constant patterns for maintainability

Status strings scattered as literals cause typos breaking batch filters silently.

Beginnertestingantipatterns

Use Test.isRunningTest branching carefully

Code skips callout in test via Test.isRunningTest but production callout failure path never tested.

Beginnerfeature-flagscustom-settings

Implement custom setting and hierarchy for feature flags in Apex

New trigger logic needs gradual rollout by profile before org-wide enable.

Beginnerdefensivenull-safety

Apply defensive null and empty collection handling in Apex

NullPointerException in production when optional lookup field blank on subset of records in batch.

Beginnerapexoopstatic

What is the difference between static and instance members in Apex?

A developer uses a static variable to "remember" a value between two user requests and it does not work.

Beginnerapexnull-safetylanguage

What is the safe navigation operator and when should you use it?

Code throws NullPointerException when an Account has no owner manager.

Beginnerapexcollections

What are the main Apex collection methods you use daily?

Rapid-fire collection question.

Beginnerapexlanguageswitch

What is the switch statement in Apex and what can it switch on?

A long if-else chain on Status values is hard to read.

Beginnerapexenumsmaintainability

What are Apex enums and why use them over strings?

Status strings like "Approved" are scattered across 30 classes with typos.

Beginnerapexdmlpartial-success

What is the difference between insert and Database.insert?

One bad record in a list of 200 fails the whole insert.

Beginnerapexstrings

What string methods and patterns should every Apex developer know?

Rapid-fire string handling.

Beginnerapexnamingconventions

What are best practices for Apex class and method naming?

Team coding standards discussion.

Beginnerapextriggerscontext-variables

What is the difference between Trigger.new and Trigger.newMap, and where is each available?

Rapid-fire trigger context question.

Beginnerapexfuturequeueable

What is the difference between @future and Queueable?

A candidate is asked to compare the two.

Beginnerapexscheduled-apex

How do you schedule Apex and manage scheduled jobs?

A cleanup job must run every night at 2am.

Beginnerapextestingtest-visible

How do you test private methods in Apex?

A complex private helper method needs its own tests.

Beginnerapexdata-types

What data types does Apex support?

Basic Apex question.

Beginnerapexcollections

What is the difference between a List and an array in Apex?

Quick syntax question.

Beginnerapexanonymous-apex

What is anonymous Apex and when do you use it?

You need to fix 50 records quickly.

Beginnerapexsharing

What does the "with sharing" keyword do?

Basic security question.

Beginnerapextriggers

What are trigger events in Apex?

Quick trigger question.

Beginnerapextesting

What is the purpose of Test.startTest() and Test.stopTest()?

Basic testing question.

Beginnerapextype-conversion

How do you convert between Strings, Integers and Dates?

Parse values from a CSV file.

Beginnerapexstrings

What is the difference between == and equals() in Apex?

Quick comparison question.

Beginnerapexwrapper-class

What is a wrapper class and when do you use one?

A table needs records plus a "selected" checkbox.

Beginnerapextriggerslimits

What is the maximum number of records Trigger.new can contain?

Rapid-fire limits question.

Beginnerapexinterfaces

What is an interface in Apex? Give an example.

Basic OOP question.

Beginnerapexuserinfo

How do you get the current user's details in Apex?

Quick question.

Beginnerapexgovernor-limitsexceptions

What is a governor limit exception and can you catch it?

Quick limits question.

Beginnerapexconstantsfinal

What does the "final" keyword mean in Apex?

Quick language question.

Beginnerapextriggersfield-change

How do you check if a field value changed in a trigger?

Run logic only when Status changes.

Beginnerapexlimits-class

What is the Limits class used for?

Quick question.