salesforce logo
Salesforce· MTS II

SMTS | Salesforce | OA | March 2025

Posted
4 May 2025
338 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.

How it went

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. :)

Questions asked (2)

  1. 01

    String Compression

    Data Structures & Algorithms · Medium

    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.

    Open the problem
  2. 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)

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Salesforce recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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