SalesForce OA

Result
Ongoing
Posted
29 Sept 2025
631 reads

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.

How it went

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.

Questions asked (2)

  1. 01

    Text Classification for Spam Detection

    Data Structures & Algorithms

    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

  2. 02

    Delete and Earn

    Data Structures & Algorithms · Medium

    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.

    Open the problem

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!