Você está na página 1de 3

Citi Group- They have asked the same questions in five

IITs(Bombay,delhi,BHU,Madras,roorkee)
Three sections with multiple choice questions -Also, its mentioned that the test
is adaptive
Quantitative aptitude - 16 questions 16 min
Logical Reasoning - 14 questions 16 min.
CS - 25 questions (Mostly DS/ C Output) 35 min
Coding - 2 questions. 60 min.(different set for everyone)
0)-Math( check for consecutive grey code terms)
1)-Find minimum sum path from root to leaf.
2)-find matrix multiplication with its transpose.
http://martin-thoma.com/part-iv-multiply-matrix-transpose-python-cpp/
3)-Reverse the latter half part of a given linked list.
http://www.geeksforgeeks.org/reverse-a-list-in-groups-of-given-size/
4)-Print numbers in a given fashion
given n=5
1*2*3*4*5
11*12*13*14*15
21*22*23*24*25
16*.....................*20
6*7*8*9*10
5)-find gcd of given n numbers

6)-Given a mxn grid consisting of 0 and 1 where 0 denotes wall and 1 denotes the
movable path. Grid also consists of number 9 at one coordinate which denotes
location of cheese. A rat starts at position (0,0) in the grid, we should check
whether the rat can travel to cheese(in other words 9) following only 1s.
7)-Given array={ 1,1, 3, 3, 3,2, 5,5,5,5, 5, 9, 9}, we should arrange them in the
decreasing order of frequency and the elements with same frequency should
come in the order same as in the given array. So the expected output array is
{5,5,5,5,5, 3,3,3,1,1,9,9,2}
Q1:
int minSumPath(node *ptr) {
if(ptr == NULL)
return 0;

int sum = ptr->value;

int left_sum = minSumPath(ptr->left);


int right_sum = minSumPath(ptr->right);

if(ptr->left!=NULL && ptr->right!=NULL){


if(left_sum <= right_sum)
sum += minSumPath(ptr->left);
else
sum += minSumPath(ptr->right);
}
else{
if(ptr->left==NULL)
sum += minSumPath(ptr->right);
if(ptr->right==NULL)
sum += minSumPath(ptr->left);
}
return sum;
}

Q.5:
#include <stdio.h>

unsigned gcd(unsigned x, unsigned y){


unsigned wk;
if(x<y){ wk=x;x=y;y=wk; }
while(y){
wk = x%y;
x=y;
y=wk;
}
return x;
}

int gcd_a(int n, int a[n]){


if(n==1) return a[0];
if(n==2) return gcd(a[0], a[1]);
int h = n / 2;
return gcd(gcd_a(h, &a[h-1]), gcd_a(n - h, &a[h]));
}

int main(void){
int A[10]={112, 160, 180, 240, 288, 32, 480, 96, 60, 72};
int size_A = sizeof(A)/sizeof(*A);
int gcd = gcd_a(size_A, A);
printf("%d\n", gcd);
return 0;
}

Q.5:

Você também pode gostar