Salesforce OA
- Posted
- 3 Mar 2026
Summary
I absolutely struggled during the Salesforce Online Assessment, encountering two challenging algorithmic problems.
How it went
Absolutely bottled it.
1. Given an array of elements (n = 10^5), you can perform two operations on them: - Remove an element - Change it to any random integer
Return the minimum no of removals such that the largest element is at most twice the smallest element.
2. Given a list of strings, find the number of pairs (i,j) such that any permutation of the concatenated pairs is a palindrome. [Total length of all strings = 3 * 10^5]
Questions asked (2)
- 01
Minimize Removals for Max-Twice-Min Array
Data Structures & Algorithms
Given an array of elements (n = 10^5), you can perform two operations on them:
- Remove an element
- Change it to any random integer
Return the minimum no of removals such that the largest element is at most twice the smallest element. - 02
Count Palindromic Concatenated String Pairs
Data Structures & Algorithms
Given a list of strings, find the number of pairs (i,j) such that any permutation of the concatenated pairs is a palindrome. [Total length of all strings = 3 * 10^5]