Tip 1 : Regularly participate in contests.
Tip 2 : along with DSA prepare your CS core subjects also.
Tip 3 : Make at least 2 personal projects on trending tech stacks.
Tip 1 : Don't bluff in resume.
Tip 2 : You should have at least 2 personal projects.
it was from 10 am - 11.30 am. It was the online coding round having 3 questions. 2 were easy and 1 was of medium difficulty.



For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].
Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].
Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].
Interval [10, 12] does not overlap with any interval.
Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
first i sorted the given array on the basis of start time of given intervals. we will iterate the sorted list now and try to maximize the range of each interval if ending time is less than start time of next pair then we will merge this current pair with next one and update our current end time with end time of next one.
this is the code for above logic -->
int st = a[0][0];
int en = a[0][1];
int n = a.size();
for(int i = 1;i {
if(a[i][0]<=en)
{
en = max(a[i][1],en);
}
else
{
ans.push_back({st,en});
st = a[i][0];
en = a[i][1];
}
}
ans.push_back({st,en});



it is a very standard problem of dynamic programming. in this for each move we will either take it or not take it. code -->
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=c;j++)
{
if(w[i-1]>j)
{
dp[i][j] = dp[i-1][j];
}
else
{
dp[i][j]= max(v[i-1] + dp[i-1][j - w[i-1]],dp[i-1][j]);
}
}
}



Let 'S'= “abAb”.
Here the characters ‘a’ and ‘A’ have frequency 1 and character ‘b’ has frequency ‘2’.
Therefore the sorted string is “bbAa”.
firstly store the frequency of each element and then store it in set of pair and then reverse it. then iterate the set and push the elements in ans string.
code -->
unordered_map mp;
for(auto &op : s)
mp[op]++;
set,greater<>> ss;
for(auto &op : mp)
{
ss.insert({op.second,op.first});
}
string ans;
for(auto &op : ss)
{
for(int j = 0;j {
ans.push_back(op.second);
}
}
it was aound 10am - 11 am. interviewer was good and he was very supportive.



Question 1 -->
int main(int argc , char *argv[])
{
printf("%c",**++argv);
}
Question 2 -->
int *x[N];
x=(int(*)[N])malloc(M*sizeof(*x));
printf("%d %d",sizeof(x),sizeof(*x));
I was not able to answer these questions as i was not good in core C concepts such as pointer.

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