Sasken Previous years Placement Paper Questions answers |   13508

Sasken Previous years Placement Paper Questions answers

 

Sasken previous years placement papers questions with answers.Sasken aptitude,numerical,reasoning and technical questions interview procedure 

 

Sasken Aptitude and Technical Questions with answers as on 2012,chennai

 

Aptitude


1.How many 2 digit numbers are there which have 8 as the unit number in it’s square.
(a)3
(b)None
(c)2
(d)1

 

2. B is 8km East of A. C is 6km North of B. D is 12km East of C. E is 16km North of D. What is the distance b/w A and E.
(a)20km
(b)22km
(c)18km
(d)30km

 

3. x+y = z
Then
(a)…
(b)y

 

4.Two people were walking in opposite directions. both of them walked 6 miles forward then took right and walked 8 miles. how far is each from starting positions?
a) 14 miles and 14 miles
b) 10 miles 10 miles
c) 6 miles 6 miles

 

5 A person has certain number of cows and birds. they have 172 eyes and 344 legs. how many  cows and birds does he have? 

 

6 A person has 14 red socks and 14 white socks in a drawer. what is the minimum number of  socks that he should take to get a correct pair?

 

7.When a number is multiplied by 13,it will become greater to 105 by an amt with which it is lesser  to105 by now. what is the number

 

8. When asked what the time is, a person answered that the amount of time left is 1/5 of the time already completed. what is the time?

 

9.When I become as old as my father is now, I will be 5 times the age of my son. and my son will  be 8 yrs older than what I am now.father+my age=100.how old is my son now?

 

10. Two peoples on cycles are traveling at 10 miles / hour. when they reach a distance of 50 miles, a housefly lands on the first cyclist and then flies to the other and so on…at a speed of 16  miles/hour. what is the distance covered by fly before cyclist meet?

 

11..My successor’s father is my father’s son. and I don’t have any brothers or sons. who is my successor?
a)nephew
b)niece
c)daughter
d)myself

 

12.The hours remaining in a day is one-fifth of the hours passed in the day. What is the time?

 

13.  My successor is my uncles only brothers son who is his only kid.

 

14.A and B starts from the same point and moves in opposite direction for 8 miles and 6 miles respectively. After that A turns right and moves for another 6 miles. B also turns right and moves 8


miles. What are their respective distance from the starting point?   10,10

15   In a pet shop there are 120 eyes and 172 legs. How many birds and puppies are included in these?

 

16    Two cyclists are moving towards each other at 10 miles/hour. They are now 50 miles apart. At this instance a fly starts from one cyclist and move towards other and moves to and fro till the two


cyclist meet each other. If the fly is moving at 15 miles/hour, what is the total distance covered by the fly?       50  80  100 6.     Guru s draw has 14 blue socks and 14 black socks. How many socks must be taken to get a pair of socks of the same color?          14  15  13  16


COMPUTER SCIENCE

 

1. which of these checks for structural errors of a language
a)lexical analyser
b)parser
c)intermediate code
d)code optimisation

 

2. threads in the same process share the same
a)data section
b)stack
c)registers
d) thread id

 

3.the depth of a binary tree…
a)nlogn(base 2)
b) n*n
c)n

 

4.a program computing log(n) accepts 1000 inputs its execution time is 110 ms…when it doubles  n to 2000 inputs..it becomes 120…..and what will be for 4000
a)130
b)140
c)150

 

5.algorithm to find the balancing of paranthesis was given and output had to be obtaines…using  stacks…easy yaar….

 

6.which of the followin is non preemptive
fcfs
round robin
shortest job first

 

7.problem to find the avg waitin time of sjf..given the burst times of each process

 

8.which of the follwing may be implemented using a stack
parenthesis matchin
parsing
local variables stored in runtime
all the above

 

9.which of the foll data structures can be randomly accessed givin loc
1.linked kist implemented using array
2.singly linked list
3.double linked list
4.both single and double linked list


C SECTION

1.     Find output     ………….
Int *ptr=&const;
((((( ans:error)))))

 

2.     Find output           Function(i=10);
  (((((ans:error)))))

 

3.     #define SWAP(x,y)  t=x;x=y;y=t;
main()
{ int x=5,y=6;
  if (x>y)
   SWAP(x,y);
  Printf( x=%d      y=%dn ,x,y);
}  

                                      ((( note that the function SWAPis not within  braces))))

4.     sum(int x)
{int t;
  if(x<=1)  return (1);
  t=sum(x-3)+sum(x-1);
  return (t);
}


