Salesforce Decode
Salesforcedecode
All topics

Learn Apex

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

114 questions in this topic

Difficulty Level

Focus Area (Triggers, Async, etc.)

Showing 16 of 114 Apex questions

Beginnerapexbasicscode

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.

Beginnernull-safetydefensive

Apply defensive null and empty collection handling in Apex

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