You are currently viewing Salesforce Developer Interview Questions Part4

Salesforce Developer Interview Questions Part4

Salesforce Developer Interview Question – Apex continued

APEX (Continued)

51. What is a wrapper class in salesforce?

Answer:

A wrapper class is an apex class with a collection of different data types. As the name suggests a wrapper class in salesforce allows developers to combine different data types and use them for specific purposes.

A common wrapper class example is displaying the list of accounts on a visualforce page or lightning component along with a checkbox. Here we are wrapping account records along with a Boolean which is used for checkbox.


52. What are annotations in apex? Or what are the annotations supported by apex?

Answer:

An apex annotation modifies the way that a method or class is used. Annotations are defined with an initial @ symbol, followed by the appropriate keyword.

Apex supports the following annotations :

@AuraEnabled

@Deprecated

@Future

@isTest

@testSetup

@ InvocableMethod

@ InvocableVariable

@ JasonAccess

@ NamespaceAccessible

@ Readonly

@ RemoteAction

@ Suppresswarnings

@ Testvisible

@ RestResource

@ HttpGet

@ HttpPatch

@ HttpPost

@ HttpPut


53. What are some governor limits which are very frequently encountered in salesforce apex ?

Answer:

Governor limits per transactions:

DescriptionSynchronous LimitAsynchronous Limit
Total number of SOQL queries issued100200
Total number of records retrieved by SOQL queries50,00050,000
Total number of records retrieved by Database.getQueryLocator10,00010,000
Total number of SOSL queries issued2020
Total number of records retrieved by a single SOSL query20002000

More governour limits

DescriptionSynchronous LimitAsynchronous Limit
Total number of DML statements issued150150
Maximum number of methods with the future annotation allowed per Apex invocation500 in batch and future contexts;1 in queueable context
Maximum CPU time on the Salesforce servers510,000 milliseconds60,000 milliseconds
Maximum number of EventBus.publish calls for platform events configured to publish immediately150150

Leave a Reply