Apex Programming Flashcards
6 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 6 Apex Programming flashcards as text
Which Apex collection type automatically prevents duplicate values?
Answer: Set
A Set is an unordered collection that does not allow duplicate values.
What does the 'with sharing' keyword enforce in an Apex class?
Answer: The current user's record-level sharing rules
'with sharing' enforces the running user's sharing rules so they cannot access records they don't have permission to see.
How many DML statements can be executed in a single Apex transaction?
Answer: 200
Salesforce allows up to 150 DML statements per Apex transaction.
Which Apex method is used to convert a List to a Set to remove duplicates?
Answer: new Set(myList)
You can pass a List directly into a Set constructor (e.g., new Set(myList)) to eliminate duplicates.
What is the correct syntax to query all Accounts in Apex?
Answer: [SELECT Id, Name FROM Account]
Inline SOQL in Apex uses square brackets and requires explicit field names — wildcards are not supported.
In Apex, what keyword marks a method that can be called from a Visualforce page or Lightning component?
Answer: @AuraEnabled
@AuraEnabled exposes an Apex method so it can be invoked from Lightning components.
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
- help.salesforce.com — Exam information · verified Oct 2026
- help.salesforce.com — Test delivery, eligibility, fees · verified Oct 2026