I applied to Salesforce in through their careers page. A recruiter contacted me within a week and scheduled an online test the same day. I completed the test three days later.
Online Assessment (Aloha 5 - 90mins):
- Spiral Matrix - (Leetcode) - All test cases passed.
- Number of time units n is given along with two arrays meeting start and end time. Longest time without meeting is to be returned. Ex: n=10, start=[1,2,5,8], end=[2,2,6,10]. Ans=2 (time slot between 5 & 2 that is slots 3 & 4). Start and end could be unsorted as well. Wordings were different, but it's the same question. Got partial output (5/12) for this one - was getting TLE. I could not (and still cannot) think of the optimal solution. If someone can, please let me know.
Feedback: I was invited to the next rounds within three days of taking the test.
There was no elimination between round 1 & 2.
Round 1 (DSA - 1hr):
The initial 10-15 minutes were spent on introductions and discussions on my current project.
- Linkedlist with each node containing next and one random pointer is given. The end node will have null for both next and random ptr. Minimum distance to the end node from the start node is to be calculated. I used BFS and coded the solution, which worked fine. The interviewer had some issues with my way of BFS implementation. It was just about optimizing the constant part - my solution would take O(n+2), whereas the other one would be O(n+1) approximately. Both of which is still at the end O(n). Either way, my code was not clean. I did some cleaning - just the cleaning, not the change in the way I implemented, but I could sense the interviewer was not happy.
- Policemen catching theif (problem available in GFG) - We just had 12mins left for this. After a lot of struggle, I came up with a solution that takes O(nk), but I was not 100% sure if it works for all the cases. The interviewer also did not give any feedbacks or edge cases. I ran out of time for further discussions.
This round was touch and go according to me. It didn't go as expected. I am not sure how question 2 can be solved in 10mins if someone is seeing it for the first time. No elimination inbetween meant I had to give the next round.
Round 2 (LLD & Coding - 1hr):
- LLD: Notification library supporting different types of notifications. I gave this kind of round after a long time, could only come up with a manageable solution - I missed a lot of things initially and took hints from the interviewer.
- Longest Well-Performing Interval - (Leetcode) - Wordings were different, but it was the same question. I couldn't think of the optimal solution. The interviewer gave the hint 1 mentioned in the LC question, I could figure out what is to be done from there, but was not sure on how to do it.
I felt two questions of these kinds in 1hr is too much to ask. But it is what it is!
Feedback: I received a standard rejection email within a couple of hours.
The way interviews were scheduled by the recruiter was weird. No official meeting invites, never asked for convenient slots, was not even informed of the round 2 timings until I was done with round 1, both the rounds were delayed by ~30mins. But overall, the process was quick and simple. If round 1&2 are cleared, there will be a System Design and a Hiring Manager round.