Salesforce OA Experience | Rejected
Summary
I recently completed a HackerRank Online Assessment for Salesforce, which involved solving two algorithmic problems within a 75-minute timeframe. Unfortunately, I was rejected.
Full Experience
I took the Salesforce Online Assessment on HackerRank, which presented two coding challenges. I had 75 minutes to complete both problems. After submitting my solutions, I later received a rejection.
Interview Questions (2)
Longest Common Subsequence and Substring
Given two strings x and y, return both:
- The length of their Longest Common Subsequence (LCS).
- The length of their Longest Common Substring.
Example:
Input: x = "abcde", y = "abfce"
Output:
LCS length = 3 // "abe" or "ace"
Longest Common Substring length = 2 // "ab"
String Compression (Character Count)
Given a string s, compress it such that consecutive duplicate characters are replaced by the character followed by the count of its repetitions.
If a character appears only once consecutively, just keep the character as it is.
Return the compressed string.
Input: s = "abbcccd"
Output: "ab2c3d"
Explanation:
'a' → single → "a"
'b' → repeated twice → "b2"
'c' → repeated thrice → "c3"
'd' → single → "d"