Round 1:It was online round consisting of 2 coding questions to be solved in 90 min.
1.There is an m cross n grid given and you need to divide it into 4 parts by drawing a vertical line and a horizontal line such that total sum of absolute sums of all the 4 parts is minimum.
where absolute sum of a matrix=|sum of all elements in the matrix|
2.There is a competition held where people need to cross a river either by swimming or stepping on stones or both.There are n number of stones in the river in a line and each stone has a value associated to it, whenever a person steps on a stone, he gains those value A person needs to cross a river by obtaining optimum number of points.
If all the stones have negative values, the person can swim the river and maximum number of points he can gain is 0.
we need to find the value of |(maximum number of points he can gain)-(minimum number of points he can gain)|
(I did it using dynamic programming).
Round 2: Face to Face technical interview
The interviewer was friendly and asked me lot of questions on Data structures, DBMS, Java.
few of the questions were:
1.1st question of online round
2.Maximum profit by buying and selling a share atmost k times
(link to above question: https://www.geeksforgeeks.org/maximum-profit-by-buying-and-selling-a-share-at-most-k-times/).
3.Shortest root to leaf path with minimum sum in a binary tree.
4.Given a Binary search tree, find some of the elements of BST whose average is same as average of remaining number of elements.
( I told him that we can do inorder traversal and store it in an array and apply subset sum problem(https://www.geeksforgeeks.org/subset-sum-problem-dp-25/)).
5.Find Current Median of stream of incoming integers by storing only some of the integers.
(I’ve given this approach(https://www.geeksforgeeks.org/median-of-stream-of-integers-running-integers/) but he told we need to store only some of the integers).
6.How is interface more useful for implementing Abstraction than abstract class.
7.Bucket sort and what is it’s practical implementation and use.
8.Which sorting method is useful for minimum number of comparisions and then swaps.
Round 3:Face to Face technical Interview.
He asked me few questions.
1.1st question of online round.
2.Implement data structure for storing web browser history.
3.There are n steps and u can only climb one or two steps at a time, how many ways can u reach the end(Fibonacci series).
4.Implement data structure for storing student id and grade of each course of each semester of all the years along with the sgpa of that particular semester so that we can read and update the grade of courses easily and automatically update sgpa and cgpa.
5.Which subjects i’m interested in.
6.If i had any questions for him.
Unfortunately i was not selected for HR round but it was a good experience.
Thanks to geeksforgeeks.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.