Tip 1 : Practice as much as you can on sites like leetcode,GFG,interviewbit for clearing interviews
Tip 2 : Atleast have 2-3 projects ,which you can explain well about in the inetrviews . It will help you a lot .
Tip 3 : Revise the subjects like Operating systems, OOPS ,DBMS ,CN too as companies ask that too to freshers.
Tip 1 : It is helpful to have some projects in the resume .
Tip 2 : Good coding profiles on sites like leetcode, interviewbit ,GFG,Codeforces etc also helps in getting shortlisted .
Tip 3 : Only put those achievements/skills in resume that you're confident about .
It was an online round in the morning for 90 minutes in which 4 questions were asked .



1. Each array element should belong to exactly one of the subsets.
2. Subsets need not always be contiguous.
For example, for the array : [1, 2, 3], some of the possible divisions are
a) {1,2} and {3}
b) {1,3} and {2}.
3. Subset-sum is the sum of all the elements in that subset.
Input: 'n' = 5, 'arr' = [3, 1, 5, 2, 8].
Ouput: 1
Explanation: We can partition the given array into {3, 1, 5} and {2, 8}.
This will give us the minimum possible absolute difference i.e. (10 - 9 = 1).
The recursive solution is to consider each item in the given set S one by one, and for each item, there are two possibilities:
Include the current item in subset S1 and recur for the remaining items.
Include the current item from the subset S2 and recur for the remaining items.
Finally, return the minimum difference we get by including the current item in S1 and S2. When there are no items left in the set, return the absolute difference between elements of S1 and S2.
But the compiler didn't accepted the recursive solution so an optimised version were required .



1. The input may have 0 before the most significant digit, [0,3,5,7] is a valid input and it represents number 357.
2. Digits in the number can be repeated, i.e [3, 3, 4, 4] is a valid input and it represents the number 3344.
I followed backtracking based approach but some test cases were giving TLE.


1. Choose any list ‘A’ or ‘B’.
2. Traverse from left to right.
3. After picking a number, if the picked number is present in both the arrays, you are allowed to traverse to the other array.
Since the answer can be very large, print answer % (10^9 + 7).
If the given array are ‘A’ = [1,3,5,7,9] and ‘B’ = [3,5,100]”.The maximum score can be achieved is 109[1+3+5+100].
This is exactly how I thought about the problem , explained really well here
It was in the morning . It started with a brief introduction of both of us (interviewer and me). Then he pasted an input test case and output of that on the glider platform . I had to understand what the problem does exactly to give the desired output. I told the interviewer what I could comprehend seeing the corresponding output and he agreed to it and then asked me to solve the problem and write the code for it too .



‘SECRETCODE’ consists of only English uppercases.
After thinking for some time and coming up with few dry runs ,I realised that stack would be an appropriate choice .
I took a stack which is of type 'char'to store the input string each character.
1.Traverse the string.
2.If the char is not a ]
push it into the stack.
Else
store all elements of the stack in a string in reverse fashion until we encounter a [.
pop the top element of stack as it it [.
After that create a number string and store the frequency in reverse fashion. We use while here and not if because we can also have 2 digit or 3 digit number as frequency. Keep popping from stack.
Then convert that number string into int k.
now use a while loop until k>0 and store each char of string k number of times.
Finally , traverse through the stack and store all the characters in reverse order until stack becomes empty.
It was a mix of everything - DSA ,Core computer subjects and I was also asked about my projects .



1. Coordinates of the cells are given in 0-based indexing.
2. You can move in 4 directions (Up, Down, Left, Right) from a cell.
3. The length of the path is the number of 1s lying in the path.
4. The source cell is always filled with 1.
1 0 1
1 1 1
1 1 1
For the given binary matrix and source cell(0,0) and destination cell(0,2). Few valid paths consisting of only 1s are
X 0 X X 0 X
X X X X 1 X
1 1 1 X X X
The length of the shortest path is 5.
It's a simple BFS problem. Basically, visit all the neighboring nodes first and then keep going till all the elements are visited at least once or if you reach the end node ie (n, m).
class Solution {
public:
int shortestPathBinaryMatrix(vector>& mat) {
int m=mat.size();int n=mat[0].size();
vector>visited(m,vector(n,false));
queue>q;
//start top right 0 as source node at level=0
//push its adjacent nodes in the queue
//such that we can find the shortest path
if(mat[0][0]==1 || mat[m-1][n-1]==1)
return -1;
if(m==1 && n==1 && mat[0][0]==0)
return 1;
int dx[]={-1,-1,0,+1,+1,+1,0,-1};
int dy[]={0,+1,+1,+1,0,-1,-1,-1};
for(int i=0;i<8;i++){
q.push({dx[i],dy[i]});
}
int level=0;//initial level is zero
bool reached=false;
while(!q.empty()){
int sz=q.size();
level++;
for(int k=0;k=0 && j>=0 && i mat[i][j]=level;
visited[i][j]=true;
if(i==m-1 && j==n-1)
{
reached=true;
break;
}
for(int l=0;l<8;l++){
q.push({i+dx[l],j+dy[l]});
}
}
}
if(reached)
break;
}
return reached?level+1:-1;
}
};
What are semaphores.
What are different scheduling algorithms .
What is better Round Robin or SJF.
What is multithreading .
What is virtual memory .
What is paging .
What is deadlock and eg of its real world scenario.
Tip 1 : Revise OS concepts thoroughly from Gate Smashers/Knowledge Gate.
Tip 2 : Make notes which you can easily revise from few days before the interview.
What is normalisation .
Difference between 1NF,2NF,3NF .
Some SQL queries to write .
Different types of joins .
Tip 1 : You can practice SQL queries from hackerrank and leetcode.
Tip 2 : Watch DBMS playlist of Gate Smashers/Knowledge Gate

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?