SMTS | Salesforce | OA | March 2025
Summary
I recently completed an Online Assessment for the SMTS role at Salesforce, which consisted of two coding questions. I solved both quickly, and although a recruiter reached out for an interview, it was never scheduled.
Full Experience
Recently took a Salesforce online assessment. Format: 2 coding questions, 90 mins time Questions below-
A sorted list is where all numbers are sorted in ascending order.
An almost sorted list is where when you remove one number and it becomes sorted.
Eg: 1 3 5 4 7. You can remove 4 to make it a sorted list.
Given a list of numbers, what is the **minimum** numbers you need to remove so that the final list is **almost sorted**.
Contraints expect an O(n log n) solution.
(**Hint**: Think LIS)
Solved both in ~15mins. Recruiter reached out for interview, but never scheduled. :)
Interview Questions (2)
Given an array of characters chars, compress it using the following algorithm:
Begin with an empty string s.
For each group of consecutive repeating characters in chars:
If the group's length is 1, append the character to s.
If the group's length is greater than 1, append the character, then append the group's length as a string.
The compressed array should not be returned, but instead, the input array should be modified in-place.
After compressing the input array, return the new length of the array.
A sorted list is where all numbers are sorted in ascending order. An almost sorted list is where when you remove one number and it becomes sorted. Eg: 1 3 5 4 7. You can remove 4 to make it a sorted list. Given a list of numbers, what is the minimum numbers you need to remove so that the final list is almost sorted. Contraints expect an O(n log n) solution. (Hint: Think LIS)