Here i will be sharing my TCS INE Assesment experience
It was a pool campus oppurtunity for all IIT ,NIT ,IIIT
It happened at a tcs Ion centre in my hometown
1st section was Verbal Ability having 15 questions each of 2 marks and was around 20 minutes
the questions were easy to medium if yu have given Infosys System Engineer OA then i can tell yu level was approximately same for both of them
questions were choose correct idioms , find correct order of sentences and finding error ,and a paragraph is given and yu have to read and answer some of the mcqs
Now coming to Aptitude Section it also has 15 questions of 2 marks and was of 30 minutes
The level was quite hard If yu want to compare it to Infosys System Engineer than i can tell that it was approximatley 3 times harder than that for comparsion one of my friend is specialist on CF and he could do only 4-5 Aptitude problem
If yu can practise CAT aptitude problems level was somewhat similar to that
Now coming to Coding Problems
Before going to coding problems i would like to tell yu all that the compiler was patheatic
it was not even printing the answer what my code is giving just tell yu that yur code passes test cases or not
so i will suggest yu all to practise coding on notepad for familiar experience
There are 2 Coding Problems
Both questions were easy and they were basic Brute Force and nothing related to Data Structures and Algorithms
Both problems are of 85 marks each and time 35 minutes for each of them
1st Problem-->
there are n bombs on the field and a robot has to diffuse all the bombs
but robot needs to cover the minimum distance to do so and robot will diffuse the bomb which are left most and top most and which is at minumum distance from current position
and we have to return the final distance in integer taking ceil value of final answer
this was the first test case
7
10 20
20 30
30 40
5 10
5 20
10 5
10 10
this was the exact testcase
Approach to solve it-->
take coordinates in vector of pairs and then sort that vector because we have to take minimum value from top most and left most and then iterate over all the indexes which are not visited and take the euclidean distance between those two coordinates
I could not solve it there due to my compiler issues and time got finished but i hope the below code is correct one
constraint was 100 rows and 100 columns
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<pair<int,int>>v;
for(int i=0;i<n;i++){
int a,b;
cin>>a>>b;
v.push_back({a,b});
}
sort(v.begin(),v.end());
vector<vector<double>>dp(n,vector<double>(n,1e8));
for (int i = 0; i <n ; ++i)
{
for (int j = 0; j <n ; ++j)
{
if (i!=j)
{
int r1=v[i].first;
int c1=v[i].second;
int r2=v[j].first;
int c2=v[j].second;
double a=abs(r1-r2);
double b=abs(c1-c2);
double c=a*a+b*b;
double d=sqrt(c);
dp[i][j]=d;
}
}
}
int curr_index=0;
double ans=0;
vector<int>vis(n,0);
vis[0]=1;
for (int i = 0; i < n-1; ++i)
{
double temp=1e8;
int next_curr=-1;
for(int j=0;j<n;j++){
if(dp[curr_index][j]<temp && vis[j]==0){
temp=dp[curr_index][j];
next_curr=j;
}
}
curr_index=next_curr;
vis[curr_index]=1;
ans+=temp;
}
ans=ceil(ans);
cout<<ans<<endl;
return 0;
}
Now talking about other question
In this question there are n pair of coordinates given and yu have to mark area between those pair of coordinates
and yu have to return final marked area
testcase->
2
2 4 7 7
4 2 5 8
i donot remember the exact testcase but this is somewhat like that
i was able to solve this question so for this question my approach was correct
constraint was rows=100 col=100
and n was 100 i guess donot remember it exactly
so considering 1st query the field will look like this
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
after 2nd
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 1 1 1 0
0 0 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
both are considered independent
now after combining them the common marked area was something like this
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 0
0 0 1 1 1 1 1 1 1 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
now yu just have to count marked area which are 1
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<vector<int>>dp(100,vector<int>(100,0));
for (int i = 0; i < n; ++i)
{
int r1,r2,c1,c2;
cin>>r1>>c1>>r2>>c2;
for (int i = r1; i <=r2 ; ++i)
{
for (int j = c1; j <=c2 ; ++j)
{
dp[i][j]=1;
}
}
}
int ans=0;
for (int i = 0; i <100 ; ++i)
{
for (int j = 0; j <100 ; ++j)
{
if(dp[i][j]==1)ans++;
}
}
cout<<ans<<endl;
return 0;
}
Like the Post if yu find it useful
If any query yu may ask in comments i will be happy to answer them as soon as possible