Hi All,I am preparing for PD2 and have an exam scheduled on coming Sunday, thought to double confirm with forums for few questions.1. Consider the following queries. For these queries, assume that there are more than 200000 Account records. These records include soft-deleted records; that is, deleted records are still in Recycle Bin. Notre that there are two fields that are marked as External Id on the Account. These fields are Customer_Number__c and ERP_Key__ca. SELECT Id FROM Account WHERE Id IN :aListVariableb. SELECT Id FROM Account WHERE Name !='' AND IsDeleted = falsec. SELECT Id FROM Account WHERE Name != NULLd. SELECT Id FROM Account WHERE Name != '' AND Customer_Number__c = 'ValueA'My Answer: A,DReason: Perfroming SOQL on Id field or ExternalID field will be faster as they are indexed.2. An Apex trigger creates and Order__c record every time an Opportunity is won by Sales Rep. Recently a trigger is creating two orders. What is the optimal method for a developer to troubleshoot this?a. Set up debug logging for each Sales Rep, then monitor the logs for errors and exceptions.b. Run the Apex test classes for the apex trigger to ensure the code still has sufficient code coveragec. Turn off all the Workflow Rules, then turn on one at a time to see which one causes the errorsd. Add system.debug() statements to the code and use the developer console logs to trace the codeMy Answer: DReason: This is easier process for debuging, Option A is asking to create debug log for all users hance it will be useless3. A developer wishes to improve the runtime performance of the Apex calls by caching results on the clienta. Set a cookie in the browser for use upon return to the pageb. Call the setStorable() method on the action in the JavaScript client-side code.c. Decorate the server-side method with @AuraEnabled(cacheable=true)d. Decorate the server-side method with @AuraEnabled(storable=true)My Answer: CReason: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_storable_actions.htm having doubt as many places people are still saying B4. When calling a Restful web service a developer receives a JSON payload that has a data hierarchy that is three levels deep. How can the developer describe the external data?a. Deserialize the data and then process it.b. Declare a class with three levels and deserialize the JSON typed with this classc. Use the ANT migration tool, the custom metadata API, or the Dataloaderd. Use middleware to flatten the JSON and consume it as a new custom objectMy Answer: BReason: Create an Inner class and deserialize it with the inner class5. A visualforce page loads slowly due to the large amount of data it displays. Which strategy can a developer use to improve the performance?a. Use the transient keyword for the List variables used in the custom controllerb. Use the lazy loading to load the data on demand, instead of in the controller's constructorc. Use an <apex:actionPolar> in the page to load all of the data asynchronously.d. Use Javascript to move data processing to the browser instead of the controllerMy Answer: BReason: Option is well explanatory whereas other options will not fit in this requirement
Hi Madhu,This forum's main intention is to help developers or people who are having issues with salesforce.But you can't post this type of question here.Regards,Salesforce Support.