Salesforce Interview Experience for SDE Internship (On-Campus)

08 Sep, 2020
This article is about my Internship Interview experience with Salesforce’s Campus Recruitment Program (Futureforce) at IIT (ISM) Dhanbad. The process took place in the first week of September in total virtual mode. 
Round 1:Online Coding Round
Platform: Hackerrank
Duration: 1 hour 15 min.
No. Of Questions: 3
Questions are as follows:
Given a string of length n. Right rotate it n times and count the total number of distinct strings after all rotations.Example:Input:"abc"  Output:3  Eplaination:"cab", "bca", "abc".
Input:"aaa"  Output:1  Eplaination:"aaa".
This was a pretty easy question and the expected time complexity for this was O(n).Given an entrance point and a vault and different corridors connecting them. Each connection has a cost to travel along with it. Generate all entrance to vault paths along with the total cost for that path. All resulting paths should be in non-decreasing order of their associated cost. If for two paths total cost is the same then the path with the fewer number of corridors visited should come first. If no. of corridors are also the same then they should be in alphabetic order.Input:"Entrance Vault 75"
      "Entrance CorridorA 55"
      "CorridorA Vault 15"
Output:"Entrance CorridorA Vault 70"
       "Entrance Vault 75"

Given a string of length n. Right rotate it n times and count the total number of distinct strings after all rotations.Example:Input:"abc"  Output:3  Eplaination:"cab", "bca", "abc".
Input:"aaa"  Output:1  Eplaination:"aaa".

Given a string of length n. Right rotate it n times and count the total number of distinct strings after all rotations.
Example:
Input:"abc"  Output:3  Eplaination:"cab", "bca", "abc".
Input:"aaa"  Output:1  Eplaination:"aaa".

This was a pretty easy question and the expected time complexity for this was O(n).
Given an entrance point and a vault and different corridors connecting them. Each connection has a cost to travel along with it. Generate all entrance to vault paths along with the total cost for that path. All resulting paths should be in non-decreasing order of their associated cost. If for two paths total cost is the same then the path with the fewer number of corridors visited should come first. If no. of corridors are also the same then they should be in alphabetic order.Input:"Entrance Vault 75"
      "Entrance CorridorA 55"
      "CorridorA Vault 15"
Output:"Entrance CorridorA Vault 70"
       "Entrance Vault 75"

Given an entrance point and a vault and different corridors connecting them. Each connection has a cost to travel along with it. Generate all entrance to vault paths along with the total cost for that path. All resulting paths should be in non-decreasing order of their associated cost. If for two paths total cost is the same then the path with the fewer number of corridors visited should come first. If no. of corridors are also the same then they should be in alphabetic order.
Input:"Entrance Vault 75"
      "Entrance CorridorA 55"
      "CorridorA Vault 15"
Output:"Entrance CorridorA Vault 70"
       "Entrance Vault 75"

