OnCampus: IIT BHU
Post: SDE
Total CTC: 28 LPA
Tentative Location: Bangalore
Initial Shortlisting
Initial shortlisting had 3 Coding Questions and few MCQs. Coding questions were easy, and solved were most of the students, hence MCQs played a vital role in shortlisting.
Round 1: DSA round (45 minutes)
Two DSA questions were asked:
2.
There is a grid with 0 and 1. 0 means wall and 1 means free path
there is a starting and ending point given for a ball. Ball can be
rolled in any direction once rolled it keeps on rolling until it
finds an edge or a wall. Find min number of roles to reach endpoint.
Round 2 (Managerial round) (45 minutes)
The interview started off as a general introduction. Following the introduction was grilled a lot on Projects and previous Internship Experience. No DSA questions were asked.
Round 3 (HR round) (20 minutes)
Basic HR questions were asked like
Tips and Takeaways
Verdict: Will be updated
All the Best to you guys!
Overview
Solution
PseudoCode
ll fnd(ll idx, vector<ll> &dp, vector<ll> &a, ll n)
{
if (idx >= n)
return 0;
if (dp[idx] != -1)
{
return dp[idx];
}
ll ans = 0;
ans = max(ans, a[idx] + fnd(idx + 2, dp, a, n));// if current value is taken
ans = max(ans, fnd(idx + 1, dp, a, n));// if current value is not taken
return dp[idx] = ans; // return maximum of the above two
}
Q2) Minimum Rolls
Assumption
Solution
Pseudo Code
for(int i=0;i<4;i++)
{
q.push({i,src});
dist[src.F][src.S][i]=0;
}
while(!q.empty())
{
pair<int,int> curr=q.front().S;
int dir=q.front().F;
q.pop();
if(valid(curr,dir))//Check whether there is no blockage in direction dir
{
pair<int,int> temp=curr;
temp.F+=dx[dir];
temp.S+=dy[dir];
if(dist[temp.F][temp.S][dir]>dist[curr.F][curr.S][dir]+1)
{
dist[temp.F][temp.S][dir]=dist[curr.F][curr.S][dir]+1;
q.push({dir,temp});
}
}
else
{
for(int d=0;d<4;d++)
{
pair<int,int> temp=curr;
temp.F+=dx[d];
temp.S+=dy[d];
if(valid(curr,d))
{
if(dist[temp.F][temp.S][d]>dist[curr.F][curr.S][dir]+1)
{
dist[temp.F][temp.S][d]=dist[curr.F][curr.S][dir]+1;
q.push({d,temp});
}
}
}
}
}