SalesForce OA
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.