exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 308 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 308
Topic #: 1
[All Certified Platform Developer II Questions]

The Salesforce admin at Cloud Kicks created a custom object called Region_c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to.



Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.

Which code segment is the most efficient way to fulfill this request?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Ullr
Highly Voted 2 years, 2 months ago
C is the answer in A we have SOQL inside the outer FOR which is bad
upvoted 7 times
moitam
1 year, 8 months ago
On C, the zips variable is undefined... so I would say correct is B
upvoted 1 times
M4JK3LSON
1 year, 5 months ago
What are talking about? There is initialization of zips so please study this code one more time
upvoted 1 times
...
...
...
doni10
Most Recent 7 months ago
My bad there are two nested for loop in B the C is better
upvoted 1 times
...
doni10
7 months ago
I think that in reality the Map bring no more information that the soql because we have only 1 zipcode per region that is not the case usualy the map would have been Map<String,List<String>> to reflect the fact that there are multiple zipcode per region i vote B
upvoted 1 times
...
Yas010101
1 year, 5 months ago
Selected Answer: C
in A we have SOQL inside the outer FOR which is bad
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...