GeeksforGeeks App
Open App
Browser
Continue

# SalesForce Interview Experience for On-Campus Internship 2021

Salesforce visited our campus (MNIT Jaipur) in the first week of September 2020 offering a 2 months summer internship which will take place in May and June 2021.

Coding Round (75 minutes) HackerRank:

• Given an array of integers, replace every number with the nearest right number whose frequency is greater than it in the array, if no such number exists replace it with -1. Next Greater Frequency element
• Find the size of the largest island in a 2-D matrix. It is similar to the below question with a little variation. Find the number of islands
• This question began with the explanation of the definition of tensors(there’s no problem if you don’t know about tensors at all) and they gave two 3-D matrices as input both with dimensions N x N x N and asked to multiply the top 2 axes of A with bottom 2 axes of B and output them in the form of N x N 2-D matrix.
E.g: Let there be two 3-D matrices of dimension 2 x 2 x 2.

```A={  { {1,2},{3,4} },  { {1,2},{3,4} }  }
B= { { {1,2},{3,4} },  { {1,2},{3,4} }  }
Then the top two axes and bottom 2 axes of
A and B can be represented in the form of 2-D
matrices A' and B' as
A'={{1,2,3,4} , {1,2,3,4}}
B'={{1,2},{3,4},{1,2},{3,4}}
now multiplying these two matrix will give
output as
```

I was able to solve all the questions in 35 minutes which worked as a plus point for me in the interviews.
Out of around 100 students, 14 were shortlisted for the next round.

All the rounds from here onwards were held on Google Meet and Codepair and there was a single interviewer in each round.

Technical Interview 1 (45 minutes):

1. Find next greater number with the same set of digits.
First I gave him an O(n*log(n)) approach using merge sort then he asked me to optimize it to O(n), so I used counting sort instead of merge sort then he asked me about radix sort and it’s time complexity.
2. Rearrange characters in a string such that no two adjacents are the same.
The interviewer was really helpful, and he gave some hints which I caught and gave him the correct answer.

After this round 10 out of 14 students got selected for the next round.

Technical Interview 2 (50 minutes):First, the interviewer made me comfortable by asking about the previous interview round and the coding round, and he also looked at my time and my solution in the coding round.

1. He began with OOPS and asked me how can I use the concept of OOPS in my college to maintain interdependencies between different branches in my college therefore I explained him some methods with the help of the use of inheritance and friend function then I explained him about that in detail, and he looked quite satisfied.
2. He asked me to write an algorithm to remove all the transitive relations from a hashmap where the key was a string and the mapped value is an array of strings.
E.g: Let the map key-value pairs be like this.
```A->B,C,D,E
B->F,G
G->H
S->T
So the final content after removal of all the transitive
relations in the hashmap will be:
A->B,F,G,C,H,D,E
S->T
I used recursive DFS to solve this and he was satisfied
```
1. He asked me to write an algorithm for evaluating mathematical expressions given in the form of a string consisting of basic arithmetic operators +, -, *, and /.
I gave him an algorithm using parse tree and leftmost derivation then he asked me to expand my algorithm for special functions like log, sqrt, and pow so I expanded it using a hashmap to store the special keywords, he was satisfied by my approach.
2. He asked me to implement a cache of a given size.

The interviewer was really helpful and asked me to relax whenever he felt I was getting nervous.
After this round 5 out of 10 students were selected for the next round.

HR Interview (45 minutes): The interviewer began by asking me about my day today and about all the subjects I have studied in my college and which were my favorites.
He then asked me about what do I expect from the company for myself, and he also talked about my role in the previous college club I was part of. After that, he asked about my projects, I explained the project and the technologies used in detail for about 10 minutes. Then he asked me some questions on OOPS about Function overloading, Function overriding, Function Hiding, Virtual functions, and Inheritance in detail.