Round 1: (Online) 45 mins
Coding Round: 2 coding questions and 10 technical MCQs. MCQs contained questions from C, C++, OS, etc.
1st Coding Question: Given an array of integers where each element represents the maximum number of steps that can be made forward from that element. Write a function to return the minimum number of jumps to reach the end of the array (starting from the first element). If an element is 0, then you cannot move through that element.
Example: Input: arr[] = {1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9} Output: 3 (1 -> 3 -> 8 -> 9)
Explanation: The first element is 1, so you can only go to index 1 (value 3). The second element is 3, so you can make at most 3 steps (e.g., to index 2 (value 5), index 3 (value 8), or index 4 (value 9)).
Solution: A naive approach is to start from the first element and recursively call for all elements reachable from the first element. The minimum number of jumps to reach the end from the first can be calculated using the minimum number of jumps needed to reach the end from the elements reachable from the first.
minJumps(start, end) = Min (minJumps(k, end)) for all k reachable from start.
Using Dynamic Programming, the complexity can be reduced to O(n).
2nd Coding Question: Given an array, print the Next Greater Element (NGE) for every element. The Next Greater Element for an element x is the first greater element on the right side of x in the array. For elements for which no greater element exists, consider the next greater element as -1.
Examples: a) For any array, the rightmost element always has a next greater element of -1. b) For an array sorted in decreasing order, all elements have a next greater element of -1. c) For the input array [4, 5, 2, 25], the next greater elements for each element are as follows:
| Element | NGE |
|---|---|
| 4 | 5 |
| 5 | 25 |
| 2 | 25 |
| 25 | -1 |
Solution: Use two loops. The outer loop picks all elements one by one. The inner loop looks for the first greater element for the element picked by the outer loop. If a greater element is found, then that element is printed as the next greater element; otherwise, -1 is printed. Time-Complexity: O(n^2) This can be reduced to O(n) by using a Stack.
Round 2: F2F Round
The interview process started with introductions. The interviewer was very friendly and asked about my day. After thoroughly going through my CV, the interviewer asked what I meant by Object-Oriented Programming Principles.
I started by first explaining what we mean by objects (any real-world entity which has a certain state and behavior, which in programming concepts are called data members and methods). Then I stated various OOP concepts like Abstraction, Encapsulation, Polymorphism, and Inheritance, and explained each of them briefly.
Then the interviewer asked for a real-world example. I gave the example of a pen, which has states like ink amount and material, and behaviors like writing.
Next, the interviewer asked me to identify the objects present in a water bottle. I provided a solution and stated that it depends upon the designer of the class.
There was a brief discussion about my CGPA and the projects I had done during my internship at a startup. Finally, I was selected for the next round.
Round 3: HR Round
In this round, all candidates were asked to sit together, and some behavioral questions were asked, such as "Why do you want to join Salesforce?" The interviewer was very friendly, and finally, I was selected.
The interviewer asked me, "What do you mean by Object-Oriented Programming Principles?"
The following metrics were computed from 2 interview experiences for the Salesforce Software Engineer role in Calcutta, India.
Salesforce's interview process for their Software Engineer roles in Calcutta, India is incredibly easy as the vast majority of engineers get an offer after going through it.
Candidates reported having very good feelings for Salesforce's Software Engineer interview process in Calcutta, India.