Open In App

# 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}}```