# Salesforce Interview Experience for SDE Internship (On-Campus)

Round 1:Online Coding Round

• Platform: Hackerrank
• Duration: 1 hour 15 min.
• No. Of Questions: 3

Questions are as follows:

1. 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".
```
2. This was a pretty easy question and the expected time complexity for this was O(n).

3. 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.

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,

1. 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}}```

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 !!

Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

1

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.