Tip 1 : Be confident in the projects you have mentioned in your resume.
Tip 2 : Always discuss your approach with the interviewer first for any problem.
Tip 3 : Always start with a basic solution and then discuss further optimisations.
Tip 1 : Good projects showing your skills (Be clear in what you achieved from those projects)
Tip 2 : Internship experience at the top (It gives you an edge over others)
This round was telephonic round. The interview lasted for approximately 45 minutes. The interviewer asked me three coding questions. I hustled a bit on 3rd question but after a hint was able to solve it.
Given a linked list, reverse alternate nodes and append them to the end of the list. Extra allowed space is O(1)
Examples:
Input: 1->2->3->4->5->6
Output: 1->3->5->6->4->2
Explanation: Two lists are 1->3->5 and 2->4->6,
reverse the 2nd list: 6->4->2.
Merge the lists
...
Gave the approach in which we maintain a two separate linked list one for odd position elements and others for even. Then traverse the linked list and push the odd position element to the odd linked list and similarly for even and now attach both the linked list according to question and the interviewer was satisfied with my approach.
It depends on what traversals are given. If one of the traversal methods is Inorder then the tree can be constructed, otherwise not.
I said yes, and gave him an example by taking preorder and inorder traversal.
There are 3 ants sitting on three corners of a triangle. All ants randomly pick a direction and start moving along edge of the triangle. What is the probability that any two ants collide?
Initially, I was not getting any approach but then the interviewer gave me hint that is collision will not happen when all ants move in the counterclockwise direction or in a clockwise direction. Then I took an example and apply permutation and combination and found probability and he was satisfied with my approach.
This round was Online Test on Hackerrank for 120 minutes, it contained 3 questions.
Solved this by taking deque and map data structure.
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 array. Elements for which no greater element exist, consider next greater element as -1.
Examples:
For any array, rightmost element always has next greater element as -1.
For an array ...
Solved this question using stack and comparing current element of array to top of the stack.
An encoded string (s) is given, the task is to decode it. The pattern in which the strings are encoded is as follows.
<count>[sub_str] ==> The substring 'sub_str'
appears count times.
Examples:
Input : str[] = "1[b]"
Output : b
In...
Used two stacks one for integer and the other for char and solved this by string traversal and applied the comparison conditions according to the question.
This round was face to face Interview at Ola Campus and lasted for 1 hour.
Thoroughly gave the description of the two projects that I have done in my two internships.
Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”
reverse-words
Examples:
Input: s = “geeks quiz practice code”
Output: s =...
This was a standard question of string and gave him an approach to initially reverse each word of string and then reversed the whole string and he was satisfied with that approach.
Given a sorted array consisting 0’s and 1’s. The problem is to find the index of first ‘1’ in the sorted array. It could be possible that the array consists of only 0’s or only 1’s. If 1’s are not present in the array then print “-1”.
Examples :
Input : arr[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
Output : 6
The index of first 1 in the array is 6.
...I gave him a binary search approach for this question and he was satisfied.
Given an infinite sorted array consisting 0s and 1s. The problem is to find the index of first ‘1’ in that array. As the array is infinite, therefore it is guaranteed that number ‘1’ will be present in the array.
Examples:
Input : arr[] = {0, 0, 1, 1, 1, 1}
Output : 2
Input : arr[] = {1, 1, 1, 1,, 1, 1}
Output : 0
He extended the above question and after a hint, I was able to come up with binary search approach in which the end index would double up each time the binary search was called, he looked convinced.
This round was again a face to face technical interview, I was just asked one question in this round.
Given a book of words. Assume you have enough main memory to accommodate all words. design a data structure to find top K maximum occurring words. The data structure should be dynamic so that new words can be added.
I gave an approach using k sized max heap, after getting satisfied with the approach the Interviewer asked me to code it, I missed a boundary case of the array of strings being empty which the Interviewer pointed out and asked me to cover it along with other such cases, I modified the code for such conditions and upon 2nd review the interviewer was satisfied.
Only a question of System Design was asked
Design a toll booth system for the Ola cabs and explain the necessary functions and data structures used in it.
Designed the given question by considering each scenario or test case the and use most optimal data structures in the solution.case the
Very general HR questions were asked
Just spoke the truth and told HR about my weaknesses and strength and why I will be a valuable asset to OLA.
Told him my current salary plus the expected hike.
Gave him the reason why joining OLA is so important for me.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is the result of 4 % 2?