Tip 1 : DSA (Practice at least 250 Questions)
Tip 2 : OOPS
Tip 3 : Do atleast two projects
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put the wrong things on your resume.
Which join is to be used between two tables A and B when the resultant table needs rows from A and B that matches the condition and rows from A that does not match the condition?
Tip 1 : Practice DBMS from internet
In Operating Systems, which of the following is/are CPU scheduling algorithms?
a) Priority
b) Round Robin
c) Shortest Job First
d) All of the mentioned
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
The coding test consisted of some questions all of which had to be correct to qualify for the next round.
1. Every inner brace should increase one indentation to the following lines.
2. Every close brace should decrease one indentation to the same line and the following lines.
3. Every ‘,’ will mean a separate line.
4. The indents can be increased with an additional 4 spaces or ‘/t’.
Let the input be: "{A:"B",C:{D:"E",F:{G:"H",I:"J"}}}"
Then we return the following array of strings:
{
A:"B",
C:
{
D:"E",
F:
{
G:"H",
I:"J"
}
}
}
Note that for every new brace we are putting an additional 4 spaces or \t.
1. [] and {} are only acceptable braces in this case.
The key idea in solving this problem is to simply iterate through the given string and construct our array of strings. We need to take care of the following points:
Whenever we encounter some kind of opening brace, we add 4 spaces to all the below lines in the beginning
Whenever we encounter some kind of closing brace, we delete 4 spaces to all the below lines from the beginning
When we encounter a ‘,’ we change the line.
In the case of a colon, we do not change the line unless we have a brace right next to it.
Below is the detailed algorithm:
We make an array of strings ‘RESULT’ to store the result.
We maintain a variable ‘brace’ which contains the number of braces encountered till now.
Initially, it is 1.
Now we iterate through the string and check for the following cases:
If the current character is an opening brace and is the first opening brace, we just make a new row in the result array and increment the brace by 1.If it is not a first opening brace, we make a new row and add ‘BRACE’ number of ‘\t’ or 4 spaces in the string and add a new line.
If the current character is a closing brace, we first decrease ‘BRACE’ by 1 and then add a brace number of ‘\t’ characters.
If we have a ‘,’ we simply add a new line. But we need to take care of the corner case that if a ‘,’ is followed by a brace, we need not do anything as the new line operation will be taken care of by the brace.
If we have a ‘:’ we simply print it unless we have a colon followed by an opening brace in which we make a new line and do the same as we did in point1.
Finally, we return the ‘RESULT’.
Do check your code for the following corner cases:
} followed by ,
} or ] followed by } or ]
{ or [ followed by { or [
The relative order of other elements should be maintained.
If Q = [ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]
and ‘K’ = 4
then the output will be
Q = [ 40, 30, 20, 10, 50, 60, 70, 80, 90, 100]
In round 3,they asked me to explain the programs that i have solved in round 2 and some questions regarding OOPS and DBMS
1. Surrounded regions shouldn’t be on the border, which means that any 'O' on the border of the matrix is not flipped to 'X'.
2. Any ‘O’ or group of connected ‘O’ are said to be surrounded by ‘X’ when all cells touching the boundary of the group of ‘O’ must contain ‘X’.
The algorithm is quite simple: Use BFS starting from 'O's on the boundary and mark them as 'B', then iterate over the whole board and mark 'O' as 'X' and 'B' as 'O'.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What does ROLLBACK do in DBMS?