This question seems to be simple and similar to find all sources to destination paths but the main problem was that all the inputs were in a string form and one must have to build suitable input by parsing through it. Many students got stuck here in parsing and debugging their code.
Given only n number of characters can be printed in a line. Left aligns a given text using suitable padding. It was a fairly easy question of implementation and test cases were quite easy too with no hard edge cases.
More than 200 students participated in this round and those who completed at least 2.5 questions were shortlisted for the next round. I did all three questions, so I got shortlisted with 13 other students for the interviews.
Round 2: First Technical Interview on Google Meet. For this round, I have been provided a hackerrank codepair link to code online. The interviewer began with a healthy introduction of him and then to light down the atmosphere, he asked me about my lockdown experience and all. After a conversation of about 5-6 min, he jumped to my cv and asked me to introduce one of my projects. Out of my expectation, he further asked me to draw the whole system flow of the project on the whiteboard provided on codepair. I did the same as per his query and after about a discussion of about 10-15 min. he moved to problem-solving. He asked me to implement the LRU cache algorithm on the codepair. I wrote the complete code which can be found here and it got compiled and run in the first attempt. After this question, he asked me one more question based on linked list implementation and then moved to the oops concepts. He asked me questions like what is the difference between abstract class and interface, what is an inner class and how it is different from an inheritance, what is polymorphism and how can we achieve run time polymorphism, etc. I started answering by giving definitions but soon he stopped me and asked me to provide real-life examples for each one of them and then counter questioned me again and again. This discussion lasts around 20-25 min. After that, he asked me a puzzle based on the divide and conquer approach and asked me to write step by step iterations of its solution. 
This round took around 1 hour to complete. The interviewer was very polite and helpful. After this round, 5 students got eliminated and the rest moved to the second round of interviews.
Round 3: Second Technical Interview on Google Meet. For this round again a codepair link was provided. The interviewer first asked me to introduce myself and interact with me for 2-3 min. After that, he started questioning me on problem-solving. The first question was, 
Given an array, count all inversions of length three where we can define an inversion to be a decreasing sequence of elements.Example:Input:{4,5,3,2}
Output:2
Explaination:{{4,3,2},{5,3,2}}
Given an array, count all inversions of length three where we can define an inversion to be a decreasing sequence of elements.Example:Input:{4,5,3,2}
Output:2
Explaination:{{4,3,2},{5,3,2}}
Given an array, count all inversions of length three where we can define an inversion to be a decreasing sequence of elements.
Example:
Input:{4,5,3,2}
Output:2
Explaination:{{4,3,2},{5,3,2}}
I quickly wrote a brute force solution with time complexity of O(n3), but for some test cases it was showing TLE, so he asked me to optimize my solution. I thought for about 1 min. and then told him an approach with three-pointers and code it quickly. But as the array was not in the sorted form it did not work. Then he gave me a hint to use the merge sort concept and guide me to the approach slowly. Finally, I completed my solution, and he seemed to be satisfied with it. Then he moved to oops concepts and asked me to define copy constructor, static and dynamic binding, and type conversions. Then he moved to Operating Systems and asked me to illustrate concurrency problems and semaphores. Then he further asked me what are the operations allowed on semaphore and quickly define Producer-Consumer Problem. Then he moved to DBMS and asked me a couple of questions on Locking and DBA responsibilities. At this time me network had some issues so our meeting went off, and we began again from where we left in around 5-6 min. He was very supportive and understanding in this case. He asked me 2-3 questions on Computer Networks like ducking and Cryptography. He was certainly very satisfied with all the answers I gave him. In the end, he asked me if I had any question, so I asked me feedback on my interview, and he told me that most of the candidates give their most priorities on Problem Solving and DSA only and ignore other computer science concepts, but I answered him all the question on computer science that gave me an extra edge over other candidates.
This round lasts about 55 min. and I was immediately informed that I have been moved to the last interview round.
Round 4: Final Interview on Google Meet. As per my expectations, this round should have been an HR round and it was in the beginning as he asked me to explain to me the project, what challenges I faced during it and why I chose that project. But suddenly out of my expectation he moved to problem-solving and gave me a question. The problem was, given two sorted arrays A and B with some extra space in the B array. I have to merge them in O(n) time complexity without using additional space. I provide him 2-3 approaches for it and wrote the code for it too. Then he gave me a puzzle to find the minimum number of weighing operations to find one odd weight ball in a pool of 6 balls where the rest five are identical in weight. I provide him a satisfactory answer and in the end, he asked me if I have any questions for him. I asked a couple of questions about the company and its working culture.
This round lasts about 25 min. and in the evening we received the results. 4 students were selected from my college and I was one of them 
The key things I learn through these interviews were, try to be practical and calm as much as you can, do not sit silently for too long, do not ignore computer science subjects, and practice problem solving as much as you can.
All The Best !!
Marketing
On-Campus
Salesforce
Internship
Interview Experiences
Salesforce
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.