Tip 1 : Practice at least 250 Questions on GFG/Leetcode
Tip 2 : For DSA questions in interviews, start explaining from the brute force approach and then move to the optimal one. Convey your thought process to the interviewers, so that they can help you out if you get stuck.
Tip 3 : Do not write anything that you are not confident of in resume
Tip 4 : Do at least 2 projects
Tip 1 : Try to include at least one development project in your resume.
Tip 2 : Interviewer will ask anything from your resume so be prepared for it.
Tip 3 : Don't mention some random projects which you are not sure about or copied from Google or somewhere else.
There were three coding problems.
1. Medium
2. Medium
3. Hard
I was able to solve 2.5 problems and got shortlisted for interview. I remember only 2.



if Ayush want to study 6 chapters in 3 days and the time that each chapter requires is as follows:
Chapter 1 = 30
Chapter 2 = 20
Chapter 3 = 10
Chapter 4 = 40
Chapter 5 = 5
Chapter 6 = 45
Then he will study the chapters in the following order
| day 1 : 1 , 2 | day 2 : 3 , 4 | day 3 : 5 , 6 |
Here we can see that he study chapters in sequential order and the maximum time to study on a day is 50, which is the minimum possible in this case.



If there are any duplicates in the given array we will count only one of them in the consecutive sequence.
For the given 'ARR' [9,5,4,9,10,10,6].
Output = 3
The longest consecutive sequence is [4,5,6].
Can you solve this in O(N) time and O(N) space complexity?
Interviewer asked me 2 coding problems and asked me some question from my projects, oops, DBMS and computer networks.



“{}{}”, “{{}}”, “{{}{}}” are valid strings while “}{}”, “{}}{{}”, “{{}}}{“ are not valid strings.
Minimum operations to make ‘STR’ = “{{“ valid is 1.
In one operation, we can convert ‘{’ at index ‘1’ (0-based indexing) to ‘}’. The ‘STR’ now becomes "{}" which is a valid string.
Return -1 if it is impossible to make ‘STR’ valid.



1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
class Solution {
public static class Pair,Y extends Comparable> implements Comparable>{
X first;
Y second;
public Pair(X first, Y second){
this.first = first;
this.second = second;
}
public String toString(){
return "( " + first+" , "+second+" )";
}
@Override
public int compareTo(Pair o) {
int t = first.compareTo(o.first);
if(t == 0) return second.compareTo(o.second);
return t;
}
}
public static int orangesRotting(int[][] arr) {
int n = arr.length;
int m = arr[0].length;
Queue, Integer>> pendingNodes = new LinkedList<>();
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(arr[i][j] == 2){
Pair idx = new Pair<>(i, j);
Pair, Integer> p = new Pair<>(idx, 0);
pendingNodes.add(p);
}
}
}
int ans = 0;
while(!pendingNodes.isEmpty()){
Pair, Integer> front = pendingNodes.poll();
int i = front.first.first;
int j = front.first.second;
int level = front.second;
ans = Math.max(level, ans);
int del[][] = {{1,0},{-1,0},{0,1},{0,-1}};
for(int xx[]: del){
int new_i = i+xx[0];
int new_j = j+xx[1];
if(new_i < n && new_i >= 0 && new_j < m && new_j >= 0 && arr[new_i][new_j] == 1){
arr[new_i][new_j] = 2;
Pair idx = new Pair<>(new_i, new_j);
Pair, Integer> p = new Pair<>(idx, level+1);
pendingNodes.add(p);
}
}
}
for(int a[]:arr){
for(int ele : a){
if(ele == 1) return -1;
}
}
return ans;
}
}
Time Complexity of quick sort algorithm.
Case Time Complexity
Best Case O(n*logn)
Average Case O(n*logn)
Worst Case O(n2)

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: