salesforce interview Question Answers part 19

188. How can you prioritize the batch apex jobs pending in the queue.
Ans: This can be done by reordering jobs from set up -> Apex Flex Queue Or can even be done through apex code.
     We can use FlexQueue methods to do this in apex. Example: moveAfterJob,moveBeforeJob etc

189. How many records can a SOSL query return?
Ans: A SOSL Queury can return upto 2000 records only.

190. How many @future method invocations are allowed per apex transaction?
Ans: 50 future method invocation are allowed per apex transaction

191. What is the total heap size limit in case of synchronous and Asynchronous transaction?
Ans: 6MB in case of synchronous and 12 MB in case of Asynchronous transactions

192. How can you track the progress of a scheduled job thorugh apex?
Ans: This can be done query the object CronTrigger which stores all the relevant information like number of times the job was run, next run time etc.

193. How many scheduled jobs can you have at one time?
Ans: We can have upto only 100 jobs scheduled in the org.

194. How can you make callouts in @future methods?
Ans: this can be done by mentioning callout=true

195. How can you expose your class for external application as a REST resource?
Ans: This can be done by using the annotation @RestResource 

196. When is @HttpPut annotated method calles in case of REST?
Ans: This method is calles when a put request is sent which creates or updates.

197. Can a map key hold a null value?
Ans: Yes a key can be a null value.

198. What happens when you add a entry that has the key which is already exists in the map?
Ans: This overwrites the already existing value against that key.

199. Can you have 2 different keys of type string only differing in case?
Ans: Yes this is possible as the keys of type string are case sensitive and can have multiple simialr strings differing only in case.

200. Do test classes count against the apex code limit for the organisation?
Ans : No classes marked as isTest are not counted against apex code limit.

201. What is the use of creating remote site settings?
Ans: A apex callout can succefully call the external site only if it is defined in remote site setting else the callout fails.

1 comment:

  1. Hai Author, Very Good informative blog post,