SMTS | Salesforce | OA | March 2025
- Posted
- 4 May 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.
How it went
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. :)
Questions asked (2)
- 01
String Compression
Data Structures & Algorithms · Medium
Open the problemGiven an array of characters
chars, compress it using the following algorithm: Begin with an empty strings. For each group of consecutive repeating characters inchars: If the group's length is 1, append the character tos. 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. - 02
Minimum Removals for Almost Sorted List
Data Structures & Algorithms · Medium
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)