SF Quiz
Apex Basics Quiz
5 quick questions to test your core Apex knowledge. Select an answer for each question, then submit to see your score.
Question 1 of 5
What is the correct way to declare a list of Integer in Apex?
Question 2 of 5
In an Apex trigger, which context variable holds the list of new versions of the records?
Question 3 of 5
What is the default heap size limit for a synchronous Apex transaction?
Question 4 of 5
Which keyword prevents an Apex class from being extended?
Question 5 of 5
What does SOQL stand for?
Please answer all questions before submitting.
About this quiz
This short quiz checks five basics that come up often in Salesforce developer interviews: lists, trigger context variables, governor limits, class modifiers and SOQL. Try it first, then use the notes below to revise any question you missed.
Quick revision notes
- Lists: declare a list with the generic type, for example
List<Integer> numbers = new List<Integer>();. Lists keep order and allow duplicates. Sets hold unique values and Maps hold key and value pairs. - Trigger context variables:
Trigger.newholds the new versions of records,Trigger.oldthe old versions, andTrigger.newMapandTrigger.oldMapgive the same records by Id. Flags such asTrigger.isInserttell you which event fired. - Governor limits: they protect shared resources. The heap size limit is 6 MB for synchronous Apex and 12 MB for asynchronous Apex. Other key limits cover SOQL queries, DML statements and CPU time.
- Class modifiers: an Apex class or method cannot be extended or overridden unless it is marked
virtualorabstract. - SOQL: the Salesforce Object Query Language. It reads data from Salesforce objects, in a way that looks like SQL.
What to study next
- Governor limits in detail and how bulkification keeps you within them.
- The difference between before and after triggers.
- Collections: List, Set and Map, and when to use each.
- Asynchronous Apex: future methods, Queueable and Batch Apex.
FAQ
How many attempts do I get?
As many as you like. Use the Retake Quiz button.
Is the quiz scored?
Yes. After you answer all five questions, submit the quiz to see your score.