Posted on April 30, 2020 Leave a Comment

Here is a fun Apex challenge to test your Apex skills: SFDC99 Final Project Challenge! Optimizations: 1. Add static variables to custom variables/custom metadata 2. Cache mapOfZipOwner for faster retrieval + less SOQL queries Assumption: updating an account owner can only be when: 1. Zip code was empty (null) and now has a value 2. […]

Posted on June 4, 2019 Leave a Comment

Problem: Find the number that has the highest frequency in a list of integers. Input: 1,6,2,1,6,1 Output: 1 //because 1 occurs 3 times in the list Option 1: Use Hashmap to iterate list Option 2: Use wrapper class with compare to sort wrapper Option 3: Using buckets to group index of frequencies together

Posted on May 20, 2019 Leave a Comment

Here is the problem statement: Given an expectedSum value find the sum (n+ (n+1) = expectedValue) from a list that equals the expectedSum. I am using the following list 1,3,4,4,5,9 and looking for the sum to be 8 (3+5, 4+4) *Note the list is sorted Solution 1: The above time complexity for a nested for […]