Java Category

Apex Coding Interview Challenge #10

Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed). For example, given the string “([])[]({})”, you should return true. Given the string “([)]” or “((()”, you should return false. There is are Stack implementation currently available in Apex so we can use a List to […]

Rate this:

Read More

Apex Coding Interview Challenge #9

Given a list of integers, write a function that returns the largest sum of non-adjacent numbers. Numbers can be 0 or negative. For example, [2, 4, 6, 2, 5] should return 13, since we pick 2, 6, and 5. [5, 1, 1, 5] should return 10, since we pick 5 and 5. Follow-up: Can you […]

Rate this:

Read More

Apex Coding Interview Challenge #8

Implement an autocomplete system. That is, given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix. For example, given the query string de and the set of strings [dog, deer, deal], return [deer, deal]. Hint: Try preprocessing the dictionary into […]

Rate this:

Read More

Apex Coding Interview Challenge #7

Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well. For example, the input [3, 4, -1, 1] should give 2. The input [1, 2, 0] should give 3. […]

Rate this:

Read More

Apex Coding Interview Challenge #6

Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i. For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input […]

Rate this:

Read More

Salesforce Platform Events, Change Data Capture, Real-Time Event Monitoring explained

Below details the different Salesforce events types for different use cases 1. Change Data Capture Select the entities that generate change event notifications. Change Data Capture sends notifications for created, updated, deleted, and undeleted records. All custom objects and a subset of standard objects are supported. /data/AccountChangeEvent – any changes to accounts Create account Update […]

Rate this:

Read More

Apex Rest API Architecture – Best Practices

What’s a Service/API A service/API is a function that is well-defined, self-contained, and does not depend on the context or state of other services. 1. Abstract vs Concrete When developing software we often use abstraction and polymorphism to get most of our applications. We want to reuse as much of the code as possible. Should […]

Rate this:

Read More

Apex extend standard objects to add business logic

Currently it is not possible to extend a standard or custom object in Salesforce. Why would you want to do that you may ask, think about the following, how would you check the age of a contact, if they have a mobilephone, sort list of objects, serialize, deserialize, . Define an Obj class that will […]

Rate this:

Read More

Apex Max Cases Per Account Trigger

Fun coding challenge from: Show me the code: Extravagant Record Creation Max cases Trigger Max cases helper class Max cases helper test

Rate this:

Read More

Cracking the Coding Interview: Unscripted Interview Video Solutions

Anagram word search problem Get derivative for Term Non Consecutive sequence with the largest sum Ransome note

Rate this:

Read More