if 6 is passed to the function, what is the value returned to the  calling function.
 (((((((ANS=====   9)))))))))
[ans:don t remember the actual _expression.if the _expression is the
same the ans was nine]

5.     what is int (*ptr)[]()?


6.     Main()
{int a[]={0,2,4,6,8};
  int *ptr;
  ptr=a;
  printf( %d , *((char *) ptr+4));
}
find output
8     2     4     6          (((((( ANS====   4)))))))

7.     which takes the same memory space regardless of the type of
operating system?
Char*    char    int    float

 

8.     main()
{ int I=3;
  while(I–)
      {int I=100;
        I–;
        Printf( %d , I);
        }
}
find output.
100  99  98     99  98  97     99  99  99         error  ((((( ANS== 99  99 99)))
9.  main()
      {char ch;
        for(ch= 0 ;ch<=255;ch++)

             printf( %c , ch);
  }
  ((((((([ans : infinite loop))))))

10.        some program using variable b which was not initialized so
                              ((((ans error))))

 

InterviewIn the interview, they asked about Stacks, Queues, Linked lists, Binary Trees. Few questions I remember are:

1) If u have a linked list library, how do u design stack and queue using it; write pseudocode.

2) What are static variables and functions?

3) Write code in C to count the number of 1s in a character (1byte).

4) What is pre-order, post-order, in-order; write code to print post-order.

5) Can u construct a binary tree given its in order and postorder details. Is it necessary or sufficient to construct tree. Asked an example to do in both ways.

6) If recursion is not used to print post order, what other data structure u use
(ans: Stack).
7)Can u use stack always in place of recursion?
(ans: Yes)
What are meta characters?

9) Write a piece of code to insert a node in a linked list.

10) About malloc.

11) About Operating System – Semaphores

12) About Computability (eg:- finding infinite loop),Complexity of algorithms

13) What does compiler and assembler do?

14)They asked grep command in Linux. How do u search ‘n’, using grep, in a file.

15)They may ask some other commands if u say u r familiar and recently been using linux.

16)About Networks? OSI reference model.

17)what does transport layer do?

18)TCP belongs to which layer?

19)IP belongs to which layer?

20)Where is error correction done?

21)What is a connection oriented/ connection less transmission?

22)What is meant by reliable transmission protocol? why is it called so?

23)What is flow control and where it is done?

24)About ur project?
Asked me expalin about the project in brief.
If u don’t know anything, say it sincerely. U cannot bluff them. I too spoke to them sincerely.
They were cool. U need not get tensed. They won’t attack you. Just they want to know ur hold about the subject. They has conducted Two tests.One test is
.For CSE Students the subjects are Automata Theory Formal Languages,Data stcures,Discrete Mathematics,Operating System,Digital Logic Design,Computer Organisation,
Micro Processer and Computer Networks.

C Test
1.
What is the output of the Program?
main()
{
int a[10]={1,2,3,4,5,6,7,8,9,10};
int *p=a;
int *q=&a[9];
printf(“%d”,q-p+1);
}
Ans: 10

2.
main()
{
int i=6;
int *p=&i;
free(p);
printf(“%d”,i);
}
Options:
a. No Error.
b. Free can’t be used for p,
c. Compiler Error.
d. In printf we should use *p instead of i.
Ans: A

3.
What is the output of the Program?
main()
{
int i=5;
i=!i>3;
printf(“%d”,i);
}
Ans: 0

4.
What is the output of the Program?
main()
{
int a[10];
3[a]=10;
printf(“%d”,*(a+3));
}
Ans: 10

5.
int (*p[10]) ();
In above declaration what type of variable is P?
Ans: P is array of pointers that each points to  a function that takes no arguments and returns
an int.

6.
What is the output of the Program?
struct emp
{
int a=25;
char b[20]=”tgk”;
};
main
{
emp e;
e.a=2;
strcpy(e.b,”tellapalli”);
printf(“%d %s”,e.a,e.b);
}
Ans: Compile Error.

7.
What is the output of the Program?
main()
{
int a=5;
const int *p=&a;
*p=200;
printf(“%d”,*p);
}Ans: Compile Error.

8.
What is the output of the Program?
#define SQ(x) x*x
main()
{
int a=SQ(2+1);
printf(“%d”,a);
}
Ans: 5.

9.
What is the output of the Program?
main()
{
struct t
{
int i;
}a,*p=&a;
p->i=10;
printf(“%d”,(*p).i);
}
Ans: 10

