SMTS | Salesforce | OA | March 2025

salesforce logo
salesforce
MTS II
May 4, 20255 reads

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-

  1. https://leetcode.com/problems/string-compression

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)

Q1
String Compression
Data Structures & AlgorithmsMedium

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.

Q2
Minimum Removals for Almost Sorted List
Data Structures & AlgorithmsMedium

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)

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!