MindTickle Interview Experience Off Campus
I applied on linkedin in Feb 2019 and received a phone from HR in May. It was a basically a screening call and she asked about my projects, internship and the language in which I code and also told about company’s products, mission, tech stack that they use etc. and scheduled a telephonic interview 2-3 days later.
Round 1 (Telephonic): The first round was a DS, Algo round which started with a brief introduction of myself and the projects that I have done. Then he asked the following ques :
- Find the next greatest element on the right side of the element in the array.
Approach: Traverse the array from the end to start and keep track of the maximum element found so far, at every index check if the greatest element found so far is greater than the current element, if yes then update the next greatest element of ith index to that greatest element else put next greatest element of ith index to -1
- Find the next greater element on the right side of the element in the array, this was a slight modification of the above problem where we have to find the next greater and not the next greatest. https://www.geeksforgeeks.org/next-greater-element/
- You are given n days and for each day (di) you could either perform a high effort tasks (hi) or a low effort tasks (li) or no task with the constraint that you can choose a high-effort tasks only if you chose no task on the previous day. Find the maximum amount of tasks you can perform within these n days. https://www.geeksforgeeks.org/dynamic-programming-high-effort-vs-low-effort-tasks-problem/
I was able to write code for all the three problems
Round 2 (Telephonic): This was a coding round in which I have to write the pseduo code.
Round 3 (Face to Face): This round was with the technical product manager. He asked various DS, Algo ques, puzzles and the questions regarding my internship project.
- There is a n x m grid and a dice placed at (n – 1, m – 1). Two players are playing with alternate turns and the player who reaches (0, 0) first (on whose turn the dice reaches (0, 0) first ) will win the game. In any move a player can move the dice either horizontally left or vertically down any no. of steps. I had to devise a strategy in which player starting first will win and which are the cases in which player starting first cannot win. This was not a programming ques but a logical one.
Approach : Always try to place the dice on diagonal (x, x) position when its your opponent’s ( player starting 2nd ) turn, so that when he move any place from diagonal you can always place the dice on diagonal again in the next move. In this way we can ensure that player one always win except the case when (n – 1, m – 1) is itself a diagonal i.e, n – 1 = m – 1 or we can say its a square board because in that case your opponent will try to make you move the dice when it is on diagonal bcoz both are playing optimally. This can be difficult to think so take your time and think about it twice.
- Given a running stream of integers, find the k’th largest element everytime a new element occurs. https://www.geeksforgeeks.org/kth-largest-element-in-a-stream/
- Given two strings of varying lengths, I had to tell whether they are similar or not. Property of the string is that whenever there is an underscore (‘_’) at any index we discard the character at immediate left position i.e, is string = “A_B_CD_” then string after discrading underscores and corresponding characters would be “C” because “A_”, “B_”, “D_” would be discarded. other example string = “AB__” after reduction string would be “” i.e, empty string. “A__” is an invalid string we have no. of underscores are greater than the no. of characters. Cannot use extra space (stack based solution was not accepted).
Approach: Traverse from the end of both strings and do some checking of underscore and some other conditions. Think it twice and it is not a difficult problem. I had to code the problem on the ide in my laptop and luckily I was able to do it.
I was able to solve all the three ques completely
Round 4 (Face to Face) : This round was also on DS, Algo and some Java related things.
- Given a no. ‘k’ and a sum ‘s’. I had to tell the no. of paths in an infinite k-ary tree that sum to ‘s’. Every node contains k children and weights of the edges between the children are 1, 2, 3, …, k i.e every node has child with weight 1, 2, … k.Approach : Initially I gave the backtracking solution but further I gave an optimised DP solution.
- This was a modification of the above problem where I had to tell the no. of paths in an infinite k-ary tree that to sum ‘s’ and there is at least one edge having value greater than ‘m’. Given ‘k’, ‘s’ and ‘m’. I find this problem tough and was not able to solve it.
In the above problems only k was given and not the tree.
3. He asked some Java related ques like automatic garbage collection, how JVM works etc.
After all the rigorous rounds, I am really happy to be an upcoming MindTickler !
Please Login to comment...