10.
This program will be Compiled? [Yes/No]
zzz.c file
———-
/* This is zzz.c file*/
/*printf(“tellapalli”);*/
abc.c file
———-
main()
{
#include”zzz.c”
printf(“Tellapalli”);
}
Ans: Yes

COMP SC.
1. IN BINARY TREE IF PARENT HAS INDEX i then its left and right child
occurs at:
ans (a) 2i and 2i+1

2. 1 prog is given n scope is asked
ans (b) static scope (probably)

3. complete graph has
ans (b) n vertices and n(n-1)/2 edges

4. page fault is said 2 occur when:

5. choices r given probably (c)

6. probability that a frame is recieved with an error is P in a  system.  probability that the first frame to b recieved with an error is after  the first N frame is
(a) (1-P)*(p raised to power N)
(b) [(1-P) raised to power (N-1)]
(c) p raised to power N
(d) combination of N taken P at a time6. statistical time division multiplexing provides:
(a) statistics of tdm signal
(b) provision to multiplex analog signal
(c) improved time sharing efficiency
(d) static routing b/w nodes
ans (b) check

7. main advantage of AMI coding is
(a) easy clock recovery
(b) easy carrier recovery
(c) reduced bandwidth req
(d) reduced error rate

8. recursive-descent parser is a
(a) top-down parser
(b) bottom-up parser
(c) shift-reduce parser
(d) LR parser

9. min. no. of NAND gates reqd to implement a 2 i/p x-nor gate
(a) 2
(b) 3
(c) 4
(d) 5

10. mandatory feature of a real time OS is:
(a) priority based preemptive scheduling
(b) high time slicing granularity
(c) run to completion
(d) none of the above
These are the Queston asked in the sasken wirtten held on 19th at 3.00 p.m batch.
The Question paper is of three sections
i ) c (most of the questions) and c++;
ii) Apptitude (R.S agarwal)
iii)basic commputer

Each section has 10 questions and the way they aorganised was good and timely.
c and c++;

1. char buffer[]=”susan”;
a) individual characters can be changed.
b) buffer[7] is not accesible.
c)none of the above.
which of the above is TRUE;
ans : a)

2.#include<stdio.h>
#include<conio.h>
void main()
{
int ctr=0;
clrscr();
switch(ctr)
{
case 0:
ctr++;
case 1:
ctr++;
default :
ctr++;
};
printf(“%d”,ctr);
getch();
}

What is the output of the code.
i) ctr=2;
ii) ctr=3;
iii) ctr=1;
iv) compiler error;
Ans : iii) 3.#include<stdio.h>
#include<conio.h>
void main()
{
void fun(int,int);
int i ,j;
i=2,j=3;
fun(i++,j++);
printf(“%d%d”,i,j);
getch();
}
void fun(int i,int j)
{
i++,j++;
}
Question : what is the output ?
i)i=2,j=3;
ii)i=3,j=4;
iii)i=5,j=6;
iv) compiler error.
Ans : ii) 4)
#include<stdio.h>
#include<conio.h>
void main()
{
int a[20];
clrscr();
*a=(int*)malloc(sizeof(a));
printf(“%d”,sizeof(a));
getch();
}5)
#include<stdio.h>
#include<conio.h>
void main()
{
char *s=”susan”;
clrscr();
printf(s);
getch();
}
i) compiler error;
ii) s;
iii) susan;
iv) 5;
Ans: iii)
6)
i) const * int p;
ii) int const *p;
iii) const int *p;

Question : which of the following is same.
a)i) and ii)
b)i),ii) and iii)
c)ii) and iii)
d)none of the above.
i) (*ptr)++;
ii) *ptr+=1;
iii) *ptr++;

Question: which of the folowing is same.
a)i) and ii)
b)i),ii) and iii)
c)ii) and iii)
d)none of the above.

a)for(int i=0; i<50 ;i++)
for( int j=0; j<100; j++)
a[i][j]=100;
b)for(int i=0; i<100 ;i++)
for( int j=0; j<50; j++)
a[j][i]=100;
Question : Which of the above 2 codes executes quickly.
i) a) is faster than b)
ii) b) is fater than a)
iii) both a) and b) executes for same time.
iv) depends upon the compiler and the hardware used.
Ans: ” I think iii)” (check it out)
fun( int x, int y)
{
x =3;
y =2;
}
main()
{
int i;
fun( i,i);
printf(“%d”,i);
}
Question :if the value is 2 then the calling mechanism is
a. Call by name
b. Call by refernce
c. Call by value
ans : call by reference
1.Consider the following declaration:-char const *p = ‘d’;
Which of the following is not a permissible operation
(a) *p++
(b) ++p
(c) (*p)++
(d) All
2.What is the output of the following code:-
void print_arr(float **p)
{
printf(” 0 %f 1 %f 2 %fn”,p[0][0],p[0][1],p[0][2]);
}
void main()
{
float arr[2][3] = {{0,1,2},{3,4,5}};
float **fl_arr;
fl_arr = (float *)arr;
print_arr(fl_arr);
fl_arr++;
print_arr(fl_arr);
}
(a)
(d)segmentation fault
3.What is the output of the following code:-
#define putchar (c) printf(“%c”,c)
void main()
{
char s=’c';
putchar (s);
}
(a) c
(b) 99
(c) Compilation error
(d) Execution error

