- Question on Binary Search(minimizing the window length in a string type, similar questions available on practice. gfg).
- Given an array of length N holding sizes of (S, M, L, XL) return the maximum number of beads that can be placed in 2 containers with the following conditions :
Each container can have more than one bead of the same size. Start with a bead of any size. once you have started you can’t skip the bead in the sequence. Stop when u have to pick a bead of the third size.
I solved these in 30-35 min which gave me some edge in the next rounds as they didn’t ask me to write down the code.
Round-2(55 min): This round started with my brief introduction for about 3-4 min. Then he asked me about the language I am comfortable in. I told him C and C++ for coding and designing, js for web designing, and python for data science. So we continued with C++. Then he came up with 2 coding questions.
Given a string of type “string1/string2/string3/string4…..”
I have to cut out the “string3” from it.
I gave an approach like- first we need to reach the 2nd “/” and then start appending the characters in the answer string until we encounter the 3rd “/”. He then told me to write the code for it. I did that, but there was a bug in it for which he gave me time to resolve which I did soon.
Find out the 2nd maximum element from an array of numbers.
I gave an approach maintaining 2 variables maximum and 2nd maximum while iterating through the array.
He then told me to generalize it for the Kth maximum element. I explained to him my worst approach in many methods like using the n*log(n) sorting method, quick select method of quicksort, counting sort if the data is static and finally the median method with array partition which has the case of linear time . He was quite happy as I had so many methods for this. He then asked me to compare the time and space complexities of these algorithms.
Then he asked some questions on OOPS.
- What would have been the scenario if OOPS was not introduced?
- Difference between Overloading and Overriding.
- Explain the usage of overriding with real-life examples.
Then he asked me if I knew something in DBMS as it was not in my curriculum till then. I told to ask as I had studied a bit on my own. Some of the questions he asked were –
- What is RDBMS?
- How data is stored in non-RDBMS and its example?
- What is indexing in DBMS?
- Finally, he gave me a chance to ask questions if I had any. Then I asked :
- What will interns do in those 2 months?
- Will there be options for project choice?
- His answers were quite genuine.
Round-3(50 min): This round started with my hobbies and interests. Then he asked me some questions about FIFA and PUBG as I had these mentioned as interests in my resume. He had received my reviews of the previous round so he began with some coding questions :
1. Reversing a linked list.
I explained my approach with an example like-
If we have processed till 3 then we will have 3->2->1 and 4->5.
After it, we can transfer 4 from the right linked list as head of our left one and continue.
He was satisfied with my explanation and didn’t ask to write any pseudo code also.
2. Print 1-20 natural numbers by recursively calling the main function.
I gave him two approaches –
Pass two command-line arguments as 1 and 20 and recursively call the main function further with incremented index and 20.
Set two global variables one as 1 and the other as 20 and keep on incrementing 1st variable every time we call main. He told me to think of another approach with a static variable Then I explained with the use of a static variable in the main function and another variable as global set to 20.
Then he asked to design a class-based system for ATM Machines.
I gave him a constructive approach like- Let’s first consider it as a black box that takes the ATM card, pin, and amount as input and after some verifications gives us the money if valid.
Then I told him the most simple mechanism it can have for giving out cash in a sequential way- (ATM no. + Pin)->(verification of pin from bank server) ->(if correct then takes amount input)->( verification for available BAL with REQ amount)->(if good then gives out money).
At each step, there will be some side cases like while verification of pin there may be bank server error or incorrect pin then we will need to handle them also.
Finally, I counted some class names and some security things we need to take care of. He was quite impressed with my approach and didn’t ask me to write and class or code further.
Then he asked me some questions on OS :
- What are paging and round-robin?
- What is the deadlock?
- As it was not in my curriculum till then so he didn’t go deeper.
- Then he asked me some questions on Networking-
- What is the role of the presentation layer?
- What are the protocols used in that layer?
- What is SSL protocol?
As it was not in my curriculum till then so he didn’t go deeper.
Finally, he gave me a chance to ask questions if I had any. Then I asked :
- Give me some feedback about how I performed and my weaknesses.
- Will I work in salesforce or future force?
HR Round(20 min): He asked me to introduce myself and then he asked me about my data science project on HAR:
- Which algorithms are used in that project?
- Difference between Decision Tree and Neural Network?
- Why Decision Trees are not used as much as compared to NN in the case of classification.
Then he asked me some genuine questions :
- Why Salesforce?
- What will I do if there is a team conflict in the given scenario:
- I think my idea is better than what my team is currently discussing but they are not giving me a chance to put my idea?
- Finally, he asked me if I had some questions. I asked him:
- Will I get a chance to change my project?
- Difference between SDE, IT Analyst, and Business Analyst.
Fortunately, I was selected among the 3 students for an internship!
- Be good in DSA (this may give you an edge).
- Understand the concepts/technologies you encounter.
- Practice design implementation.
- Stay calm and have confidence.
- Discuss everything you think during the interview.