Salesforce MTS interview experience 3 years
MTS ISalesforce LMTS | India | Interview experience | September 2025 | Offer
Lead Software Engineer/LMTS - Backend - Distributed SystemsSalesforce SMTS
MTS IISalesforce | SMTS | Interview Experience
MTS IISalesforce | SMTS | OA
SMTS Backend9 more experiences below
Summary
I interviewed for a Member of Technical Staff (MTS) role at Salesforce with 3 years of experience. My process included an Online Assessment, two Data Structures & Algorithms rounds, and a final technical interview, ultimately resulting in a rejection.
Full Experience
My interview journey for the MTS role at Salesforce, with my 3 years of experience from a product-based startup and an ECE background from a Tier-3 college, began with an Online Assessment.
Round 1 – Online Assessment (HackerRank)
The assessment consisted of 6 MCQs and 2 coding problems. The first problem asked me to find the maximum possible even sum from a subset of an array, including negative values. The second problem was about determining the minimum moves required to make two arrays identical by incrementing or decrementing single digits of elements. I managed to clear all test cases for both problems, and after 1.5 weeks, I received an interview call.Round 2 – DSA Round
This round started with a brief 10-minute introduction. The interviewer then shared a HackerRank link with two problems. The first was an overlapping-intervals problem, which I solved in about 20 minutes. Unexpectedly, given my ECE background, the interviewer then posed a surprise question: perform arithmetic operations without using standard arithmetic operators. I discussed bitwise-based approaches and, though I couldn't provide a full solution, I conveyed partial ideas, which took about 30 minutes. After that, we moved to the second actual DSA problem, a fairly hard graph traversal question. The interviewer only asked for my approach, and I explained how I would use BFS/Dijkstra, along with my reasoning, which seemed to satisfy them. Within 10 minutes, I received a call to rejoin for the next round.Round 3 – Final Technical Round
The final technical round presented a problem: given multiple transactions like 'A B 100' (A paid 100 for B), compute the minimum transactions needed to settle all accounts. I tried to clarify the requirements, but the interviewer was unresponsive to my follow-up questions. I explained my thought process and proceeded to implement my approach. Towards the end, the interviewer noted my logical reasoning was acceptable but seemed unsatisfied with the overall solution. When I inquired about the coding feedback, they simply stated HR would share it. Later that evening, I received a rejection email.Interview Questions (4)
Given an array values[], find the maximum possible even sum that can be obtained by selecting any subset of its elements. Values may be negative, and selecting no elements is allowed. It's guaranteed that at least one even value exists in the array.
Given two arrays, determine the minimum number of moves required to make them identical. A move is defined as incrementing or decrementing a single digit of any element in either array. Reordering of elements is not allowed.
Perform arithmetic operations (e.g., addition, subtraction, multiplication, division) without using the standard arithmetic operators (+, -, *, /).
You are given multiple transactions in the form A B 100, meaning person A paid 100 on behalf of person B. You need to compute the minimum number of transactions required to settle all accounts so everyone’s net balance becomes zero.
Summary
I successfully navigated a comprehensive interview process for the LMTS (Lead Member of Technical Staff) role at Salesforce India and received an offer. The interview journey included a HackerRank screening, followed by several virtual and in-person rounds focusing on Data Structures & Algorithms, Low-Level Design, High-Level Design, and a Hiring Manager discussion.
Full Experience
I was approached by a recruiter for the Lead Software Engineer/LMTS - Backend - Distributed Systems role at Salesforce India, given my ~10.3 years of experience. The entire interview process led to an offer.
Screening Round: Hackerrank
This round consisted of two LeetCode medium-level questions, to be completed in 75 minutes under proctored conditions with my microphone and video on. For the first question, I identified the need for a binary heap (priority queue) and solved it. The second question was trickier, which I tackled using a combination of sorting and math rather than basic DP. I successfully passed all test cases for both problems, and HR contacted me the very next day to advance to the next rounds.
Round 1: DSA
This was a virtual interview conducted via Google Meet. We started with a brief introduction about my work and a discussion on a challenging situation I recently handled, which lasted about 10 minutes. The interviewer then moved to the coding questions.
- First, I was asked to implement a max stack. I took my time to think and explained my approach thoroughly using Excalidraw, which significantly helped in communicating my thought process. Initially, my solution had a higher time complexity, but the interviewer probed me to reduce it to O(1). Once I figured out the optimal O(1) approach, I wrote the full Java implementation, including various test cases.
- With about 15 minutes remaining, the interviewer asked me to implement a frequency stack. Again, I used Excalidraw to explain my approach. Due to time constraints, I couldn't write the code, but I sensed the interviewer was convinced by my explanation.
The interviewer concluded by wishing me luck for the next round.
Round 2: LLD
This was another virtual round via Google Meet. We began with a brief discussion (5-6 minutes) about my work, roles, and responsibilities. Following this, we had a 15-17 minute discussion on various database concepts, including sharding, partitioning, and when to choose each. I explained my reservations about sharding due to its inherent complexities and the need for careful implementation. The interviewer also checked for my practical knowledge regarding scalability. Then came the core LLD question:
"Implement a connection pool."
Initially, my mind went blank, but I quickly regained composure and started clarifying the requirements. The key specifications were:
- A pool of 1000-2000 connections.
- Developers should be able to request a connection.
- Provide a free connection if available.
- Developers can return or close a connection.
- If a connection is closed, a new one should be created to maintain the pool count.
- Connections have three states: FREE, BLOCKED, CLOSED.
- If connections are exhausted, implement a mechanism with a default timeout to reject requests if no connection becomes free within that time.
I implemented this through continuous discussions with the interviewer, thinking out loud, and explaining my thought process before writing any code. The interviewer was particularly interested in how I handled concurrency with limited connections, for which I used a BlockingQueue and ensured methods were synchronous where applicable. For the default timeout, I chose an O(n) approach, mentioning that for larger scales (e.g., 10^6 connections), I would use two different blocking queues for O(1) access, noting it as a TODO. The interviewer appreciated this transparent design choice. I ensured all requirements were met, and we ran out of time. I also used the last 5 minutes to ask my questions.
I received the call for Round 3 two weeks after Round 2.
Round 3: HLD
This was an in-person, whiteboard interview at the office. The interviewer asked me to design a marketing campaign system. As is typical for HLD, I clarified the requirements and started drawing on the whiteboard while explaining my thought process. The interviewer wasn't looking for a complete end-to-end solution but rather deep dives into specific proposals. Every time I drew or proposed something, they would dig deep into the justifications and reasoning. The discussion was very interactive, and the interviewer course-corrected me twice. Most deep dives revolved around distributed transactions, scalability, various distributed architectures, failure handling, self-healing systems, and briefly, the Saga pattern.
Round 4: HM
This was also an in-person, whiteboard interview at the office. The Hiring Manager extensively questioned me about my current project and grilled me on its architecture for about 45 minutes. Following this, we moved to behavioral questions, focusing on my roles, responsibilities, leadership, and mentoring traits. As we walked out, the HM inquired about my notice period. The very next day, HR hinted at positive feedback, and I received the confirmation call the day after.
Interview Questions (4)
The core LLD question was to implement a connection pool with specific requirements: manage 1000-2000 connections, handle requests for connections, return/close connections, maintain connection count, manage three states (FREE, BLOCKED, CLOSED), and implement a default timeout for connection requests if the pool is exhausted.
The HLD round required me to design a marketing campaign system. The interviewer was particularly interested in deep dives into specific architectural components rather than a superficial overview. The discussion heavily focused on justifying proposals and exploring technical nuances.
Summary
I recently interviewed for the SMTS role at Salesforce, which involved multiple rounds including coding and a Low-Level Design discussion. I encountered both common LeetCode problems and a detailed system design scenario.
Full Experience
My interview process for the SMTS position at Salesforce consisted of a few rounds. The initial Online Assessment questions aren't clear in my memory, but they were typical of what one might expect. Round 1 focused on data structures and algorithms, where I was asked to solve the 'Longest Non-Repeating Substring' problem and to implement a 'Min Stack'. Round 2 was a Low-Level Design challenge, requiring me to design an 'Elevator Service' system with advanced features, specifically the option to change the direction of escalators within a building with N floors.
Interview Questions (3)
Implement an algorithm to find the length of the longest substring without repeating characters.
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Design an Elevator Service Low-Level Design (LLD) for a building with N floors. The system should include options to change the direction of escalators.
Summary
I recently interviewed at Salesforce for an SMTS Backend role, successfully navigating a HackerRank coding assessment and a virtual DSA round. While I solved most of the problems, I ran out of time implementing the optimal solution for a challenging design question.
Full Experience
I was approached by a recruiter for the SMTS Backend role at Salesforce, which led to an interview process comprising two main rounds.
Round 1: Platform - HackerRank
This round consisted of two coding questions, to be completed within 75 minutes. The first question was a variant of Remove Duplicates from Unsorted Linked List, requiring me to ensure only a single occurrence of numbers. The second was a variant of Kth Largest Element in an Array. I managed to solve both problems efficiently within 40 minutes.
Round 2: Virtual DSA Coding Round
This round also presented two questions, with a 60-minute time limit. The first question was a variant of Reconstruct Itinerary, simplified by the constraint that the input would not contain any loops or multiple paths. I solved this problem using a hashmap and a set in approximately 30 minutes, and the interviewer seemed satisfied with my approach.
The second question was to design a Queue with an O(1) getMax() operation. I initially considered using a queue combined with a monotonic increasing stack, but while coding, I realized a monotonic deque, similar to the technique used in the Sliding Window Maximum problem, would be a more suitable approach. Unfortunately, I was unable to complete the deque solution within the remaining 30 minutes.
Interview Questions (4)
Design a queue data structure that supports a getMax() operation, which returns the maximum element currently in the queue in O(1) time complexity. The standard queue operations (enqueue, dequeue) should also be efficient.
Summary
I recently completed the Online Assessment for a Staff Member of Technical Staff (SMTS) Backend role at Salesforce, which involved two coding questions on Hackerrank.
Full Experience
I recently applied for a Staff Member of Technical Staff (SMTS) Backend role at Salesforce through their careers portal. After applying, I was invited to complete an Online Assessment on Hackerrank. The assessment consisted of two coding questions, and I had 75 minutes to complete them.
Interview Questions (2)
Given a positive integer n, find the minimum number of operations required to convert n to 0. In each operation, you can choose any integer i (where i ≥ 0) and either add or subtract 2^i from n. The answer should return the minimum number of operations required to reduce n to 0.
Given an integer array timestamp and an integer windowSize, find the maximum number of requests that occur within any continuous time window of a specified range. The function should return an integer denoting the maximum requests observed in any window of windowSize minutes.
Summary
I cleared the Online Assessment for Salesforce with a strong performance on two data structures problems. The interview focused on algorithmic problem-solving and efficient coding practices.
Full Experience
YOE: 6YOE
Online Assessment: 2 DS Question Solved Both.
Problem Statement 1
A classification system evaluates whether given texts are spam based on a list of spam words.
A text is labeled “spam” if it contains at least two spam words (each occurrence of a spam word in the text counts toward the total).
Spam word matching is case-sensitive.
Example:
texts = {
"This is a limited offer just for you",
"Win cash now! Click here to claim your prize",
"Hello friend, just checking in",
"Congratulations! You have won a free gift"
};
spamWords = {
"offer", "cash", "Click", "prize", "Congratulations", "free"
};
Output:
["not_spam", "spam", "not_spam", "spam"]
Function Signature:
vector<string> classifyTexts(vector<string> texts, vector<string> spamWords);
Input:
texts: a list of strings (the texts to evaluate).
spamWords: a list of strings (the spam words).
Output:
A list of strings, each either "spam" or "not_spam" for each text.
Constraints:
1 ≤ n ≤ 10^3 (number of texts)
1 ≤ k ≤ 10^5 (number of spam words)
1 ≤ len(text) ≤ 10^5
1 ≤ len(spamWord) ≤ 10^5
Combined length of all spam words does not exceed 10^7
Solution
List < String > result = new ArrayList < >();
// Convert spam words to lowercase for case-insensitive comparison
Set < String > lowerSpamWords = new HashSet < >();
for (String word: spamwords) {
lowerSpamWords.add(word.toLowerCase());
}
// Process each text
for (String text: texts) {
// Split text into words and convert to lowercase
String[] words = text.toLowerCase().split("\W+");
int spamCount = 0;
// Count spam word occurrences (each occurrence counts)
for (String word: words) {
if (!word.isEmpty() && lowerSpamWords.contains(word)) {
spamCount++;
}
}
// Classify: spam if >= 2 spam words found, otherwise not_spam
if (spamCount >= 2) {
result.add("spam");
} else {
result.add("not_spam");
}
}
return result;
}
Problem Statement 2 : Longest Subsequence
Determine the maximum length of a subsequence from one string that is also a substring of another string. A subsequence of a string is created by removing zero or more characters from it, while a substring consists of consecutive characters from the string.
Given two strings x and y, determine the length of the longest subsequence of x that is also a substring of y.
Example:
x = "abcd"
y = "bbdc"
The subsequences of "abcd" are: "a", "b", "c", "d", "ab", "ac", "ad", "bc", "bd", "cd", "abc", "abd", "acd", "bcd", and "abcd".
The substrings of "bbdc" are: "b", "b", "d", "c", "bb", "bd", "dc", "bbd", "bdc", and "bbdc".
The longest subsequence of x that is also a substring of y is "bd" with length 3.
Function Description:
Complete the function longestSubsequence in the editor with the following parameter(s):
string x: a string to find the subsequence of
string y: a string to find the substring of
Returns:
int: the length of the longest subsequence of x that is a substring of y
Constraints:
1 ≤ lengths of x and y ≤ 2000
Strings x and y consist of lowercase English letters (ascii[a-z])
Solution
public static int longestSubsequence(String x, String y) {
int maxLength = 0;
// For each starting position in y (try all possible substrings)
for (int start = 0; start < y.length(); start++) {
int xIndex = 0;
int yIndex = start;
int currentLength = 0;
// Greedily match consecutive characters from y[start...]
// as a subsequence in x
while (xIndex < x.length() && yIndex < y.length()) {
if (x.charAt(xIndex) == y.charAt(yIndex)) {
currentLength++;
yIndex++;
}
xIndex++;
}
maxLength = Math.max(maxLength, currentLength);
}
return maxLength;
}
Interview Questions (1)
A classification system evaluates whether given texts are spam based on a list of spam words. A text is labeled 'spam' if it contains at least two spam words (each occurrence counts). Spam word matching is case-sensitive. The function must return a list of 'spam' or 'not_spam' for each text.
Summary
Applied for Salesforce interview on 1st November 2025. Faced a challenging DSA round with a problem involving array operations and maximum subarray sum. Could not solve it and was rejected.
Full Experience
Experince: 7 years
Current: Prduct Based Compnay (36 + 5.5 + 4.5 (LTI)) - ~46 LPA
Offer in Hand: Walmart: 45 + 8.7 + 3.5(stocks) = ~57 LPA
Kotak Mahindra: 49 + 7.5 + 4.5(LTI) = ~ 60 LPA
I was part of salesforce hiring drive today i.e. 1st November 2025
Round -1 DSA:
find the maximum subarray sum of array1 after applying m operations from arr2: condition for operation:
1. you can choose one element from arr2 either from front or either from back and put it in array 1 either at back or front.
2. you have to delete element that you pick from array 2.
3. after adding element to array1, now you need to find the maximum subarray sum of array 1.
you can perform above opertions m times where m is the size of array 2
e.g. array1 ={1,3,-5,2,2} array2 = {2,3}
o/p = 2,2,2,3 = 9 when you put but the elements of array 2 at the end of array 1.
Not able to solve it.
Solution is highly appreciated but not the chatGpt/Claude/deepseek
Result: Rejected
Anyone have idea what's the difficulty : medium or hard.
Interview Questions (1)
Find the maximum subarray sum of array1 after applying m operations from arr2. Each operation allows choosing an element from arr2 (either front or back) and placing it in array1 (either at the front or back). After each operation, the chosen element is deleted from arr2. The operations can be performed m times, where m is the size of array2.
Summary
Submitted a straightforward OA with two easy problems related to sets and a 0-1 knapsack-like question. Both were solved within 30 minutes, but no response has been received in over a week.
Full Experience
Interview(75 min)
Easy problem related to Set
Easy medium problem similiar to 0-1 Knapsack
I was able to solve both within 30 minutes, but I haven’t heard back for over a week. Has anyone else experienced something similar?
Interview Questions (2)
A problem involving set operations, likely requiring efficient handling of elements and their relationships.
A problem similar to the 0-1 Knapsack, where the goal is to select items with maximum value without exceeding capacity constraints.
Summary
I recently interviewed for the SMTS role at Salesforce, where I encountered two algorithmic challenges. Despite formulating approaches for both problems, I was unable to complete them within the allotted time, ultimately not receiving an offer.
Full Experience
I had my first round interview at Salesforce for the SMTS position. After a brief one-minute introduction, the interviewer immediately presented me with two coding questions via a Hackerrank link. The first question was identical to Remove All Adjacent Duplicates in String II. I initially brainstormed a brute-force approach but, after about 10-15 minutes, I pivoted to a more efficient stack-based solution. However, since nearly 30 minutes had passed, the interviewer decided to move on. The second question was conceptually the same as Binary Tree Maximum Path Sum, but it came with a significant twist: the input was provided as List<Integer> parent and List<Integer> values. This meant I had to either construct the entire tree from these lists myself or develop an approach that could work directly with this input format. I managed to devise the core approach for the problem but found the task of building the tree from scratch within the tight time constraints to be quite challenging. In the end, I wasn't able to fully solve either problem, though I was able to articulate my thought processes and proposed solutions for both.
Interview Questions (2)
The problem given was exactly the same as Remove All Adjacent Duplicates in String II. The task involves repeatedly removing sequences of k adjacent and identical characters from a string until no such sequences remain, and then returning the final string.
This question was fundamentally the same as Binary Tree Maximum Path Sum, which asks to find the maximum path sum in a binary tree. However, the inputs were given as List<Integer> parent and List<Integer> values, rather than a pre-built tree. This required me to first construct the binary tree from these lists or adapt my solution to work directly with this list-based representation before computing the maximum path sum.
Summary
I interviewed for a Member of Technical Staff (MTS) role at Salesforce, which involved an online assessment, two virtual technical rounds focusing on Data Structures & Algorithms and Low-Level Design, and an onsite round in Hyderabad covering project discussions, system design, and coding. I am currently awaiting the offer negotiation.
Full Experience
The recruitment process started after a recruiter reached out to me on LinkedIn for a different position, but after sending my resume, I was offered an online assessment for this MTS role. My journey began with Round 1, an OA consisting of 3-4 LeetCode medium-hard questions, though I don't recall the exact problems. Following the OA, I had Rounds 2 & 3 on the same day in late September.
Round 2 started with a straightforward string question. After solving and testing it, the interviewer, seeing we had time, moved on to a more challenging dynamic programming problem. I managed to solve both questions, albeit with a little extra time needed.
Round 3 was a combination of Data Structures & Algorithms and Low-Level Design. The interviewer initially posed a simple array question, keen to see how I'd approach edge cases and scalability for increased input limits. We then transitioned into designing a Meeting Scheduler, where I discussed the core objects, classes, design patterns, and strategies for handling conflicting meetings. My design approach seemed to satisfy the interviewer.
After clearing these virtual rounds, the recruiter scheduled my onsite interview in Hyderabad.
Round 4 involved two interviewers, an SMTS and a Director. They were incredibly accommodating, allowing me time to settle in before starting. We began by discussing my previous projects. Given my background in search algorithms, they then asked me about high-level requirements for a Facebook search-type application. Following this, I was asked to design a parking lot on a whiteboard and write valid code for it. The interview concluded with me asking a few questions.
Currently, I'm in the waiting phase. The recruiter reached out the following week for offer negotiations and has been assuring me consistently that an offer is in process, though it has been ongoing for 20 days already. I'm hopeful to receive it soon and that my experience proves helpful to others.
Interview Questions (5)
Given a list of strings containing a name and a roman numeral, sort the list first by name, then by the decimal value of the roman numeral. Roman numerals follow these rules: A value is not repeated more than three times. When a smaller value precedes a larger value, it indicates subtraction. For any other two-digit numbers less than 50, concatenate the roman numerals that represent its multiples of tens with the roman numerals for its values less than 10. For example, if 43 is 40 plus 3, then XL plus 3.
The company plans to launch marketing campaigns every several weeks. Each campaign has a certain cost, and at least one campaign must be launched every week. The weekly input is defined as the maximum cost of any campaign planned for that week. Given an area of campaign costs and number of weeks, determine the minimum possible sum of weekly inputs when campaigns are optimally planned. The campaign must remain in the original order. Each campaign must be launched in exactly one week and cannot be skipped.
Part of a development team will generate M microservices. The data system reports whether each service passed Y or failed N in its health checks. Find the longest streak of consecutive days during which all services passed their checks.
Design a Meeting Scheduler, including basic objects, classes, design patterns, and how to handle conflicting meetings.
Design a parking lot on a whiteboard and write valid code for its core functionality.
Preparation Tips
My preparation for this interview primarily involved solving LeetCode problems to strengthen my Data Structures & Algorithms skills, which was crucial for the online assessment and the DSA-focused technical rounds. For the system design and low-level design aspects, I focused on understanding fundamental design principles, object-oriented concepts, and common design patterns, which helped me in tackling problems like designing a Meeting Scheduler and a Parking Lot.
Summary
I had my first round for the MTS role at Salesforce, which started with an introduction and discussion about my projects. I was asked a DSA question, 'Word Break', and was able to provide a recursive solution with some hints from the interviewer.
Full Experience
My interview for the MTS role at Salesforce began with a standard introduction where I discussed my background and the projects I've worked on. Following that, I was presented with a DSA question. The problem was 'Word Break', and although I could come up with a recursive solution, it did require some hints from the interviewer to get there.
Interview Questions (1)
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words. The same word in the dictionary may be reused multiple times in the segmentation. For a detailed problem description, please refer to the provided link.
Summary
I interviewed for a MTS role at Salesforce in Bengaluru. After clearing an OA, I had one technical round with two coding questions, but I was ultimately rejected because I ran out of time.
Full Experience
The recruiter reached out to me for a MTS position at Salesforce in Bengaluru. I first completed an Online Assessment. A couple of weeks later, I received an invite for the interview round.
My first and only round consisted of two coding questions that needed to be solved within an hour. I unfortunately ran out of time and was unable to complete both, leading to a rejection.
Interview Questions (2)
Variation of Subarrays with K Different Integers. The specific question was to find the left and right index for the minimum length subarray with exactly k unique elements.
The classic Koko Eating Bananas problem.
Summary
I recently completed a HackerRank Online Assessment for Salesforce, which involved solving two algorithmic problems within a 75-minute timeframe. Unfortunately, I was rejected.
Full Experience
I took the Salesforce Online Assessment on HackerRank, which presented two coding challenges. I had 75 minutes to complete both problems. After submitting my solutions, I later received a rejection.
Interview Questions (2)
Given a string s, compress it such that consecutive duplicate characters are replaced by the character followed by the count of its repetitions.
If a character appears only once consecutively, just keep the character as it is.
Return the compressed string.
Input: s = "abbcccd"
Output: "ab2c3d"
Explanation:
'a' → single → "a"
'b' → repeated twice → "b2"
'c' → repeated thrice → "c3"
'd' → single → "d"
Summary
I recently completed the SalesForce Online Assessment which consisted of two coding challenges: a custom text classification problem and a standard LeetCode problem. I am currently awaiting results for this round.
Full Experience
I just completed the SalesForce Online Assessment. It was hosted on HackerRank and presented two distinct coding problems. The first problem involved designing a text classification system to identify spam based on a given list of spam words and a specific count threshold, requiring careful consideration of case-sensitivity and word counting. The second challenge was a direct LeetCode problem, 'Delete and Earn'. I'm currently awaiting results for this round and will share updates on subsequent stages.
Interview Questions (2)
A classification system evaluates whether given texts are spam based on a list of spam words.
A text is labeled “spam” if it contains at least two spam words (each occurrence of a spam word in the text counts toward the total).
Spam word matching is case-sensitive.
Example:
texts = { "This is a limited offer just for you", "Win cash now! Click here to claim your prize", "Hello friend, just checking in", "Congratulations! You have won a free gift" };spamWords = { "offer", "cash", "Click", "prize", "Congratulations", "free" };
Output: ["not_spam", "spam", "not_spam", "spam"]
Function Signature:
vector<string> classifyTexts(vector<string> texts, vector<string> spamWords);Input:
texts: a list of strings (the texts to evaluate).spamWords: a list of strings (the spam words).
Output:
A list of strings, each either "spam" or "not_spam" for each text.
Constraints:
- 1 ≤ n ≤ 10^3 (number of texts)
- 1 ≤ k ≤ 10^5 (number of spam words)
- 1 ≤ len(text) ≤ 10^5
- 1 ≤ len(spamWord) ≤ 10^5
- Combined length of all spam words does not exceed 10^7
Given an integer array nums, you can perform operations. In one operation, you pick any nums[i], delete it, and earn nums[i] points. Afterwards, you must delete every element equal to nums[i] - 1 and every element equal to nums[i] + 1. The goal is to find the maximum points you can earn by applying this operation any number of times.