@palerock/exam-qa 1.0.6-patch7 → 1.0.6-patch9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.html +1 -1
- package/dist/static/css/app.fd231942cceca596d19d7c73127c1866.css +2 -0
- package/dist/static/css/app.fd231942cceca596d19d7c73127c1866.css.map +1 -0
- package/dist/static/js/app.0f8ac84117aeb28818e0.js +2 -0
- package/dist/static/js/app.0f8ac84117aeb28818e0.js.map +1 -0
- package/dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +1 -1
- package/lib-json/Dev1/346/250/241/346/213/237/345/215/267A.json +1473 -0
- package/lib-json/Dev1/346/250/241/346/213/237/345/215/267B.json +1469 -0
- package/lib-json/Dev1/346/265/201/347/250/213/350/207/252/345/212/250/345/214/226/344/270/216/351/200/273/350/276/2212.json +997 -0
- package/lib-json/Dev1/346/265/213/350/257/225_/350/260/203/350/257/225_/351/203/250/347/275/262.json +889 -0
- package/lib-json/Dev1/347/224/250/346/210/267/347/225/214/351/235/242.json +1191 -0
- package/lib-json/map.json +5 -43
- package/package.json +3 -2
- package/dist/static/css/app.b6702c486068e71abe37757ba728d7bb.css +0 -2
- package/dist/static/css/app.b6702c486068e71abe37757ba728d7bb.css.map +0 -1
- package/dist/static/js/app.6e0d50a3c8d671073c38.js +0 -2
- package/dist/static/js/app.6e0d50a3c8d671073c38.js.map +0 -1
@@ -0,0 +1,997 @@
|
|
1
|
+
{
|
2
|
+
"title": "Dev1流程自动化与逻辑2",
|
3
|
+
"category": "Dev1-自由部落侠",
|
4
|
+
"questions": [
|
5
|
+
{
|
6
|
+
"describe": "<p>Refer to the following Apex code:</p><p>Integer x= 0;</p><p>do {</p><p> x=1;</p><p> x++;</p><p>}while(x<1);</p><p>System.debug(x);</p><p>What is the value of x when it is written to the debug log?</p><p><br/></p>",
|
7
|
+
"answerOptions": [
|
8
|
+
{
|
9
|
+
"describe": "<p>0</p>",
|
10
|
+
"isRight": false
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"describe": "<p>1</p>",
|
14
|
+
"isRight": false
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"describe": "<p>2</p>",
|
18
|
+
"isRight": true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"describe": "<p>3</p>",
|
22
|
+
"isRight": false
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"hashCode": "1988675003"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"describe": "<p>Refer to the following code snippet for an environment has more than 200 Accounts belonging to the 'Technology' industry:</p><p>for(Account thisAccount : [Select Id, Industry FROM Account LIMIT 150]){</p><p> if(thisAccount.Industry == 'Technology' ){</p><p> thisAccount.Is_Tech__c = true;</p><p> }</p><p>update thisAccount;</p><p>}</p><p><br/></p><p>When the code executes, what happens as a result of the Apex transaction?</p><p><br/></p>",
|
29
|
+
"answerOptions": [
|
30
|
+
{
|
31
|
+
"describe": "<p>If executed in an asynchronous context, the Apex transaction is likely to fail by exceeding the DML governor limit.</p>",
|
32
|
+
"isRight": false
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"describe": "<p>If executed in a synchronous context, the Apex transaction is likely to fail by exceeding the DML governor limit.</p>",
|
36
|
+
"isRight": false
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"describe": "<p>The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.</p>",
|
40
|
+
"isRight": false
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"describe": "<p>The Apex transaction fails with the following message: Sobject row was retrieved via SOQL without querying the requested field: Account.Is_Tech__c.</p>",
|
44
|
+
"isRight": true
|
45
|
+
}
|
46
|
+
],
|
47
|
+
"hashCode": "1988675002"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"describe": "<p>Considering the following code snippet:</p><p>public static void insertAccounts(List<Account> theseAccounts){</p><p> for(Account thisAccount : theseAccounts) {</p><p> if(thisAccount.website == null) {</p><p> thisAccount.website = 'https://www.demo.com';</p><p> }</p><p> }</p><p> update theseAccounts;</p><p>}</p><p>when the code executes, a DML exceptionis thrown.</p><p>How should the developer modify the code to ensure exceptions are handled gracefully?</p><p><br/></p>",
|
51
|
+
"answerOptions": [
|
52
|
+
{
|
53
|
+
"describe": "<p>Remove null items from the list of Accounts.</p>",
|
54
|
+
"isRight": false
|
55
|
+
},
|
56
|
+
{
|
57
|
+
"describe": "<p>Implement Change Data Capture.</p>",
|
58
|
+
"isRight": false
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"describe": "<p>Implement the upsert DML statement.</p>",
|
62
|
+
"isRight": false
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"describe": "<p>Implement a try/catch block for the DML.</p>",
|
66
|
+
"isRight": true
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"hashCode": "1988675001"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"describe": "<p>The orderHelper class is a utility class that contains business logic for processing orders. Consider the code snippet:</p><p><br/></p><p>public class without sharing OrderHelper{</p><p>//code implementation.</p><p>}</p><p><br/></p><p>A developer needs to create a constant named DELIVERY_MULTIPLIER with a value of 4.15, The valua of instant should not change at any time in the code.</p><p>How should the developer declare the DELIVERY_MULTIPLIER Constant to meet the business objectives?</p><p><br/></p>",
|
73
|
+
"answerOptions": [
|
74
|
+
{
|
75
|
+
"describe": "<p>static decimal DELIVERY MULTIPLIER =4.15;</p>",
|
76
|
+
"isRight": false
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"describe": "<p>static final decimal DELIVERY MULTIPLIER =4.15;</p>",
|
80
|
+
"isRight": true
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"describe": "<p>decimal DELIVERY MULTIPLIER =4.15;</p>",
|
84
|
+
"isRight": false
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"describe": "<p>constant decimal DELIVERY MULTIPLIER =4.15;</p>",
|
88
|
+
"isRight": false
|
89
|
+
}
|
90
|
+
],
|
91
|
+
"hashCode": "1988675000"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"describe": "<p>A developer wrote the following two classes:</p><p><br/></p><p>public with sharing class statusFetcher{</p><p>private Boolean active = true;</p><p>private Boolean isActive(){</p><p>return active;</p><p>}</p><p>}</p><p>public with sharing class Calculator{</p><p>public void doCalculations()</p><p>StatusFetcher sFetcher = new StatusFetcher();</p><p>if(sFetcher.isActive())</p><p>//do calculatlons here</p><p>}</p><p> }</p><p>}</p><p><br/></p><p>The StatusFetcher class successfully complled and saved.However, the calculator class has a compile time error.</p><p>How should the developer fix this code?</p><p><br/></p>",
|
95
|
+
"answerOptions": [
|
96
|
+
{
|
97
|
+
"describe": "<p>Make the docalculations method in the calculator class private.</p>",
|
98
|
+
"isRight": false
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"describe": "<p>Change the class declaration for the calculator class to public with inherited sharing.</p>",
|
102
|
+
"isRight": false
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"describe": "<p>Change the class declaration for the statusFetcher class to public with inherited sharing.</p>",
|
106
|
+
"isRight": false
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"describe": "<p>Make the isActive method in the statusFetcher class public.</p>",
|
110
|
+
"isRight": true
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"hashCode": "1988674999"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"describe": "<p>Given the code below in an Apex class:</p><p><br/></p><p>List<Account> aList=[SELECT Id, Active_c EROM Account];</p><p>for (Account a : a List){</p><p>if[!a.Active_c){</p><p>a.Name = 'INACTIVE';</p><p>}</p><p>}</p><p>update aList;</p><p><br/></p><p>What should a developer do to correct the code so that there is no chance of hitting a govermorlimit?</p><p><br/></p>",
|
117
|
+
"answerOptions": [
|
118
|
+
{
|
119
|
+
"describe": "<p>Change the DML to use Database.update(aList,true);</p>",
|
120
|
+
"isRight": false
|
121
|
+
},
|
122
|
+
{
|
123
|
+
"describe": "<p>Change the DML to use Database.updiate(aList,false);</p>",
|
124
|
+
"isRight": false
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"describe": "<p>Add a LIMIT clause to the SOQL statement.</p>",
|
128
|
+
"isRight": false
|
129
|
+
},
|
130
|
+
{
|
131
|
+
"describe": "<p>Add a WRERE clause to the SOQL statement.</p>",
|
132
|
+
"isRight": true
|
133
|
+
}
|
134
|
+
],
|
135
|
+
"hashCode": "1988674998"
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"describe": "<p>A lead developer creates an Apex interface called "Laptop". Consider the following code snippet:</p><p><br/></p><p>public class SilverLaptop{</p><p>//code implementaticn</p><p>}</p><p><br/></p><p>How can a developer use the Laptop interface within the SilverLaptop class?</p><p><br/></p>",
|
139
|
+
"answerOptions": [
|
140
|
+
{
|
141
|
+
"describe": "<p>@Extends(class="Laptop")\npublic class SilverLaptop</p>",
|
142
|
+
"isRight": false
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"describe": "<p>public class SilverLaptop extends Laptop</p>",
|
146
|
+
"isRight": false
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"describe": "<p>@Interface (class="Laptop")\npublic class SilverLaptop</p>",
|
150
|
+
"isRight": false
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"describe": "<p>public class SilverLaptop implements Laptop</p>",
|
154
|
+
"isRight": true
|
155
|
+
}
|
156
|
+
],
|
157
|
+
"hashCode": "1988674997"
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"describe": "<p>Management asked for opportunities to be automatically created for accounts with annual revenue greater then $1000000. A developer created the following trigger on the Account object to satisfy this requirement.</p><p>For(Account a : Trigger.new) {</p><p> if(a.AnnualRevenue > 1000000) {</p><p> List<Opportunity> oppList = [SELECT Id FROM Opportunity WHERE accountId = :a.Id];</p><p> if(oppList.size() ==0) {</p><p> Opportunity oppty = new Opportunity(Name = a.Name, StageName = 'Prospecting', CloseDate = system.today().addDays(30);</p><p> insert oppty;</p><p> }</p><p> }</p><p>}</p><p>Users are able to update the account records via the UI and can see an opportunity created for high annual revenue accounts. However, when the administrator tries to upload a list of 179 accounts using Data Loader, if fails with System.Exception errors.</p><p>Which two actions should the developer take to fix the code segment shown above? Choose 2 answers</p><p><br/></p>",
|
161
|
+
"answerOptions": [
|
162
|
+
{
|
163
|
+
"describe": "<p>Move the DML that saves opportunities outside the for loop.</p>",
|
164
|
+
"isRight": true
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"describe": "<p>Use Database.query to query the opportunities.</p>",
|
168
|
+
"isRight": false
|
169
|
+
},
|
170
|
+
{
|
171
|
+
"describe": "<p>Check if all the required fields for Opportunity are being added on creation.</p>",
|
172
|
+
"isRight": false
|
173
|
+
},
|
174
|
+
{
|
175
|
+
"describe": "<p>Query for existing opportunities outside the for loop.</p>",
|
176
|
+
"isRight": true
|
177
|
+
}
|
178
|
+
],
|
179
|
+
"hashCode": "1988674996"
|
180
|
+
},
|
181
|
+
{
|
182
|
+
"describe": "<p>A developer is building custom search functionality that uses SOSL to search account and contact records that match search terms provided by the end user. The feature is exposed through a Lightning web component, and the end user is able to provide a list of terms to search.</p><p>Consider the following code snippet:</p><p><br/></p><p>@AuraEnabled</p><p>public static List<List<sObject>> searchTerms(List<String> termlist){</p><p>List<List<sObject>> result = new List<List<sObject>>() :</p><p>for(string term: termList) {</p><p>result.addAl1([FIND :term IN ALL FIELDS RETURNING Account Name),</p><p>contact(FirstName,LastName)]};</p><p>}</p><p>return result;</p><p>}</p><p><br/></p><p>What is the maximum number of search terms the end user can provide to successfully execute the search without exceeding a governor limit?</p><p><br/></p>",
|
183
|
+
"answerOptions": [
|
184
|
+
{
|
185
|
+
"describe": "<p>20</p>",
|
186
|
+
"isRight": false
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"describe": "<p>150</p>",
|
190
|
+
"isRight": false
|
191
|
+
},
|
192
|
+
{
|
193
|
+
"describe": "<p>200</p>",
|
194
|
+
"isRight": false
|
195
|
+
},
|
196
|
+
{
|
197
|
+
"describe": "<p>2000</p>",
|
198
|
+
"isRight": true
|
199
|
+
}
|
200
|
+
],
|
201
|
+
"hashCode": "1988674995"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"describe": "<p>A developer needs to implement a custom SOAP Web Service that is used by an external Web Application. The developer chooses to include helper methods that are not used by the Web Application in the implementation of the Web Service Class.\nWhich code segment shows the correct declaration of the class and methods?</p>",
|
205
|
+
"answerOptions": [
|
206
|
+
{
|
207
|
+
"describe": "<p>webservice class WebserviceClass {\nprivate Boolean helperMethod() { /* implementation ... */ } \nwebservice static string updateRecords() { /* implementation ... */}\n}</p>",
|
208
|
+
"isRight": false
|
209
|
+
},
|
210
|
+
{
|
211
|
+
"describe": "<p>global class WebServiceClass{\nprivate Boolean helperMethod() { /* implementation ... */ }\nglobal string updateRecords() ( /* implementation ... */ }\n}</p>",
|
212
|
+
"isRight": false
|
213
|
+
},
|
214
|
+
{
|
215
|
+
"describe": "<p>global class WebServiceClass {\nprivate Boolean helperMethod() { 1* implementation ... "/ }\nwebservice static string updateRecords() { 1* implementation ... */ }\n}</p>",
|
216
|
+
"isRight": true
|
217
|
+
},
|
218
|
+
{
|
219
|
+
"describe": "<p>webservice class WebServiceClass {\nprivate Boolean helperMethod() { /* implementation ... */ }\nglobal static string updateRecords() { 1* implementation ... */}\n}</p>",
|
220
|
+
"isRight": false
|
221
|
+
}
|
222
|
+
],
|
223
|
+
"hashCode": "1988674994"
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"describe": "<p>Consider the following code snippet:</p><p><br/></p><p>public static List<Lead> obtainAllFields(Set<Id> 1eadIds) {</p><p>List<Lead> result = new List<Lead>();</p><p>for(Id leadId : leadIds) {</p><p>result.add([SELECT FIELDS(ALL) FROM Lead WHERE Id = :leadId];</p><p>}</p><p>return result;</p><p>}</p><p><br/></p><p>Given the multi-tenant architecture of the Salesforce platform, what is a best practice a developer should implement and ensure successful execution of the method?</p><p><br/></p>",
|
227
|
+
"answerOptions": [
|
228
|
+
{
|
229
|
+
"describe": "<p>Avoid executing queries without a limit clause.</p>",
|
230
|
+
"isRight": false
|
231
|
+
},
|
232
|
+
{
|
233
|
+
"describe": "<p>Avoid returning an empty List of records.</p>",
|
234
|
+
"isRight": false
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"describe": "<p>Avoid using variables as query flters.</p>",
|
238
|
+
"isRight": false
|
239
|
+
},
|
240
|
+
{
|
241
|
+
"describe": "<p>Avold performing queries inside for loops.</p>",
|
242
|
+
"isRight": true
|
243
|
+
}
|
244
|
+
],
|
245
|
+
"hashCode": "1988674972"
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"describe": "<p>Given the following code snippet, that is part of a custom controller for a Visualforce page:</p><p>public void updateContact(Contact thisContact) {</p><p> thisContact.Is_Active__c = false;</p><p> try{</p><p> update thisContact;</p><p> }catch(Exception e) {</p><p> String errorMessage = 'An error occurred while updating the Contact. ' + e.getMessage());</p><p> ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL.errorMessage));</p><p> }</p><p>}</p><p>In which two ways can the try/catch be enclosed to enforce object and field-level permissions and prevent the DML statement from being executed if the </p><p>current logged-in user does not have the appropriate level of access? </p><p>Choose 2 answers</p><p><br/></p>",
|
249
|
+
"answerOptions": [
|
250
|
+
{
|
251
|
+
"describe": "<p>Use if (thisContact.OwnerId == UserInfo.getUserId())</p>",
|
252
|
+
"isRight": false
|
253
|
+
},
|
254
|
+
{
|
255
|
+
"describe": "<p>Use if (Schema.sObjectType.Contact.isUpdatable())</p>",
|
256
|
+
"isRight": true
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"describe": "<p>Use if (Schema.sObjectType.Contact.isAccessible())</p>",
|
260
|
+
"isRight": false
|
261
|
+
},
|
262
|
+
{
|
263
|
+
"describe": "<p>Use if (Schema.sObjectType.Contact.fields.Is_Active__c.isUpdateable())</p>",
|
264
|
+
"isRight": true
|
265
|
+
}
|
266
|
+
],
|
267
|
+
"hashCode": "1988674970"
|
268
|
+
},
|
269
|
+
{
|
270
|
+
"describe": "<p>What should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "UC"?</p>",
|
271
|
+
"answerOptions": [
|
272
|
+
{
|
273
|
+
"describe": "<p>SELECT lead(id, name), account(id, name), contact(id, name) FROM Lead, Account, Contact WHERE Name = 'UC'</p>",
|
274
|
+
"isRight": false
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"describe": "<p>FIND 'UC' IN Name Fields RETURNING lead (id, name), account (id, name), contact (id, name)</p>",
|
278
|
+
"isRight": true
|
279
|
+
},
|
280
|
+
{
|
281
|
+
"describe": "<p>SELECT Lead.id, Lead.Name, Account.Id, Account.Name, Contact.Id, Contact.Name FROM Lead, Account, Contact WHERE CompanyName = 'UC'</p>",
|
282
|
+
"isRight": false
|
283
|
+
},
|
284
|
+
{
|
285
|
+
"describe": "<p>FIND 'UC' IN CompanyName Fields RETURNING lead(id, name), account(id, name), contact(id, name)</p>",
|
286
|
+
"isRight": false
|
287
|
+
}
|
288
|
+
],
|
289
|
+
"hashCode": "1988674969"
|
290
|
+
},
|
291
|
+
{
|
292
|
+
"describe": "<p>Example 1:</p><p>AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId];</p><p>for (AggregateResult ar : groupedResults) </p><p>{</p><p> System.debug( 'Campaign ID' + ar.get('CampaignId'));</p><p> System.debug( 'Average amount' + ar.get('expr0'));</p><p>}</p><p><br/></p><p>Example 2:</p><p>AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId];</p><p>for (AggregateResult ar : groupedResults) </p><p>{</p><p> System.debug( 'Campaign ID' + ar.get('CampaignId'));</p><p> System.debug( 'Average amount' + ar.get('theAverage'));</p><p>}</p><p><br/></p><p>Example 3:</p><p>AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) FROM Opportunity GROUP BY CampaignId];</p><p>for (AggregateResult ar : groupedResults) </p><p>{</p><p> System.debug( 'Campaign ID' + ar.get('CampaignId'));</p><p> System.debug( 'Average amount' + ar.get.AVG());</p><p>}</p><p><br/></p><p>Example 4:</p><p>AggregateResult[ ] groupedResults = [ SELECT CampaignId, AVG(Amount) theAverage FROM Opportunity GROUP BY CampaignId];</p><p>for (AggregateResult ar : groupedResults) </p><p>{</p><p> System.debug( 'Campaign ID' + ar.get('CampaignId'));</p><p> System.debug( 'Average amount' + ar.theAverage);</p><p>}</p><p>Which two examples above use the System.debug statements to correctly display the results from the SOQL aggregate queries?</p><p>Choose 2 answers</p><p><br/></p>",
|
293
|
+
"answerOptions": [
|
294
|
+
{
|
295
|
+
"describe": "<p>Example 1</p>",
|
296
|
+
"isRight": true
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"describe": "<p>Example 2</p>",
|
300
|
+
"isRight": true
|
301
|
+
},
|
302
|
+
{
|
303
|
+
"describe": "<p>Example 3</p>",
|
304
|
+
"isRight": false
|
305
|
+
},
|
306
|
+
{
|
307
|
+
"describe": "<p>Example 4</p>",
|
308
|
+
"isRight": false
|
309
|
+
}
|
310
|
+
],
|
311
|
+
"hashCode": "1988674967"
|
312
|
+
},
|
313
|
+
{
|
314
|
+
"describe": "<p>Refer to the following code that runs in an Execute Anonymous block:</p><p>for( List<Lead> theseLeads : [SELECT LastName, Company, Email FROM Lead LIMIT 20000]) {</p><p> for(Lead thisLead : theseLeads) {</p><p> if(thisLead.Email == null)</p><p> thisLead.Email = assignGenericEmail(thisLead.LastName, thisLead.Company);</p><p> }</p><p> Database.Update(theseLeads, false);</p><p>}</p><p>In an environment where the full result set is returned, what is a possible outcome of this code?</p><p><br/></p>",
|
315
|
+
"answerOptions": [
|
316
|
+
{
|
317
|
+
"describe": "<p>The transaction will succeed and the first ten thousand records will be committed to the database.</p>",
|
318
|
+
"isRight": false
|
319
|
+
},
|
320
|
+
{
|
321
|
+
"describe": "<p>The total number of DML statements issued will be exceeded.</p>",
|
322
|
+
"isRight": false
|
323
|
+
},
|
324
|
+
{
|
325
|
+
"describe": "<p>The total number of records processed as a result of DML statements will be exceeded.</p>",
|
326
|
+
"isRight": true
|
327
|
+
},
|
328
|
+
{
|
329
|
+
"describe": "<p>The transaction will succeed and the full result set changes will be committed to the database.</p>",
|
330
|
+
"isRight": false
|
331
|
+
}
|
332
|
+
],
|
333
|
+
"hashCode": "1988674966"
|
334
|
+
},
|
335
|
+
{
|
336
|
+
"describe": "<p>Given the code below:</p><p>List<Account> aList = [SELECT Id FROM Account];</p><p>for(Account a : aList) {</p><p> List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId =:a.Id];</p><p>}</p><p>What should a developer do to correct the code so that there is no chance of hitting a governor limit?</p><p><br/></p>",
|
337
|
+
"answerOptions": [
|
338
|
+
{
|
339
|
+
"describe": "<p>Add a LIMIT clause to the first SELECT SOQL statement.</p>",
|
340
|
+
"isRight": false
|
341
|
+
},
|
342
|
+
{
|
343
|
+
"describe": "<p>Rework the code and eliminate the for loop.</p>",
|
344
|
+
"isRight": false
|
345
|
+
},
|
346
|
+
{
|
347
|
+
"describe": "<p>Add a WHERE clause to the first SELECT SOQL statement.</p>",
|
348
|
+
"isRight": false
|
349
|
+
},
|
350
|
+
{
|
351
|
+
"describe": "<p>combine the two SELECT statements into a single SOQL statement.</p>",
|
352
|
+
"isRight": true
|
353
|
+
}
|
354
|
+
],
|
355
|
+
"hashCode": "1988674964"
|
356
|
+
},
|
357
|
+
{
|
358
|
+
"describe": "<p>In the following example, which sharing context will myMethod execute when it is invoked?</p><p><br/></p><p>public Class myClass {</p><p> public void myMethod( ) { /* implementation */ }</p><p>}</p><p><br/></p>",
|
359
|
+
"answerOptions": [
|
360
|
+
{
|
361
|
+
"describe": "<p>Sharing rules will be inherited from the calling context.</p>",
|
362
|
+
"isRight": true
|
363
|
+
},
|
364
|
+
{
|
365
|
+
"describe": "<p>Sharing rules will not be enforced for the running user.</p>",
|
366
|
+
"isRight": false
|
367
|
+
},
|
368
|
+
{
|
369
|
+
"describe": "<p>Sharing rules will be enforced for the running user.</p>",
|
370
|
+
"isRight": false
|
371
|
+
},
|
372
|
+
{
|
373
|
+
"describe": "<p>Sharing rules will be enforced by the instantiating class.</p>",
|
374
|
+
"isRight": false
|
375
|
+
}
|
376
|
+
],
|
377
|
+
"hashCode": "1988674963"
|
378
|
+
},
|
379
|
+
{
|
380
|
+
"describe": "<p>A Next Best Action strategy uses an Enhance Element that invokes an Apex method to determine a discount level for a Contact, based on a number of factors.\nWhat is the correct definition of the Apex method?</p>",
|
381
|
+
"answerOptions": [
|
382
|
+
{
|
383
|
+
"describe": "<p> @InvocableMethod</p><p> global static List<List<Recommendation>></p><p> getLevel (List<ContactWrapper> input)</p><p> { /*implementation*/ }</p><p><br/></p>",
|
384
|
+
"isRight": true
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"describe": "<p> @InvocableMethod</p><p> global List<List<Recommendation>></p><p> getLevel (List<ContactWrapper> input)</p><p> { /*implementation*/ }</p><p><br/></p>",
|
388
|
+
"isRight": false
|
389
|
+
},
|
390
|
+
{
|
391
|
+
"describe": "<p> @InvocableMethod</p><p> global Recommendation getLevel (ContactWrapper input)</p><p> { /*implementation*/ }</p><p><br/></p>",
|
392
|
+
"isRight": false
|
393
|
+
},
|
394
|
+
{
|
395
|
+
"describe": "<p> @InvocableMethod</p><p> global static ListRecommendation</p><p> getLevel (List<ContactWrapper> input)</p><p> { /*implementation*/ }</p><p><br/></p>",
|
396
|
+
"isRight": false
|
397
|
+
}
|
398
|
+
],
|
399
|
+
"hashCode": "1988674290"
|
400
|
+
},
|
401
|
+
{
|
402
|
+
"describe": "<p>Refer to the following code snippet for an environment has more than 200 Accounts belonging to the 'Technology' industry:</p><p>for(Account thisAccount : [Select Id, Industry FROM Account LIMIT 150]){</p><p> if(thisAccount.Industry == 'Technology' ){</p><p> thisAccount.Is_Tech__c = true;</p><p> }</p><p>update thisAccount;</p><p>}</p><p><br/></p><p>When the code executes which two events occur as a result of the Apex transaction?Choose 2 answers</p><p><br/></p>",
|
403
|
+
"answerOptions": [
|
404
|
+
{
|
405
|
+
"describe": "<p>If executed in a synchronous context, the apex transaction is likely to fail by exceeding the DML governor limit.</p>",
|
406
|
+
"isRight": true
|
407
|
+
},
|
408
|
+
{
|
409
|
+
"describe": "<p>The Apex transaction fails with the following message: "SObject row was retrieved via SOQL without querying the requested field:Account.Is_Tech__ c" .</p>",
|
410
|
+
"isRight": true
|
411
|
+
},
|
412
|
+
{
|
413
|
+
"describe": "<p>If executed in an asynchronous context, the apex transaction is likely to fail by exceeding the DML governor limit.</p>",
|
414
|
+
"isRight": false
|
415
|
+
},
|
416
|
+
{
|
417
|
+
"describe": "<p>The Apex transcation succeeds regardless of any uncaught exception and all processed accounts are updated.</p>",
|
418
|
+
"isRight": false
|
419
|
+
}
|
420
|
+
],
|
421
|
+
"hashCode": "1988674288"
|
422
|
+
},
|
423
|
+
{
|
424
|
+
"describe": "<p>A developer wants to mark each Account in a List<Account> as either Active or Inactive based on the LastModifiedDate field value being more than 90 days.</p><p>Which Apex technique should the developer use?</p><p><br/></p>",
|
425
|
+
"answerOptions": [
|
426
|
+
{
|
427
|
+
"describe": "<p>A switch statement, with a for loop inside</p>",
|
428
|
+
"isRight": false
|
429
|
+
},
|
430
|
+
{
|
431
|
+
"describe": "<p>A for loop, with a switch statement inside</p>",
|
432
|
+
"isRight": false
|
433
|
+
},
|
434
|
+
{
|
435
|
+
"describe": "An if/else statement, with a for loop inside",
|
436
|
+
"isRight": false
|
437
|
+
},
|
438
|
+
{
|
439
|
+
"describe": "<p>A for loop, with an if/else statement inside</p>",
|
440
|
+
"isRight": true
|
441
|
+
}
|
442
|
+
],
|
443
|
+
"hashCode": "1988674287"
|
444
|
+
},
|
445
|
+
{
|
446
|
+
"describe": "<p>What is the result of the following code?</p><p>Account a = new Account( );</p><p>Database. insert(a, false);</p><p><br/></p>",
|
447
|
+
"answerOptions": [
|
448
|
+
{
|
449
|
+
"describe": "<p>The record will not be created and no error will be reported .</p>",
|
450
|
+
"isRight": true
|
451
|
+
},
|
452
|
+
{
|
453
|
+
"describe": "<p>The record will be created and no error will be reported.</p>",
|
454
|
+
"isRight": false
|
455
|
+
},
|
456
|
+
{
|
457
|
+
"describe": "<p>The record will be created and a message will be in the debug log.</p>",
|
458
|
+
"isRight": false
|
459
|
+
},
|
460
|
+
{
|
461
|
+
"describe": "<p>The record will not be created and an exception will be thrown.</p>",
|
462
|
+
"isRight": false
|
463
|
+
}
|
464
|
+
],
|
465
|
+
"hashCode": "1988674286"
|
466
|
+
},
|
467
|
+
{
|
468
|
+
"describe": "<p>The following Apex method is part of the ContactSertvice class that is called from a trigger:</p><p>public static void setBusinessUnitToEMEA(Contact thisContact){</p><p> thisContact . Business_Unit__c = 'EMEA';</p><p> update thisContact;</p><p>}</p><p><br/></p><p>How should the developer modify the code to ensure best practices are met?</p><p><br/></p>",
|
469
|
+
"answerOptions": [
|
470
|
+
{
|
471
|
+
"describe": "<p>public static void setBusinessUnitToEMEA(List<Contact> contacts){</p><p> for(Contact thisContact : contacts){</p><p> thisContact . Business_Unit__ c = 'EMEA';</p><p> update contacts[0];</p><p> } </p><p>}</p><p><br/></p>",
|
472
|
+
"isRight": false
|
473
|
+
},
|
474
|
+
{
|
475
|
+
"describe": "<p>public static void setBusinessUnitToEMEA(List<Contact> contacts){</p><p> for(Contact thisContact : contacts){</p><p> thisContact . Business_Unit__ c = 'EMEA';</p><p> }</p><p> update contacts;</p><p>}</p><p><br/></p>",
|
476
|
+
"isRight": true
|
477
|
+
},
|
478
|
+
{
|
479
|
+
"describe": "<p>public static void setBusinessUnitToEMEA(Contact thisContact){</p><p> List<Contact> contacts = new list<Contacts>( );</p><p> contacts. add(thisContact. Business_Unit__c = 'EMEA');</p><p> update contacts;</p><p>}</p><p><br/></p>",
|
480
|
+
"isRight": false
|
481
|
+
},
|
482
|
+
{
|
483
|
+
"describe": "<p>public void setBusinessUnitToEMEA(List<Contact> contacts){</p><p> contact[0]. Business_Unit__ c = 'EMEA';</p><p> update contacts[0];</p><p>}</p><p><br/></p>",
|
484
|
+
"isRight": false
|
485
|
+
}
|
486
|
+
],
|
487
|
+
"hashCode": "1988674285"
|
488
|
+
},
|
489
|
+
{
|
490
|
+
"describe": "<p>What will be the output in the debug log in the event of a QueryException duing a call to the aQuery method in the following example?</p><p><br/></p><p>class myClass {</p><p> class CustomException extends QueryException { }</p><p> public static Account aQuery( ) {</p><p> Account theAccount;</p><p> try {</p><p> system. debug( ' Querying Accounts. ');</p><p> theAccount = [SELECT Id FROM Account WHERE CreatedDate > TODAY] ;</p><p> }</p><p> catch (CustomException eX) {</p><p> system.debug(' Custom Exception. ');</p><p> }</p><p> catch (QueryException eX) {</p><p> system.debug('Query Exception. ');</p><p> } </p><p> finally {</p><p> system.debug('Done. ');</p><p> }</p><p> return theAccount ;</p><p> }</p><p>}</p><p><br/></p>",
|
491
|
+
"answerOptions": [
|
492
|
+
{
|
493
|
+
"describe": "<p>Querying Accounts. Query Exception.</p>",
|
494
|
+
"isRight": false
|
495
|
+
},
|
496
|
+
{
|
497
|
+
"describe": "<p>Querying Accounts. Custom Exception. Done.</p>",
|
498
|
+
"isRight": false
|
499
|
+
},
|
500
|
+
{
|
501
|
+
"describe": "<p>Querying Accounts. Query Exeption. Done.</p>",
|
502
|
+
"isRight": true
|
503
|
+
},
|
504
|
+
{
|
505
|
+
"describe": "<p>Querying Accounts. Custom Exeption.</p>",
|
506
|
+
"isRight": false
|
507
|
+
}
|
508
|
+
],
|
509
|
+
"hashCode": "1988674284"
|
510
|
+
},
|
511
|
+
{
|
512
|
+
"describe": "<p>What is the result of the following code snippet?</p><p><br/></p><p>public void doWork(Account acct){</p><p> for (Integer i = 0; i <= 200; i++){</p><p> insert acct;</p><p> }</p><p> }</p><p><br/></p>",
|
513
|
+
"answerOptions": [
|
514
|
+
{
|
515
|
+
"describe": "<p>0 Accounts are inserted.</p>",
|
516
|
+
"isRight": true
|
517
|
+
},
|
518
|
+
{
|
519
|
+
"describe": "<p>1 Account is inserted.</p>",
|
520
|
+
"isRight": false
|
521
|
+
},
|
522
|
+
{
|
523
|
+
"describe": "<p>200 Accounts are inserted.</p>",
|
524
|
+
"isRight": false
|
525
|
+
},
|
526
|
+
{
|
527
|
+
"describe": "<p>201 Acconts are inerted.</p>",
|
528
|
+
"isRight": false
|
529
|
+
}
|
530
|
+
],
|
531
|
+
"hashCode": "1988674282"
|
532
|
+
},
|
533
|
+
{
|
534
|
+
"describe": "<p>How many Accounts will be inserted by the following block of code?</p><p><br/></p><p>for(Integer i = 0; i< 500; i++){</p><p> Account a = new Account (Name= 'New Account ' +i);</p><p> insert a;</p><p>}</p><p><br/></p>",
|
535
|
+
"answerOptions": [
|
536
|
+
{
|
537
|
+
"describe": "<p>Change the DML to use Database.updiate(aList,false);</p>",
|
538
|
+
"isRight": false
|
539
|
+
},
|
540
|
+
{
|
541
|
+
"describe": "<p>0</p>",
|
542
|
+
"isRight": true
|
543
|
+
},
|
544
|
+
{
|
545
|
+
"describe": "<p>100</p>",
|
546
|
+
"isRight": false
|
547
|
+
},
|
548
|
+
{
|
549
|
+
"describe": "<p>150</p>",
|
550
|
+
"isRight": false
|
551
|
+
}
|
552
|
+
],
|
553
|
+
"hashCode": "1988674281"
|
554
|
+
},
|
555
|
+
{
|
556
|
+
"describe": "<p>A dveloper must implement a CheckPaymentProcessor class that povides check processing payment capabilities that adhere to what is defined for payments in the PaymentProcessor interface. </p><p><br/></p><p>public interface PaymentProcessor {</p><p> void pay (Decimal amount) ;</p><p>}</p><p><br/></p><p>Which is the correct implementation to use the PaymentProcessor interface class?</p><p><br/></p>",
|
557
|
+
"answerOptions": [
|
558
|
+
{
|
559
|
+
"describe": "<p>public class CheckPaymentProcessor extends PaymentProcessor {</p><p> public void pay (Decimal amount) { }</p><p>}</p><p><br/></p>",
|
560
|
+
"isRight": false
|
561
|
+
},
|
562
|
+
{
|
563
|
+
"describe": "<p>public class CheckPaymentProcessor implements PaymentProcessor {</p><p> public void pay(Decimal amount);</p><p>}</p><p><br/></p>",
|
564
|
+
"isRight": false
|
565
|
+
},
|
566
|
+
{
|
567
|
+
"describe": "<p>public class ChecpaymentProcessor extends PaymentProcessor {</p><p> public void pay(Decimal amount);</p><p>}</p><p><br/></p>",
|
568
|
+
"isRight": false
|
569
|
+
},
|
570
|
+
{
|
571
|
+
"describe": "<p>public class CheckPaymentProcessor implements PaymentProcessor {</p><p>public void pay(Decimal amount) { }</p><p>}</p><p><br/></p>",
|
572
|
+
"isRight": true
|
573
|
+
}
|
574
|
+
],
|
575
|
+
"hashCode": "1988674259"
|
576
|
+
},
|
577
|
+
{
|
578
|
+
"describe": "<p>A developer created a Visualforce page and custom controller to display the account type field as shown below.</p><p>Custom controller code:</p><p><br/></p><p>public with sharing class customCtrlr {</p><p> private Account theAccount;</p><p> public String actType;</p><p> public customCtrlr( ) {</p><p> theAccount = [SELECT Id, Type FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('Id')];</p><p> actType = theAccount.Type;</p><p> }</p><p>}</p><p>Visualforce page snippet:</p><p>The Account Type is {!actType}</p><p><br/></p><p>The value of the account type field is not being displayed correctly on the page. Assuming the custom controller is properly </p><p>referenced on the Visualforce page, what should the developer do to correct the problem?</p><p><br/></p>",
|
579
|
+
"answerOptions": [
|
580
|
+
{
|
581
|
+
"describe": "<p>Add a getter method for the actType attribute.</p>",
|
582
|
+
"isRight": true
|
583
|
+
},
|
584
|
+
{
|
585
|
+
"describe": "Convert theAccount.Type to a String.",
|
586
|
+
"isRight": false
|
587
|
+
},
|
588
|
+
{
|
589
|
+
"describe": "<p>Add with sharing to the custom controller.</p>",
|
590
|
+
"isRight": false
|
591
|
+
},
|
592
|
+
{
|
593
|
+
"describe": "<p>Change theAccount attribute to public.</p>",
|
594
|
+
"isRight": false
|
595
|
+
}
|
596
|
+
],
|
597
|
+
"hashCode": "1988674258"
|
598
|
+
},
|
599
|
+
{
|
600
|
+
"describe": "<p>A developer is tasked to perform a security review of the ContactSearch Apex calss that exists in the system. Within the class, the developer identifies the following method as a security threat:</p><p><br/></p><p>List<Contact> performSearch(String lastName){</p><p> return Database.query('SELECT Id, FirstName, LastName FROM Contact WHERE LastName Like %'+lastName+'%' );</p><p><br/></p><p>What are two ways the developer can update the method to prevent a SOQL injection attack? Choose 2 answers</p><p><br/></p>",
|
601
|
+
"answerOptions": [
|
602
|
+
{
|
603
|
+
"describe": "<p>Use a regular expression expression on the parameter to remove special characters.</p>",
|
604
|
+
"isRight": false
|
605
|
+
},
|
606
|
+
{
|
607
|
+
"describe": "<p>Use the @ReadOnly annotation and the with sharing keyword on the class.</p>",
|
608
|
+
"isRight": false
|
609
|
+
},
|
610
|
+
{
|
611
|
+
"describe": "<p>Use variable binding and replace the dynamic query with a static SOQL.</p>",
|
612
|
+
"isRight": true
|
613
|
+
},
|
614
|
+
{
|
615
|
+
"describe": "<p>Use the escapeSingleQuotes method to sanitize the parameter before its use.</p>",
|
616
|
+
"isRight": true
|
617
|
+
}
|
618
|
+
],
|
619
|
+
"hashCode": "1988674256"
|
620
|
+
},
|
621
|
+
{
|
622
|
+
"describe": "<p>A developer is debugging the following code to determine why Account are not being created.</p><p>Account a = new Account(Name='A');</p><p>Database.insert(a, false);</p><p><br/></p><p>How should the code be altered to help debug the issue?</p><p><br/></p>",
|
623
|
+
"answerOptions": [
|
624
|
+
{
|
625
|
+
"describe": "<p>Collect the insert method return value in a SaveResult record.</p>",
|
626
|
+
"isRight": true
|
627
|
+
},
|
628
|
+
{
|
629
|
+
"describe": "Add a System.debug() statement before the insert method.",
|
630
|
+
"isRight": false
|
631
|
+
},
|
632
|
+
{
|
633
|
+
"describe": "<p>Add a try/catch around the insert method.</p>",
|
634
|
+
"isRight": false
|
635
|
+
},
|
636
|
+
{
|
637
|
+
"describe": "<p>Set the second insert method parameter to TRUE.</p>",
|
638
|
+
"isRight": false
|
639
|
+
}
|
640
|
+
],
|
641
|
+
"hashCode": "1988674255"
|
642
|
+
},
|
643
|
+
{
|
644
|
+
"describe": "A developer wants to retrieve the Contacts and Users with the email address 'dev@uc.com'.\nWhich SOSL statement should the developer use?",
|
645
|
+
"answerOptions": [
|
646
|
+
{
|
647
|
+
"describe": "FIND {Email = 'dev@uc.com' }\nIN Contact, User",
|
648
|
+
"isRight": false
|
649
|
+
},
|
650
|
+
{
|
651
|
+
"describe": "FIND { dev@uc.com' } IN Email\nFields RETURNTING Contact\n(Email), User (Email)",
|
652
|
+
"isRight": true
|
653
|
+
},
|
654
|
+
{
|
655
|
+
"describe": "FIND {Email = 'dev@uc.com' } \nRETURNTING Contact (Email), \nUser (Email)",
|
656
|
+
"isRight": false
|
657
|
+
},
|
658
|
+
{
|
659
|
+
"describe": "FIND Email IN Contact, User \nFOR {dev@UC.vom}",
|
660
|
+
"isRight": false
|
661
|
+
}
|
662
|
+
],
|
663
|
+
"hashCode": "1988674254"
|
664
|
+
},
|
665
|
+
{
|
666
|
+
"describe": "<p>A developer considers the following snippet of code:</p><p><br/></p><p>Boolean isOK;</p><p>Integer x;</p><p>String theString = 'Hello';</p><p><br/></p><p>if(isOk == false && theString == 'Hello'){</p><p>x=1;</p><p>}else if(isOK == true && theString == 'Hello'){</p><p>x=2;</p><p>}else if(isOk == null && theString == 'Hello'){</p><p>x=3;</p><p>}else{</p><p>x=4;</p><p>}</p><p><br/></p><p>Based on this code, what is the value of x?</p><p><br/></p>",
|
667
|
+
"answerOptions": [
|
668
|
+
{
|
669
|
+
"describe": "<p>2</p>",
|
670
|
+
"isRight": false
|
671
|
+
},
|
672
|
+
{
|
673
|
+
"describe": "<p>1</p>",
|
674
|
+
"isRight": false
|
675
|
+
},
|
676
|
+
{
|
677
|
+
"describe": "<p>4</p>",
|
678
|
+
"isRight": false
|
679
|
+
},
|
680
|
+
{
|
681
|
+
"describe": "<p>3</p>",
|
682
|
+
"isRight": true
|
683
|
+
}
|
684
|
+
],
|
685
|
+
"hashCode": "1988674253"
|
686
|
+
},
|
687
|
+
{
|
688
|
+
"describe": "<p>Assuming that 'name' is a Stirng obtained by an <apex:inputText> tag on a Visualforce page, which two SOQL queries performed are safe from SOQL injection?Choose 2 answers</p>",
|
689
|
+
"answerOptions": [
|
690
|
+
{
|
691
|
+
"describe": "<p>String query = 'SELECT Id FROM Account WHERE Name LIKE \\''%' + name + '%\\'';</p><p>List<Account> results = Database.query(query);</p><p><br/></p>",
|
692
|
+
"isRight": false
|
693
|
+
},
|
694
|
+
{
|
695
|
+
"describe": "<p>String query = 'SELECT Id FROM Account WHERE Name LIKE \\''%' + name.noQuotes() + '%\\'';</p><p>List<Account> results = Database.query(query);</p><p><br/></p>",
|
696
|
+
"isRight": false
|
697
|
+
},
|
698
|
+
{
|
699
|
+
"describe": "<p>String query = '%' + name + '%';</p><p>List<Account> results =[SELECT Id FROM Account WHERE Name LIKE :query];</p><p><br/></p>",
|
700
|
+
"isRight": true
|
701
|
+
},
|
702
|
+
{
|
703
|
+
"describe": "<p>String query = 'SELECT Id FROM Account WHERE Name LIKE \\''%' + String.escapeSingleQuotes(name) + '%\\'';</p><p>List<Account> results = Database.query(query);</p><p><br/></p>",
|
704
|
+
"isRight": true
|
705
|
+
}
|
706
|
+
],
|
707
|
+
"hashCode": "1988674252"
|
708
|
+
},
|
709
|
+
{
|
710
|
+
"describe": "<p>A developer must create a ShippingCalculator class that cannot be instantiated and must include a working default implementation of a calculate method, that sub-classes can overrude.\nWhat is the correct implementation of the ShippingCalculator class?</p>",
|
711
|
+
"answerOptions": [
|
712
|
+
{
|
713
|
+
"describe": "<p>public abstract class ShippingCalculator{\n public abstract calculate(){ /*implementation*/}\n}</p>",
|
714
|
+
"isRight": false
|
715
|
+
},
|
716
|
+
{
|
717
|
+
"describe": "<p>public abstract class ShippingCalculator{\n public void calculate(){ /*implementation*/}\n}</p>",
|
718
|
+
"isRight": false
|
719
|
+
},
|
720
|
+
{
|
721
|
+
"describe": "<p>public abstract class ShippingCalculator{\n public virtual void calculate(){ /*implementation*/}\n}</p>",
|
722
|
+
"isRight": true
|
723
|
+
},
|
724
|
+
{
|
725
|
+
"describe": "<p>public abstract class ShippingCalculator{\n public override calculate(){ /*implementation*/}\n}</p>",
|
726
|
+
"isRight": false
|
727
|
+
}
|
728
|
+
],
|
729
|
+
"hashCode": "1988674251"
|
730
|
+
},
|
731
|
+
{
|
732
|
+
"describe": "<p>Given the following block of code:</p><p><br/></p><p>try{</p><p> List<Account> retrievedRecords = [SELECT Id FROM Account WHERE Website = null];</p><p>}catch(Exception e){</p><p> //manage excception logic</p><p>}</p><p><br/></p><p>What should a developer do to ensure the code execution is disrupted if the list retrievedRecords remains empty after the SOQL query?</p><p><br/></p>",
|
733
|
+
"answerOptions": [
|
734
|
+
{
|
735
|
+
"describe": "<p>Check the state of the retrievedRecords variable and access the first element of the list if the variable is empty.</p>",
|
736
|
+
"isRight": false
|
737
|
+
},
|
738
|
+
{
|
739
|
+
"describe": "<p>Check the state of the retrievedRecords variable and throw a custom exception if the variable is empty.</p>",
|
740
|
+
"isRight": true
|
741
|
+
},
|
742
|
+
{
|
743
|
+
"describe": "<p>Check the state of the retrievedRecords variable and use System.assert(false) if the variable is empty.</p>",
|
744
|
+
"isRight": false
|
745
|
+
},
|
746
|
+
{
|
747
|
+
"describe": "<p>Replace the retrievedRecords variable declaration from a List of Account to a single Account.</p>",
|
748
|
+
"isRight": false
|
749
|
+
}
|
750
|
+
],
|
751
|
+
"hashCode": "1988674250"
|
752
|
+
},
|
753
|
+
{
|
754
|
+
"describe": "<p>Given the following trigger implementation:</p><p><br/></p><p>trigger leadTrigger on Lead (before update){</p><p> final ID BUSINESS_RECORDTYPEID = '012500000009Qad';</p><p> for(Lead thisLead: Trigger.new){</p><p> if(thisLead.Company != null && thisLead.RecordTypeId != BUSINESS_RECORDTYPEID){</p><p> thisLead.RecordTypeId = BUSINESS_RECORDTYPEID;</p><p> }</p><p> }</p><p>}</p><p><br/></p><p>The developer receivers deployment errors every time a deployment is attempted from Sandbox to Production.</p><p>What should the developer do to ensure a successful deployment?</p><p><br/></p>",
|
755
|
+
"answerOptions": [
|
756
|
+
{
|
757
|
+
"describe": "<p>Ensure BUSINESS_RECORDTYPEID is pushed as part of the deployment components.</p>",
|
758
|
+
"isRight": false
|
759
|
+
},
|
760
|
+
{
|
761
|
+
"describe": "<p>Ensure a record type with an ID of BUSINESS_RECORDTYPEID exists on Production prior to deployment.</p>",
|
762
|
+
"isRight": false
|
763
|
+
},
|
764
|
+
{
|
765
|
+
"describe": "<p>Ensure the deployment is validated by a System user on Production.</p>",
|
766
|
+
"isRight": false
|
767
|
+
},
|
768
|
+
{
|
769
|
+
"describe": "Ensure BUSINESS_RECORDTYPEID is retrieved using Schema Describe calls.",
|
770
|
+
"isRight": true
|
771
|
+
}
|
772
|
+
],
|
773
|
+
"hashCode": "1988674227"
|
774
|
+
},
|
775
|
+
{
|
776
|
+
"describe": "<p>Given the following Anonymous Block:</p><p>List<Case> casesToUpdate = new List<Case>( );</p><p>for(Case thisCase : [Select Id, Status FROM Case LIMIT 50000]){</p><p> thiscase. Status = 'Working';</p><p> casesToUpdate. add(thisCase);</p><p>}</p><p>try{</p><p> Database. update(casesToUpdate, false);</p><p>}catch(Exception e){</p><p> System. debug(e. getMessage());</p><p>}</p><p><br/></p><p>What should a developer consider for an environment that has over 10,000 Case records?</p><p><br/></p>",
|
777
|
+
"answerOptions": [
|
778
|
+
{
|
779
|
+
"describe": "<p>The try/catch block will handle exceptions thrown by governor limits.</p>",
|
780
|
+
"isRight": false
|
781
|
+
},
|
782
|
+
{
|
783
|
+
"describe": "<p>The transaction will succeed and changes will be committed.</p>",
|
784
|
+
"isRight": false
|
785
|
+
},
|
786
|
+
{
|
787
|
+
"describe": "The try/catch block will handle any DML exceptions thrown.",
|
788
|
+
"isRight": false
|
789
|
+
},
|
790
|
+
{
|
791
|
+
"describe": "<p>The transcation will fail due to exceeding the governor limit.</p>",
|
792
|
+
"isRight": true
|
793
|
+
}
|
794
|
+
],
|
795
|
+
"hashCode": "1988674225"
|
796
|
+
},
|
797
|
+
{
|
798
|
+
"describe": "<p>Which statement generates a list of Leads and Contacts that have a field with the phrase 'ACME'?</p>",
|
799
|
+
"answerOptions": [
|
800
|
+
{
|
801
|
+
"describe": "<p>List<sObject> searchList = [FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead];</p>",
|
802
|
+
"isRight": false
|
803
|
+
},
|
804
|
+
{
|
805
|
+
"describe": "<p>List<List<sObject>> searchList = [FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead];</p>",
|
806
|
+
"isRight": true
|
807
|
+
},
|
808
|
+
{
|
809
|
+
"describe": "<p>List<List<sObject>> searchList = [SELECT Name, ID FROM Contact, Lead WHERE Name like '%ACME%'];</p>",
|
810
|
+
"isRight": false
|
811
|
+
},
|
812
|
+
{
|
813
|
+
"describe": "<p>Map<sObject> searchList = [FIND "*ACME*" IN ALL FIELDS RETURNING Contact, Lead];</p>",
|
814
|
+
"isRight": false
|
815
|
+
}
|
816
|
+
],
|
817
|
+
"hashCode": "1988674224"
|
818
|
+
},
|
819
|
+
{
|
820
|
+
"describe": "<p>What is the maximum number of SOQL queries used by the following code?</p><p>List<Account> aList = [SELECT Id from Account LIMIT 5];</p><p>for(Account a : aList){</p><p>List<Contact> cList = [SELECT Id FROM Contact WHERE AccountId = :a.Id];</p><p>}</p><p><br/></p>",
|
821
|
+
"answerOptions": [
|
822
|
+
{
|
823
|
+
"describe": "<p>1</p>",
|
824
|
+
"isRight": false
|
825
|
+
},
|
826
|
+
{
|
827
|
+
"describe": "<p>2</p>",
|
828
|
+
"isRight": false
|
829
|
+
},
|
830
|
+
{
|
831
|
+
"describe": "<p>6</p>",
|
832
|
+
"isRight": true
|
833
|
+
},
|
834
|
+
{
|
835
|
+
"describe": "<p>5</p>",
|
836
|
+
"isRight": false
|
837
|
+
}
|
838
|
+
],
|
839
|
+
"hashCode": "1988674223"
|
840
|
+
},
|
841
|
+
{
|
842
|
+
"describe": "A developer needs to prevent the creation of Request records when certain exist in the system. A RequestLogic class exists that checks the conditions.\nWhat is the correct implementation?",
|
843
|
+
"answerOptions": [
|
844
|
+
{
|
845
|
+
"describe": "trigger RequestTrigger on Request (before insert){\nRequestLogic.validateRecords(trigger.new);\n}",
|
846
|
+
"isRight": true
|
847
|
+
},
|
848
|
+
{
|
849
|
+
"describe": "trigger RequestTrigger on Request (after insert){\nRequestLogic.validateRecords(trigger.new);\n}",
|
850
|
+
"isRight": false
|
851
|
+
},
|
852
|
+
{
|
853
|
+
"describe": "trigger RequestTrigger on Request (after insert){\nif(RequestLogic.isValid(Request))\nrequest.addError('Your request cannot be created at this time.');\n}",
|
854
|
+
"isRight": false
|
855
|
+
},
|
856
|
+
{
|
857
|
+
"describe": "trigger RequestTrigger on Request (before insert){\nif(RequestLogic.isValid(Request))\nrequest.addError('Your request cannot be created at this time.');\n}",
|
858
|
+
"isRight": false
|
859
|
+
}
|
860
|
+
],
|
861
|
+
"hashCode": "1988674222"
|
862
|
+
},
|
863
|
+
{
|
864
|
+
"describe": "Given the following Apex statement:\nAccount myAccount = [SELECT Id, Name FROM Account];\nWhat occurs when more than one Account is returned by the SOQL query?",
|
865
|
+
"answerOptions": [
|
866
|
+
{
|
867
|
+
"describe": "The query fails and an error is written to the debug log.",
|
868
|
+
"isRight": false
|
869
|
+
},
|
870
|
+
{
|
871
|
+
"describe": "The first Account returned is assigned to myAccount.",
|
872
|
+
"isRight": false
|
873
|
+
},
|
874
|
+
{
|
875
|
+
"describe": "The variable, myAccount, is automatically cast to the List data type.",
|
876
|
+
"isRight": false
|
877
|
+
},
|
878
|
+
{
|
879
|
+
"describe": "An unhandled exception is thrown and the code terminates.",
|
880
|
+
"isRight": true
|
881
|
+
}
|
882
|
+
],
|
883
|
+
"hashCode": "1988674221"
|
884
|
+
},
|
885
|
+
{
|
886
|
+
"describe": "A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces.\nPublic interface Sortable{\nvoid sort();\n}\nPublic interface Drawable{\nvoid draw();\n}\nWhich is the correct implementation?",
|
887
|
+
"answerOptions": [
|
888
|
+
{
|
889
|
+
"describe": "public class DrawList implements Sortable, implements Drawable{\n\n public void sort() { /*implementation*/ }\n\n public void draw(){ /*implementation*/ }\n\n}",
|
890
|
+
"isRight": false
|
891
|
+
},
|
892
|
+
{
|
893
|
+
"describe": "public class DrawList extends Sortable, Drawable{\n public void sort() { /*implementation*/ }\n public void draw(){ /*implementation*/ }\n}",
|
894
|
+
"isRight": false
|
895
|
+
},
|
896
|
+
{
|
897
|
+
"describe": "public class DrawList extends Sortable, extends Drawable{\n public void sort() { /*implementation*/ }\n public void draw(){ /*implementation*/ }\n}",
|
898
|
+
"isRight": false
|
899
|
+
},
|
900
|
+
{
|
901
|
+
"describe": "public class DrawList implements Sortable, Drawable{\n public void sort() { /*implementation*/ }\n public void draw(){ /*implementation*/ }\n}",
|
902
|
+
"isRight": true
|
903
|
+
}
|
904
|
+
],
|
905
|
+
"hashCode": "1988674219"
|
906
|
+
},
|
907
|
+
{
|
908
|
+
"describe": "A developer must create a CreditCardPayment class that provides an implementation of an existing Payment class.\npublic virtual class Payment{\n public virtual void makePayment(Decimal amount) { /*implementation*/}\n}\nWhich is the correct implementation?",
|
909
|
+
"answerOptions": [
|
910
|
+
{
|
911
|
+
"describe": "public class CreditCardPayment extends Payment{\n public virtual void makePayment(Decimal amount){/*implementation*/}\n}",
|
912
|
+
"isRight": false
|
913
|
+
},
|
914
|
+
{
|
915
|
+
"describe": "public class CreditCardPayment extends Payment{\n public override void makePayment(Decimal amount){/*implementation*/}\n}",
|
916
|
+
"isRight": true
|
917
|
+
},
|
918
|
+
{
|
919
|
+
"describe": "public class CreditCardPayment implements Payment{\n public override void makePayment(Decimal amount){/*implementation*/}\n}",
|
920
|
+
"isRight": false
|
921
|
+
},
|
922
|
+
{
|
923
|
+
"describe": "public class CreditCardPayment implements Payment{\n public virtual void makePayment(Decimal amount){/*implementation*/}\n}",
|
924
|
+
"isRight": false
|
925
|
+
}
|
926
|
+
],
|
927
|
+
"hashCode": "1988674197"
|
928
|
+
},
|
929
|
+
{
|
930
|
+
"describe": "The following Apex method is part of the ContactService class that is called from a trigger:\npublic static void setBusinessUnitToEMEA(Contact thisContact){\n thisContact.Business_Unit__c = 'EMEA';\n update thisContact;\n}\nHow should the developer modify the code to ensure best practices are met?",
|
931
|
+
"answerOptions": [
|
932
|
+
{
|
933
|
+
"describe": "public static void setBusinessUnitToEMEA(Contact thisContact){\n List<Contact> contacts = new List<Contact>();\n contacts.add(thisContact.Business_Unit__c = 'EMEA');\n update contacts;\n}",
|
934
|
+
"isRight": false
|
935
|
+
},
|
936
|
+
{
|
937
|
+
"describe": "public static void setBusinessUnitToEMEA(List<Contact> contacts){\n for(Contact thisContact : contacts){\n thisContact.Business_Unit__c = 'EMEA';\n }\n update contacts;\n}",
|
938
|
+
"isRight": true
|
939
|
+
},
|
940
|
+
{
|
941
|
+
"describe": "public static void setBusinessUnitToEMEA(List<Contact> contacts){\n for(Contact thisContact : contacts){\n thisContact.Business_Unit__c = 'EMEA';\n update contacts[0];\n } \n}",
|
942
|
+
"isRight": false
|
943
|
+
},
|
944
|
+
{
|
945
|
+
"describe": "public static void setBusinessUnitToEMEA(List<Contact> contacts){\n contacts[0].Business_Unit__c = 'EMEA';\n update contacts[0];\n}",
|
946
|
+
"isRight": false
|
947
|
+
}
|
948
|
+
],
|
949
|
+
"hashCode": "1988674195"
|
950
|
+
},
|
951
|
+
{
|
952
|
+
"describe": "<p>A developer must modify the following code snippet to prevent the number of SOQL queries issued from exceeding the platform governor limit.</p><p>public without sharing class OpportunityService{</p><p><br/></p><p> public static List<OpportunityLineItem> getOpportunityProducts(Set<Id> opportunityIds){</p><p> List<OpportunityLineItem> oppLineItems = new List<OpportunityLineItem>();</p><p> for(Id thisOppId : opportunityIds){</p><p> oppLineItems. addAll([Select Id FROM OppLineItem WHERE OpportunityId = :thisOppId]);</p><p> }</p><p> return oppLineItems;</p><p> }</p><p> }</p><p><br/></p><p>The above method might be called during a trigger execution via a Lightning component.</p><p>Which technique should be implemented to avoid reaching the governor limit?</p><p><br/></p>",
|
953
|
+
"answerOptions": [
|
954
|
+
{
|
955
|
+
"describe": "<p>Refactor the code above to perform the SOQL query only if the Set of opportunityIds contains less 100 Ids.</p>",
|
956
|
+
"isRight": false
|
957
|
+
},
|
958
|
+
{
|
959
|
+
"describe": "<p>Refactor the code above to perform only one SOQL query, filtering by the Set of opportunityIds.</p>",
|
960
|
+
"isRight": true
|
961
|
+
},
|
962
|
+
{
|
963
|
+
"describe": "<p>Use the System. Limits. getQueries( ) method to ensure the number of queries is less than 100.</p>",
|
964
|
+
"isRight": false
|
965
|
+
},
|
966
|
+
{
|
967
|
+
"describe": "<p>Use the System. Limits. getLimitQueries( ) method to ensure the number of queries is less than 100.</p>",
|
968
|
+
"isRight": false
|
969
|
+
}
|
970
|
+
],
|
971
|
+
"hashCode": "1988674194"
|
972
|
+
},
|
973
|
+
{
|
974
|
+
"describe": "<p>A Visual Flow uses an Apex Action to provide additional information about multiple Contacts, stored in a custom class, ContactInfo. \nWhich is the correct definition of the Apex method that gets the additional information?</p>",
|
975
|
+
"answerOptions": [
|
976
|
+
{
|
977
|
+
"describe": "<p>@InvocableMethod(label='Additional Info')\npublic ContactInfo getInfo(Id contactId)\n( /*implementation*/ )</p>",
|
978
|
+
"isRight": false
|
979
|
+
},
|
980
|
+
{
|
981
|
+
"describe": "<p>@InvocableMethod(label='Additional Info')\npublic static ContactInfo getInfo(Id contactId)\n(/ *implementation*/)</p>",
|
982
|
+
"isRight": false
|
983
|
+
},
|
984
|
+
{
|
985
|
+
"describe": "<p>@InvocableMethod(label='Additional Info')</p><p>public List<ContactInfo> getInfo(List<Id> contactIds)</p><p>(/ *implementation*/)</p><p><br/></p>",
|
986
|
+
"isRight": false
|
987
|
+
},
|
988
|
+
{
|
989
|
+
"describe": "<p>@InvocableMethod(label='Additional Info')</p><p>public static List<ContactInfo> getInfo(List<Id> contactIds)</p><p>(/ *implementation*/)</p><p><br/></p>",
|
990
|
+
"isRight": true
|
991
|
+
}
|
992
|
+
],
|
993
|
+
"hashCode": "1988674192"
|
994
|
+
}
|
995
|
+
],
|
996
|
+
"hashCode": "-302233965"
|
997
|
+
}
|