Tip 1 : consistently practice the coding problems
Tip 2 : have a good resume
Tip 3 : give online coding contests
Tip 1 : good problem solving skills
Tip 2 : communication skills matter alot during interviews
It was an online assessment on Hackerrank platform. We can attempt it on the anytime between the given time slot . Mic and camera were on.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.
{ “abc”, “ged”, “dge”, “bac” }
In the above example the array should be divided into 2 groups. The first group consists of { “abc”, “bac” } and the second group consists of { “ged”, “dge” }.
1. The sub-array of an array is a continuous part of the array.
2. Consider ‘0’ based indexing.
3. ‘k’ will always be less than or equal to ‘n’.
3. Don’t print anything, just return the integer array ‘count’.
It was on Skype call between 10:30 am . The interview began on time. The interviewer was friendly and engaging in the discussion.
In the above image, areas in green, red, and violet color are all submatrices of the original 4x4 matrix.
1. Binary valued matrix has only two values in each cell : 0 and 1.
2. A submatrix is a matrix formed by selecting certain rows and columns from a larger matrix.
3. The area of a matrix with 'h' rows and 'w' columns is equal to 'h' * 'w'.
1) Construct a sum matrix S[R][C] for the given M[R][C].
a) Copy first row and first columns as it is from M[][] to S[][]
b) For other entries, use following expressions to construct S[][]
If M[i][j] is 1 then
S[i][j] = min(S[i][j-1], S[i-1][j], S[i-1][j-1]) + 1
Else /*If M[i][j] is 0*/
S[i][j] = 0
2) Find the maximum entry in S[R][C]
3) Using the value and coordinates of maximum entry in S[i], print
sub-matrix of M[][]
1.The idea is to use the fact that inorder traversal of Binary Search Tree is in increasing order of their value.
2.So, find the inorder traversal of the Binary Tree and store it in the array and try to sort the array. The minimum number of swap required to get the array sorted will be the answer.
In this round the interviewer asked me a puzzle and one coding problem .
Input: 'V' = 60
Output: 2
Ninja need to pay two coins only 50 + 10 = 60
Suppose we have 3 glasses and 10 coins. The problem is to place odd number of coins in each glass i.e. each glass should contain coins and the number of coins in each glass must be odd and total coins which will be used must be equal to 10.
1. It is not possible to use all 10 coins with each glass having odd number of coins. Therefore, we must think out of box.
2. In the 1st glass place 5 coins which is odd, after that in second glass place 2 coins and in the third glass place 3 coins which is odd.
3. Now, place the entire 3rd glass inside 2nd glass. Indirectly, now 2nd glass contains 5 coins which is odd in nature.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which of the following ensures referential integrity in SQL?