4.What is the output of the following code:-
void main()
{
printf(“%d”,printf(“ABC\”));
}
(a) ABC\
(b) 1
(c) ABC4
(d) ABC3

5.What is the output of the following code:-
int compute(int n)
{
if(n>0)
{
n=compute(n-3)+compute(n-1);
return(n);
}
return(1);
}
void main()
{
printf(“%d”,compute(5));
}
(a) 6
(b) 9
(c) 12
(d) 13
6.What is the output of the following code:-
void main()
{
int i;
for(i=0;i<3;i++)
{
int i=100;
i–;
printf(“%d..”,i);
}
}
(a0..1..2..
(b)99..98..97..
(c)100..100..100..
(d)99..99..99..
7.What is the output of the following code:-
void main()
{
int a[]={9,4,1,7,5};
int *p;
p=&a[3];
printf(“%d”,p[-1]);
}
(a)6
(b)1
(c)7
(d)Error
8.What is the output of the following code:-
void main()
{
int a[]={10,20,30,40,50};
int *p;
p= (int*)((char *)a + sizeof(int));
printf(“%d”,*p);
}
(a)10
(b)20
(c)30
(d)40

9.Which code will run faster
for(i=0;i<100;i++)
for(j=0;j<10;j++)
a[i][j]=0;
OR
for(j=0;j<10;j++)
for(i=0;i<100;i++)
a[i][j]=0;
(a)First code
(b)Second code
(c)Same
(d)Compiler and hardware dependent
.Consider the following declaration:-char const *p = ‘d’;
Which of the following is not a permissible operation
(a) *p++
(b) ++p
(c) (*p)++
(d) All

2.What is the output of the following code:-
void print_arr(float **p)
{
printf(” 0 %f 1 %f 2 %fn”,p[0][0],p[0][1],p[0][2]);
}
void main()
{
float arr[2][3] = {{0,1,2},{3,4,5}};
float **fl_arr;
fl_arr = (float *)arr;
print_arr(fl_arr);
fl_arr++;
print_arr(fl_arr);
}
(a)
(d)segmentation fault

3.What is the output of the following code:-
#define putchar (c) printf(“%c”,c)
void main()
{
char s=’c';
putchar (s);
}
(a) c
(b) 99
(c) Compilation error
(d) Execution error
4.What is the output of the following code:-
void main()
{
printf(“%d”,printf(“ABC\”));
}
(a) ABC\
(b) 1
(c) ABC4
(d) ABC3

5.What is the output of the following code:-
int compute(int n)
{
if(n>0)
{
n=compute(n-3)+compute(n-1);
return(n);
}
return(1);
}
void main()
{
printf(“%d”,compute(5));
}
(a) 6
(b) 9
(c) 12
(d) 13
6.What is the output of the following code:-
void main()
{
int i;
for(i=0;i<3;i++)
{
int i=100;
i–;
printf(“%d..”,i);
}
}
(a0..1..2..
(b)99..98..97..
(c)100..100..100..
(d)99..99..99..
7.What is the output of the following code:-
void main()
{
int a[]={9,4,1,7,5};
int *p;
p=&a[3];
printf(“%d”,p[-1]);
}
(a)6
(b)1
(c)7
(d)Error

8.What is the output of the following code:-
void main()
{
int a[]={10,20,30,40,50};
int *p;
p= (int*)((char *)a + sizeof(int));
printf(“%d”,*p);
}
(a)10
(b)20
(c)30
(d)40

9.Which code will run faster
for(i=0;i<100;i++)
for(j=0;j<10;j++)
a[i][j]=0;
OR
for(j=0;j<10;j++)
for(i=0;i<100;i++)
a[i][j]=0;
(a)First code
(b)Second code
(c)Same
(d)Compiler and hardware dependent

 

feedback