Salesforce | MTS | OA | problem 2025

salesforce logo
salesforce
MTS I2 yearsNo Offer
May 10, 202533 reads

Summary

I recently participated in an Online Assessment for a MTS role at Salesforce, which involved solving two coding problems. I've detailed one of these problems, including multiple approaches and their time complexities.

Full Experience

I applied for a MTS position at Salesforce and received a referral, which led me to the interview process. The first stage was a technical online assessment, where I had to solve two coding problems. I'm providing a detailed account of the second problem I encountered, along with different code implementations and a discussion of their complexities. Following the OA, there was a second round, which was a standard interview. That concludes my experience with the process.

Interview Questions (1)

Q1
Count Stable Segments
Data Structures & AlgorithmsMedium

Given an integer array named capacity, I was asked to find the number of 'stable segments'. A segment [i, j] is defined as stable if the following conditions are met:

  • The segment must have at least three elements, meaning j >= i + 2.
  • The value at the start of the segment, capacity[i], must be equal to the value at the end of the segment, capacity[j].
  • Both capacity[i] and capacity[j] must be equal to the sum of all elements strictly between indices i and j (i.e., sum(capacity[k]) for all k where i < k < j).
I was asked to provide the most optimized code for this problem and was expected to pass 75-80% of the test cases, with a few test cases hidden.

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!