Salesforce | MTS | OA | problem 2025
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)
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]andcapacity[j]must be equal to the sum of all elements strictly between indicesiandj(i.e.,sum(capacity[k])for allkwherei < k < j).