C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
Theoritical questions of function of c programming
Function:
Function is block of program. When any program is very long then we try to cut the program in different parts( or blocks) so that whole program is more understandable and easier to debug (error checking).This part of program is called function. It is also useful when set of program uses many times in the program then instead of writing whole program in many time we only call the function.
There are two type of function.
(1) Library function (Predefined function)
(2) User defined function
Syntax:
Return_type Function_name ( Parmeter1,parametre2,parameter3,…..)
{
Statement 1;
Statement 2;
……………
……………
……………
return < expression>
}
Fuction_name: It can be any valid identifier like India,sum,_world etc.
Return_type: In can be any valid data type like int,char,float ,void etc (default int)
Returnt type is required when you want function should return any value and if you don’t want that function return any value then write void as a return type.
Parameter list: It is set of value which you want to give the function and they are seprated by comma. (default void)
Simple example :
int sum (int,int) //function declaration
void main()
{
int p;
p=sum(3,4); //function call
printf(“%d”,sum);
}
int sum( int a,int b) //function definition
{
int s; //function body
s=a+b;
return s; //function returning value
}
Output 7
Since definition of sum function is written by some user. So it is called user defined function. This function can calculate the sum of any two integers. You are also using printf() function but you are not writing definition of printf() function because printf is predefined function. Your TURBO C know about printf function but he doesn’t know about your sum () function;
How to make user defined function as library function:
How to make user defined function as library function:
Step:1
(3) Different type of function ?
Ans:
(a) Function with no parameter and not returning any value ?
Example:
void world1(); //function declaration
void world2(); //function declaration
char c='*';
int i,j;
void main()
{
char *msg="I KNOWN FUNCTION";
clrscr();
world1(); //function call
printf("%c%22s%7c",c,msg,c);
world2(); //function call
getch();
}
void world1() //function definition
{
int a=-1;
for(i=0;i<15;i++)
{
a++;
for(j=0;j<30;j++)
{
if(j>=(15-a) && j<(15+a))
{
printf(" ");
}
else
{
printf("%c",c);
}
}
printf("\n");
}
}
void world2() //function definition
{
int a=-1;
for(i=0;i<16;i++)
{
a++;
for(j=30;j>0;j--)
{
if(j>a && j<=(30-a))
{
printf(" ");
}
else
{
printf("%c",c);
}
}
printf("\n");
}
}
Output:
(b)Function has parameter but not returning any value :
void swap(int,int);
void main()
{
int a=10,b=15;
clrscr();
printf("Befor swap a=%d ,b=%d",a,b);
swap(a,b);
printf("\nAfter swap a=%d ,b=%d",a,b);
getch();
}
void swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
}
Output:
Before swap a=10,b=15
After swap a=10,b=20
Explanation: a and b are auto variable (default storage class is auto) .Here its scope is only within main function.After the main function both a and b will die.We are swaping outside the main function so value of a and b is not changing.
(b) Function with parameter and returning a value.
void main()
{
int a=1,b=5,c;
clrscr();
c=operation(a,b);
printf("%d",c);
getch();
}
int operation(int a,int b)
{
int c;
c=++a * ++a * b++;
return c;
}
Output: 45
Note. Any function can return only one value at a time. If return type is int then there is not necessity of function declaration.
(4) What is Ellipsis(…)?
Ans: Ellipsis is there consecutive period (.) with no white space. With the help of ellipsis we can write a function of variable number of parameter.
Example:
int number(int a,...)
{
return a;
}
void main() {
int i;
i=number(5,4,3,2,1);
clrscr();
printf("%d",i);
getch();
}
Output: 5
In header file stdarg.h has three macro va_arg,va_end,va_start ,with help of this macro we can know other parameter of a function of variable number of parameter.
Syntax:
void va_start (va_list ap,lastfix)
type va_arg(va_list ap,type)
void va_end(va_list ap);
va_list is data .
lastfix is a last fixed parameter used in a function of variable parameter.
type is used to know which data type are using in function of variable parameter .
va_arg always return next parameter from right to left.
va_start set the pointer ap to the first parameter from right side of a function of variable parameter.
va_end help in the normal return.
Example.
#include
#include
void sum(char *msg, ...)
{
int total = 0;
va_list p;
int arg;
va_start(p, msg);
while ((arg = va_arg(p,int)) != 0) {
total += arg;
}
printf(msg, total);
va_end(p);
}
void main() {
sum("The total sum is %d\n", 5,7,11,8);
getch();
}
Output: 31
(3) What is main?
Ans:
main is user defined function because main is defined by user but it is different from other user defined function. Every c program starts from main function and end at the null statement. In any program there must be only one main function otherwise operating system will not able to decide from which main program should start. Main function has three parameter
1. Argument counter
2. Argument vector
3. Environment vector
(For more detail go to the link “Advance c” and read command line argument)
Parameter passing convention:
There are two convention for parameter passing :
(1) Pascal style
(2) C style (by default we are use this style)
Pascal style: In this style function name should (not necessary ) in uppercase .First parameter of function call is passed to the first parameter of function definition and so on.
For this we use keyword pascal.
Syntax:
Pascal
C style: In this style function name can be both case. First parameter of function
call is passed to the last parameter of function definition. For this we have keyword cdecl.
Syntax:
cdecl
Example:
void main()
{
static int a=25;
void cdecl conv1() ;
void pascal conv2();
conv1(a);
conv2(a);
getch();
}
void cdecl conv1(int a,int b)
{
printf("%d %d",a,b);
}
void pascal conv2(int a,int b)
{
printf("\n%d %d",a,b);
}
Output:
25 0
0 25
Function recursion :
Theoritical questions of c programming
Necessary fundamental knowledge before actual start of C Programming Language.
(1)List the five c compiler?
Ans:
Name Work on O.S Name of microprocessor
1. Turbo c M.S DOS 8086
2. Ansic c LINUX/UNIX 80386
3. Borland c WINDOW 80386
4. Microsoft c M.S DOS 8086
5. Visual c++ WINDOW 80386
Note:- 8086 is 16 bit microprocessor while 80386 is 32 bit microprocessor.
(2) Describe turbo c compiler?
Ans:
Turbo c compiler is one of the most popular c compiler.It is based on DOS operating system.It uses 8086 microprocessor which is 16 bit microprocessor. It has 20 address buses
and 16 data bus. It’s word length is two byte.
(3) What is hexadecimal number system ?
Ans:
In hexadecimal number system we use 16 differen digit so it’s base is 16
TABLE
Hexadecimal digit decimal equivalent binary equivalent
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
To convert the binary number into hexadecimal number:
Make the group of four binary digit from right to left put the equivalent hexadecimal digit using TABLE.
e.g binary number =11000111110101
group of four digit from right 11 0001 1111 0101
to make group of four digit of left most digit 11,add two zero to the leftt side i.e 0011
now put the eqivalent hexadecimal digit form table
0011 0001 1111 0101
3 1 F 5
So,equivalent hexadecimal number will be 31F5
(4) What will address range which can repersent in 20 bit ?
Ans:
in binary in hexadecimal
Minimum possible number 0000 0000 0000 0000 0000 0000
Maximum possible number 1111 1111 1111 1111 1111 FFFF
In c any hexadecimal number statr with 0x 0r 0X
So,address range will be 0x0000 to 0xFFFF
It is 1MB memory range.
Note.
2^10 = 1KB
2^20 = 1MB
2^30 = 1GB
Where 10,20,30 are number of bit.
(5)What is difference betweent TSR and TSO program?
Ans :-
TSO means terminate but stay outside.It is those program, which release the main memory after the executon of the program.e.g Vcd cutter, turbo c compiler.
TSR means terminate but stay residence .It is those program, which after the execution of the program does not release the RAM (main memory).e.g antivirus.
(1) Why there are so many c compilers?
Ans:
(3)How many keywords are in c?
Ans:
43
(6)What is difference between .com program and .exe program?
Ans:
Both .com and .exe program are executable program but .com program execute faster than .exe program.All driver are .com program.
(2) How many type of error in c.
Ans:
183
Memory orgnization
To be a good programmer is very necessay to understand the memory structure.
(1) What is memory cell?
Ans:

Entire RAM has divided in number of equal part, which is known as memory cell.Capcity of each cell is to store one-byte data.
i.e char a resevre one memory cell while float a reseve four memory cell.
Each memory cell has unique addresss.Address are always in whole number an incresing order.
(6) What is residence memory?
Ans:

RAM has divided into two parts:
(1) Extended memory (useless)
(2) Residence memory :
When any program is excuted it is stored in the residence memory .For turbo c, it has 1MB residence memory i.e when we open turbo c it store 1MB in the RAM.
(3) What is physical address ?
Ans:
20 bit address of the memory cell is known as physical address or real address.In 20 bit we can repersent address from 0x00000 to 0xFFFFF.


(4) What is segmentation?
Ans:

Residential memory of RAM of size 1MB has divided into 16 equal part.These part is called segment.Each segment has size is 64KB.
1MB=16*64KB
This process of division is known as segmentation.
(5) What is necesity of segmentation?
Ans:
Physical address are 20 bit.But we have no pointer of 20 bit.So pointer can not access whole residential address .So to solve this problem we have three different pointer and segmentation has done.
(6) What is offset address?
Ans:
Each segment has divided into two parts.
1. Segment no (4bit)
2. Offset address (16 bit)
Each segment has same offset address but different segment number.
Suppose physical address is 0x500F1
Then it’s segment number is 5 and offset address is 00F1.
(7) Write a program to find the offset address of any variable?
Ans:
Void main ()
{
int x;
scanf(“%d”,&x);
printf(“%p”,x);
}
Note. %p is used to find the offset address (in hexadecimal) of any variable.
(8) What is data segment?
Ans:
Segment number 8 has special name which is known as data segment.
It has divided into four parts.

1. Stack area:-
All automatic variables are created into stack area.Default storage class of any local variable is auto.This variable may be int, char, float, array, pointer, struct, union etc.It also return fuction argument and return address.It follow LIFO datastructure. It has two part one for initialize variable another for non-initialize variable.All initialize variable are more nearer than unintialize variable and vice versa.
2. Data area :
All static and extern variable are created in the data area.
3. Heap area:
Malloc and calloc always allocate memory in the heap area.It is used for dynamic memory allocation.It’s size depends upon free space in the memory.
4. Code area:
Fuction pointer can only access code area.Size of this area is always fixed and it is read only area.
(10) What will output:
void main()
{
int a=5,b=6,c=7;
printf(“%d,%d,%d”);
}
Ans:
Output: 7 6 5
Explanation:
Default sotrage class int a=5 is auto.Since it automatic variable it will create in the stack area.
It will store in the stack as
Stack always follows LIFO datastructure.
In the printf statement name of variable is not written explicitly.So default output will content of
Stack which will be in the LIFO order i.e 7 6 5.
(9) what will be output:
void main()
{
int a=5 ,b,c=7;
printf(“%d %d %d”);
}
Ans:
Output: 7 5 garbage value
Explanation:
Automatic variable a and c has initialized while b has not initilize.Initialize variable are more nearer than non initialize variable .They will be stored in the stack.So due to LIFO first output will be 7 then 6 (since a is more nearer than b with respect to c) then any garbage value will be output which is persent in the stack.
(7) How many number system in c.
Ans:
There are three type of number system in c:
1. Decimal number e.g 25
2. Octal number e.g 025
3. Hexadecimal number e.g 0x25
(8) 010110 is which type of number in c?
Ans:
Octal integer constant (Since it starts with zero)
Note. C has not binary integer constant.
(1)List the five c compiler?
Ans:
Name Work on O.S Name of microprocessor
1. Turbo c M.S DOS 8086
2. Ansic c LINUX/UNIX 80386
3. Borland c WINDOW 80386
4. Microsoft c M.S DOS 8086
5. Visual c++ WINDOW 80386
Note:- 8086 is 16 bit microprocessor while 80386 is 32 bit microprocessor.
(2) Describe turbo c compiler?
Ans:
Turbo c compiler is one of the most popular c compiler.It is based on DOS operating system.It uses 8086 microprocessor which is 16 bit microprocessor. It has 20 address buses
and 16 data bus. It’s word length is two byte.
(3) What is hexadecimal number system ?
Ans:
In hexadecimal number system we use 16 differen digit so it’s base is 16
TABLE
Hexadecimal digit decimal equivalent binary equivalent
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111
To convert the binary number into hexadecimal number:
Make the group of four binary digit from right to left put the equivalent hexadecimal digit using TABLE.
e.g binary number =11000111110101
group of four digit from right 11 0001 1111 0101
to make group of four digit of left most digit 11,add two zero to the leftt side i.e 0011
now put the eqivalent hexadecimal digit form table
0011 0001 1111 0101
3 1 F 5
So,equivalent hexadecimal number will be 31F5
(4) What will address range which can repersent in 20 bit ?
Ans:
in binary in hexadecimal
Minimum possible number 0000 0000 0000 0000 0000 0000
Maximum possible number 1111 1111 1111 1111 1111 FFFF
In c any hexadecimal number statr with 0x 0r 0X
So,address range will be 0x0000 to 0xFFFF
It is 1MB memory range.
Note.
2^10 = 1KB
2^20 = 1MB
2^30 = 1GB
Where 10,20,30 are number of bit.
(5)What is difference betweent TSR and TSO program?
Ans :-
TSO means terminate but stay outside.It is those program, which release the main memory after the executon of the program.e.g Vcd cutter, turbo c compiler.
TSR means terminate but stay residence .It is those program, which after the execution of the program does not release the RAM (main memory).e.g antivirus.
(1) Why there are so many c compilers?
Ans:
(3)How many keywords are in c?
Ans:
43
(6)What is difference between .com program and .exe program?
Ans:
Both .com and .exe program are executable program but .com program execute faster than .exe program.All driver are .com program.
(2) How many type of error in c.
Ans:
183
Memory orgnization
To be a good programmer is very necessay to understand the memory structure.
(1) What is memory cell?
Ans:

Entire RAM has divided in number of equal part, which is known as memory cell.Capcity of each cell is to store one-byte data.
i.e char a resevre one memory cell while float a reseve four memory cell.
Each memory cell has unique addresss.Address are always in whole number an incresing order.
(6) What is residence memory?
Ans:

RAM has divided into two parts:
(1) Extended memory (useless)
(2) Residence memory :
When any program is excuted it is stored in the residence memory .For turbo c, it has 1MB residence memory i.e when we open turbo c it store 1MB in the RAM.
(3) What is physical address ?
Ans:
20 bit address of the memory cell is known as physical address or real address.In 20 bit we can repersent address from 0x00000 to 0xFFFFF.


(4) What is segmentation?
Ans:

Residential memory of RAM of size 1MB has divided into 16 equal part.These part is called segment.Each segment has size is 64KB.
1MB=16*64KB
This process of division is known as segmentation.
(5) What is necesity of segmentation?
Ans:
Physical address are 20 bit.But we have no pointer of 20 bit.So pointer can not access whole residential address .So to solve this problem we have three different pointer and segmentation has done.
(6) What is offset address?
Ans:
Each segment has divided into two parts.
1. Segment no (4bit)
2. Offset address (16 bit)
Each segment has same offset address but different segment number.
Suppose physical address is 0x500F1
Then it’s segment number is 5 and offset address is 00F1.
(7) Write a program to find the offset address of any variable?
Ans:
Void main ()
{
int x;
scanf(“%d”,&x);
printf(“%p”,x);
}
Note. %p is used to find the offset address (in hexadecimal) of any variable.
(8) What is data segment?
Ans:
Segment number 8 has special name which is known as data segment.
It has divided into four parts.

1. Stack area:-
All automatic variables are created into stack area.Default storage class of any local variable is auto.This variable may be int, char, float, array, pointer, struct, union etc.It also return fuction argument and return address.It follow LIFO datastructure. It has two part one for initialize variable another for non-initialize variable.All initialize variable are more nearer than unintialize variable and vice versa.
2. Data area :
All static and extern variable are created in the data area.
3. Heap area:
Malloc and calloc always allocate memory in the heap area.It is used for dynamic memory allocation.It’s size depends upon free space in the memory.
4. Code area:
Fuction pointer can only access code area.Size of this area is always fixed and it is read only area.
(10) What will output:
void main()
{
int a=5,b=6,c=7;
printf(“%d,%d,%d”);
}
Ans:
Output: 7 6 5
Explanation:

Default sotrage class int a=5 is auto.Since it automatic variable it will create in the stack area.
It will store in the stack as
Stack always follows LIFO datastructure.
In the printf statement name of variable is not written explicitly.So default output will content of
Stack which will be in the LIFO order i.e 7 6 5.
(9) what will be output:
void main()
{
int a=5 ,b,c=7;
printf(“%d %d %d”);
}
Ans:
Output: 7 5 garbage value
Explanation:
Automatic variable a and c has initialized while b has not initilize.Initialize variable are more nearer than non initialize variable .They will be stored in the stack.So due to LIFO first output will be 7 then 6 (since a is more nearer than b with respect to c) then any garbage value will be output which is persent in the stack.
(7) How many number system in c.
Ans:
There are three type of number system in c:
1. Decimal number e.g 25
2. Octal number e.g 025
3. Hexadecimal number e.g 0x25
(8) 010110 is which type of number in c?
Ans:
Octal integer constant (Since it starts with zero)
Note. C has not binary integer constant.
Memory related question of c programming
(1) What will output:
void main()
{
int a=5,b=6,c=7;
printf(“%d,%d,%d”);
}
Ans:
Output: 7 6 5
Explanation:
Default sotrage class int a=5 is auto.Since it automatic variable it will create in the stack area.
It will store in the stack as
Stack always follows LIFO datastructure.
In the printf statement name of variable is not written explicitly.So default output will content of
Stack which will be in the LIFO order i.e 7 6 5.
(memory map)
(2)
what will be output:
void main()
{
int a=5 ,b,c=7;
printf(“%d %d %d”);
}
Ans:
Output: 7 5 garbage value
Explanation:
Automatic variable a and c has initialized while b has not initilize.Initialize variable are more nearer than non initialize variable .They will be stored in the stack.So due to LIFO first output will be 7 then 6 (since a is more nearer than b with respect to c) then any garbage value will be output which is persent in the stack.
(memory map)
(3)What will output :
Void main()
{
int * p,b;
b=sizeof(p);
printf(“%d”,b);
}
Ans:
Output: 2 or 4
Explanation:
Since in this question it has not written p is which type pointer. So it’s output will depends upon which memory model has selected. Default memory model is small.
More detail click here(pointer c)
(4)
What will be output ?
void main()
{
int huge *a=(int huge *)0x59990005;
int huge *b=(int huge *)0x59980015;
if(a==b)
printf("power of pointer");
else
printf("power of c");
getch();
}
Output: power of pointer
Explanation:
Here we are performing relational operation between two huge address. So first both a and b will normalize.
a=(0x5999)* (0x10)+(0x0005)=0x9990+0x0005=0x9995
b=(0x5998)* (0x10)+(0x0015)=0x9980+0x0015=0x9995
Here both huge address is representing same physical address. So a==b is true.
(Huge pointer)
(5)
#include
#include
void main()
{
int (*ptr1)();
int (*ptr2)();
void (*ptr3)();
ptr1=puts;
ptr2=getch;
ptr3=clrscr;
(*ptr3)();
(*ptr1)("POWER OF POINTER");
(*ptr2)();
Output: POWER OF POINTER
Example 2.
char *arr [3];
Ans :
arr is array of size 3 which contain address of char
program:
void main()
{
char *arr[3];
char a=1,b=2,c=3;
arr[0]=&a;
arr[1]=&b;
arr[2]=&c;
clrscr();
printf("%u %u",&b,arr[1]);
printf("\n%d",*arr[2]);
getch();
}
Output :
any addresss same address
3
Example 3
char (*ptr)[5];
Ans:
ptr is pointer to array of size 5 which contain char data type.
Program:
#include
#include
void main()
{
char arr[5]={1,2,3,4,5};
char (*ptr)[5];
ptr=&arr;
ptr=(*ptr)+2;
clrscr();
printf("%d",**ptr);
getch();
}
Output: 3
Example 4
unsigned long int ( * avg ())[ 3]
Program:
Ans:
avg is such function which return type is address of array of size of 3 which contain unsigned long int data type.
Program:
#include
#include
unsigned long int (* avg())[3]
{
static unsigned long int arr[3]={1,2,3};
return &arr;
}
void main()
{
unsigned long int (*ptr)[3];
ptr=avg();
clrscr();
printf("%d",*(*ptr+2));
getch();
}
Output :3
c++ question with solution and explanation
C,C++ Questions
1. Base class has some virtual method and derived class has a method with the same name. If we initialize the base class pointer with derived
object,. calling of that virtual method will result in which method being called?
a. Base method
b. Derived method..
Ans. b
2. For the following C program
#define AREA(x)(3.14*x*x)
main()
{float r1=6.25,r2=2.5,a;
a=AREA(r1);
printf("\n Area of the circle is %f", a);
a=AREA(r2);
printf("\n Area of the circle is %f", a);
}
What is the output?
Ans. Area of the circle is 122.656250
Area of the circle is 19.625000
3. What do the following statements indicate. Explain.
• int(*p)[10]
• int*f()
• int(*pf)()
• int*p[10]
Refer to:
-- Kernighan & Ritchie page no. 122
-- Schaum series page no. 323
4.
void main()
{
int d=5;
printf("%f",d);
}
Ans: Undefined
5.
void main()
{
int i;
for(i=1;i<4,i++)
switch(i)
case 1: printf("%d",i);break;
{
case 2:printf("%d",i);break;
case 3:printf("%d",i);break;
}
switch(i) case 4:printf("%d",i);
}
Ans: 1,2,3,4
6.
void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}
Ans: 6
7.
void main()
{
unsigned i=1; /* unsigned char k= -1 => k=255; */
signed j=-1; /* char k= -1 => k=65535 */
/* unsigned or signed int k= -1 =>k=65535 */
if(ij)
printf("greater");
else
if(i==j)
printf("equal");
}
Ans: less
8.
void main()
{
float j;
j=1000*1000;
printf("%f",j);
}
1. 1000000
2. Overflow
3. Error
4. None
Ans: 4
9. How do you declare an array of N pointers to functions returning
pointers to functions returning pointers to characters?
Ans: The first part of this question can be answered in at least
three ways:
1. char *(*(*a[N])())();
2. Build the declaration up incrementally, using typedefs:
typedef char *pc; /* pointer to char */
typedef pc fpc(); /* function returning pointer to char */
typedef fpc *pfpc; /* pointer to above */
typedef pfpc fpfpc(); /* function returning... */
typedef fpfpc *pfpfpc; /* pointer to... */
pfpfpc a[N]; /* array of... */
3. Use the cdecl program, which turns English into C and vice
versa:
cdecl> declare a as array of pointer to function returning
pointer to function returning pointer to char
char *(*(*a[])())()
cdecl can also explain complicated declarations, help with
casts, and indicate which set of parentheses the arguments
go in (for complicated function definitions, like the one
above).
Any good book on C should explain how to read these complicated
C declarations "inside out" to understand them ("declaration
mimics use").
The pointer-to-function declarations in the examples above have
not included parameter type information. When the parameters
have complicated types, declarations can *really* get messy.
(Modern versions of cdecl can help here, too.)
10. A structure pointer is defined of the type time . With 3 fields min,sec hours having pointers to intergers.
Write the way to initialize the 2nd element to 10.
11. In the above question an array of pointers is declared.
Write the statement to initialize the 3rd element of the 2 element to 10;
12.
int f()
void main()
{
f(1);
f(1,2);
f(1,2,3);
}
f(int i,int j,int k)
{
printf("%d %d %d",i,j,k);
}
What are the number of syntax errors in the above?
Ans: None.
13.
void main()
{
int i=7;
printf("%d",i++*i++);
}
Ans: 56
14.
#define one 0
#ifdef one
printf("one is defined ");
#ifndef one
printf("one is not defined ");
Ans: "one is defined"
15.
void main()
{
int count=10,*temp,sum=0;
temp=&count;
*temp=20;
temp=∑
*temp=count;
printf("%d %d %d ",count,*temp,sum);
}
Ans: 20 20 20
16. There was question in c working only on unix machine with pattern matching.
14. what is alloca()
Ans : It allocates and frees memory after use/after getting out of scope
17.
main()
{
static i=3;
printf("%d",i--);
return i>0 ? main():0;
}
Ans: 321
18.
char *foo()
{
char result[100]);
strcpy(result,"anything is good");
return(result);
}
void main()
{
char *j;
j=foo()
printf("%s",j);
}
Ans: anything is good.
19.
void main()
{
char *s[]={ "dharma","hewlett-packard","siemens","ibm"};
char **p;
p=s;
printf("%s",++*p);
printf("%s",*p++);
printf("%s",++*p);
}
Ans: "harma" (p->add(dharma) && (*p)->harma)
"harma" (after printing, p->add(hewlett-packard) &&(*p)->harma)
"ewlett-packard"
20. Output of the following program is
main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error
Ans. (d)
21. What is the ouptut in the following program
main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c>2);
}
Ans. 5 20 1
28 Find the output for the following C program
#define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
Ans. 10 5
29 Find the output for the following C program
main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Ans. Samco Systems
30 Find the output for the following C program
#include
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Ans. Compilation error giving it cannot be an modifiable 'lvalue'
31 Find the output for the following C program
#include
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}
Ans. RamcoSystems
32. Find the output for the following C program given that
[1]. The following variable is available in file1.c
static int average_float;
Ans. All the functions in the file1.c can access the variable
33. Find the output for the following C program
# define TRUE 0
some code
while(TRUE)
{
some code
}
Ans. This won't go into the loop as TRUE is defined as 0
34. struct list{
int x;
struct list *next;
}*head;
the struct head.x =100
Is the above assignment to pointer is correct or wrong ?
Ans. Wrong
35.What is the output of the following ?
int i;
i=1;
i=i+2*i++;
printf(%d,i);
Ans. 4
36. FILE *fp1,*fp2;
fp1=fopen("one","w")
fp2=fopen("one","w")
fputc('A',fp1)
fputc('B',fp2)
fclose(fp1)
fclose(fp2)
}
Find the Error, If Any?
Ans. no error. But It will over writes on same file.
37. What are the output(s) for the following ?
38. #include
char *f()
{char *s=malloc(8);
strcpy(s,"goodbye");
}
main()
{
char *f();
printf("%c",*f()='A'); }
39. #define MAN(x,y) (x)>(y)?(x):(y)
{int i=10;
j=5;
k=0;
k=MAX(i++,++j);
printf(%d %d %d %d,i,j,k);
}
Ans. 10 5 0
40.
void main()
{
int i=7;
printf("%d",i++*i++);
}
Ans: 56
placement question of c programming
Off Campus Written Test conducted in 3 at BangaloreThe test comprises of 2 sections: 1. Technical ( C ) & Technical Subject- 60 mins, 60 questions 2. Logical Reasoning.. - 30 mins,17 questions....
==> Questions in C were mostly from "pointers in c" and "test ur C skills" by Yeshwant Kanetkar... C questions based on command line arguments, data structure ( BST, tree traversals). All the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c) compilation error and (d) compilation, warning, runtime error.... Heard they are asking abt- ptr, string, arr, preprocessor, data structures etc.. C test was pretty ok pass by value, pass by reference etc. questions were asked The general test was pretty tough, they ask u fourier transforms,harmonics,Barkhuasen criterion,virtual memory,Whether FIFO is better than LRU etc. 4 questions were from fourier transforms the duration was 60 mins and no negative marking
C basics 10 questions ,very easy.Given a program and asked the output-type questons.from pointers 3-4 questions are there. 2)reg subject:very very easy:some from digital(on nand gates. Jk flip flop),from Information theory and coding,some from Micro processors.
In Logical Reasoning all the 17 questions were paragraphs (argument) of 5 to 6 sentences...five sentences (choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." :- R. S. Agrawal LR is sufficient
SASKEN PAPER HELD ON 9th AUG at 2:30pm--------------------------------------------------------------
The questions were like this.------------------------------The text consists of two parts1) C test2) CSE01 TestDuration: 1hr--------------------------------------------------------------- 1) C test -10 questions- Some questions were as follows, remember only a few.a) What is the parameter passing mechanism to Macros Called?b) void func(int x,int y){x=3;y=2;} main(){int i;func(i,i);print(i);}If the output must be 2 what is the parameter passing mechanism called?c) which of the following code will swap the two numbers? -3 choices was givend) which of the following is illegal for the program?main(){char const *p='p';} 1)p++ 2) *p++ 3)(*p)++ 4) alle) what is the output of the following programvoid print(int ** arr){print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);}main(){int a[][]={ {1,2,3},{4,5,6}} int ** arr=a;print(arr);arr++;print(arr);}f) which of the following code swaps the two numbers.- 4 choices were giveng) if the string " this is a " is present in the code of a function such as 'void func(void)' where will the variable stored in the memory.a) in the stack b) heap c) code or text segment as per implementation d) created when func is called, stored in function stack space and destroyed as it goes out .
2) CSE01-15 questionsIn this section there was question from LD-gates, JK flip flop, sampling rate and few otherthen there was a few from OS - don't remember the questions.
INTERVIEW
In 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 inorder and postorder details. Is it neccessary 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)
8) 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?
They asked grep command in Linux. How do u search '\n', using grep, in a file.
They may ask some other commands if u say u r familiar and recently been using linux.
About Networks? OSI reference model.
what does transport layer do?
TCP belongs to which layer?
IP belongs to which layer?
Where is error correction done?
What is a connection oriented/ connection less transmission?
What is meant by reliable transmission protocol? why is it called so?
What is flow control and where it is done?
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.
Next Paper
NOTE : Answer May Not be Accurate So Get An Idea of Questions.
What is the value of X after this execution
x = 0;
begin
parbegin
y = x;
x = x+1;
parend
parbegin
z =x;
x = z+1;
parend
end
a:1
b:0
c:2
d:1 or 2
2. Comparision of LRU and FIFO
a. FIFO IS always better
b. FIFO is always worst
c. FIFO is sometimes better
d. NOthing can be said.
ANS :D
3. How many minimum no of NAND GATES ARE required for construction of X-OR gate
6 7 5 8
ANS : 5 (but the correct answer is 4 ) if 4 is present that is correct answer otherwise 5
4.
If each counter has time delay of 15 n sec. Then what is the max time to change the state of 4 bit
synchronus counter
a. 60
b.15
c. 120
d. none
ans : 15
5. There is ADC of freequency 1 MHz. How much time it will take to convert a message stream of 6 bit
ans : 6 Micro Sec
6.
What is Baukshna's criteria for sustaining freequency.
some fk is given that( Iam not clear)
fk > 1
fk <1
fk =0
none
7.
which of the following is wrong:
ans : WCW is a context free language.where w is word formed by sequence of alphabets.
8.
find odd man out
LISP -Functional language
PROLOG - logic programming
C - imperative
ans : c- imperative. Iam not sure ask ur brother.
Fourier analysis 4 questions.
C
How macros are called
a. Call by name
b. Call by refernce
c. Call by value
ans : call by name.
2. fun( int x, int y){
x =3;
y =2;
}
main(){
int i;
fun( i,i);
printf("%d",i);
}
if the value is 2 then the calling mechanism
a. Call by name
b. Call by refernce
c. Call by value
ans : call by reference
3.fun(int i){
static int j =0;
x = x+j; j++
return ;
}
main(){
int x = 2;
I had not remembered the question exactly. but the essence is J will retain the value between successive function calls.
4.
cout << 3 != 2 << 1;
Syntax error.
5.main(){
int z=10,x=6,y=7;
( z ? x:y) =8;
}
ans : the statement does nothing. all values are same.
6. "This is a sting.."
It is string in a function. Where it will be stored.
a. stack
b.global heap
c. Data ro text segment.
d. none
c. Data or Text segment
7. One question i doent remember that Double pointer is given
for that my answer is : Segmentation error
8.fun( int x, int y){
int temp;
temp =x;
x =y;
y = temp;
}
main(){
int i =3,j =4;
fun(i,j);
printf("%d,%d",i,j);
}
ans : 3 4 (that means the values doesnot change)
}
}
) C test -10 questions- Some questions were as follows
I remember only a few.
a) What is the parameter passing mechanism to Macros Called?
b) void func(int x,int y)
{
x=3;
y=2;
}
main()
{
int i;
func(i,i);
print(i);
}
If the output must be 2 what is the parameter passing mechanism called?
c) which of the following code will swap the two numbers? -3 choices was given
d) which of the following is illegal for the program?
main()
{
char const *p='p';
}
1)p++ 2) *p++ 3)(*p)++ 4) all
e) what is the output of the following program
void print(int ** arr)
{
print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);
}
main()
{
int a[][]={ {1,2,3},
{4,5,6}
}
int ** arr=a;
print(arr);
arr++;
print(arr);
}
f) which of the following code swapps the two,numbers.
- 4 choices were given
g) if the string " this is a " is present in the code of a function such as 'void func(void)' where
will the variable stored in the memory.
a) in the stack b) heap c) code or text segment as per implementation d) created when
func is called, stored in function stack space and destroyed as it goes out
SASKEN COMMUNICATION INDIA
There are 10 ques. in three sections each, thus total 30 ques. 4 choices were given. 1 mark for each ans. no negative marking.
1 if phase of different frequency components of signal vary linearly then they all reach destination with delay1) delay also vary linerly.2) no change in delay,3)
2 what is the relation in dbm and db?1) same2) dbm is 10 times db3) db is 10 times dbm4) db is relative measure and dbm is absolute measure.
3 difference in PSK and QPSK a. slower sample rateb. greater sample ratec. slower bit rated. greater bit rate.
4 what is the main problem with power line communicationa. high audio signal generationb. seperation of modulating and career signalc. (something) low pass filtering
5 a signal is to be transmitted 1000km long distance sending 10 mbps . if signal consists of 1000 bits/package and takes 5 microsecs. to transmit then how much data is to be send such that line gets fully filled.a. 100b. 500cd.1000
6 if a process is wide sense stationary then a. it's probability density function is also wssb. power spectral density is wssc. it's mean constant and auto correlation function depends only on time diff. t1-t2.d.
7 for intelligent sound signal transmission a. low pass filter of 1.8khz is to be used.b. hpf of 1.8khzc. d.
q.8 if a 32 bit number in fractional form is to be converted into float then it is multiplied witha. 2^31b. 1/(2^31 - 1)c. 2^31 -1d.
9 if signal is sampled at 8 khz and the signal of 1 khz is transmitted then
q.1 char const *p='p' then which of below is truea.**P = (this question u can get from freshersworld sample paper)
q.2 recursive function count(n){if count<=1then result = 1;else result = count(n-3) + count(n-1) }for count(6) ans is:a. 3b. 6 c. 9d. 12
q.3 for(i=0;i<=50;i++)for(j=0;j<=100;j++)
for(j=0;j<=100;j++)for(i=0;i<=50;i++) for this type of loop which one is fastera. sameb. firstc. second d. depends on s/w and h/w
4 #define putchar(%f,c)int c='d';putchar(c);what is the output?a. ,b. some numbersc. compiler error d. segmentation error
5 file atest(){ int a; }
file bvoid main(void){ int b;b= test();}what is the outputa. ab. bc. not compiled,errord. compiles sucessfully,but give linker error
q.1 if 2economics books then the ratio of economics to science to novell isa. 1:2:14b. 2:1:7c. 14:2:1d.e.
q.6 ira is taller than sam, harold is shorter than gene, elliot is taller than haroldsam and harold is of same height. thenwhich one is true.a.sam is shorter than harold b. elliot is taller than genec. ira is taller than elliotd. elliot is shorter than gene e. harold is shorter than ira
7 if a(n) is to be entered following the rule [ a(n)^2 - 1 ] then what r the next three enteries.a. 0,-1,0 b. 2,3,4c. 1,2,3d. 0,-1,2e. 0,-1,1
The test comprises of 2 sections:
1. Technical ( C ) & Technical Subject- 60 mins, 60 questions 2. Logical Reasoning.. - 30 mins,17 questions....
Sasken Placement Papers and Sample Papers
Next Page
APTITUDE1. 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 milesb) 10 miles 10 milesc) 6 miles 6 miles2. a person has certain number of cows and birds.they have 172 eyes and 344 legs.how many cows and birds does he have?3.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?
4.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
5.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?
6.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?
7.two peoples on cycles are traveling at 10 miles / hour.when they reach a distance of 50 miles, ahousefly 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?
8.my successor's father is my father's son. and i don't have any brothers or sons..who is my successor?a)nephewb)niecec)daughterd)myself
COMPUTER SCIENCE
1. which of these checks for structural errors of a languagea)lexical analyserb)parserc)intermediate coded)code optimisation
2. threads in the same process share the samea)data sectionb)stackc)registersd) thread id
3.the depth of a binary tree...a)nlogn(base 2)b) n*nc)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 4000a)130b)140c)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 preemptivefcfsround robinshortest 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 stackparenthesis matchinparsinglocal variables stored in runtimeall the above
9.which of the foll data structures can be randomly accessed givin loc1.linked kist implemented using array2.singly linked list3.double linked list4.both single and double linked list
APTITUDE1. The hours remaining in a day is one-fifth of the hours passed in the day. What is the time?2. My successor is my uncles only brothers son who is his only kid. (some what like this)3. 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,104. In a pet shop there are 120 eyes and 172 legs. How many birds and puppies are included in these?5. 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
C – SECTION1. 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=%d\n”,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 output8 2 4 6 (((((( ANS==== 4)))))))7. which takes the same memory space regardless of the type of operating system?Char* char int float8. 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))))
Sasken Exam 20th Jul 2004
Pattern : C(10 Qs) + Aptitude(10 Qs) + Discpline based[CS/EC](10 Qs)
Duration : 1 Hr
C questions------------
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 %f\n",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) ABC\4(d) ABC\3
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
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 = zThen(a)...(b)yComputer science----------------
1.Deadlock occur when(a)Some resources are held up by some process.(b)...(c)...(d)None of these
2. A prefix expression can be equal to a postfix expression reversed only if(a)It is left associative(b)It is commutative(c)It is right associative
3.How many lines will be printed in the followingPascal pgm [I don't remember the Pascal version,so I am giving C version]
void print(int n){if(n>0){print(n-1);printf("%d",n);//println(n) in Pascal version.print(n-1);}}(a)3(b)7(c)15(d)31
4.Maximum number of nodes in a tree with n levels.(a)2^(n-1)(b)(2^n)-1(c)2^(n-1) - 1
5.Complete graphwith n nodes have(a)n-1 edges(b)n(n-1)/2
6.If d is the degree of a node in a graph and n is number of vertices then number of edges in that graph is(a)Edi^n(b)0.25Edi(c)0.5Edi
7.A grammar was given and 4 strings was given and the one which was not possible was to be chosen.
8.A problem related to ethernet in which a station sending a frame is of p probablity.There are m stations to send pckts.4 option was given.It was a mathematical kind of question related to probablity.
9.Which of the following layer in the OSI model does error handling(a)Data link(b)Network(c)Transport(d) a & c
10.A network problem in which Data rate,Propagation delay,and distance was given and it was to find how many packets will be in the line. Choices where(a)5000(b)Not possible to find with given data(c)1000
A
Interview [For CS students]
---------There is Tech as well as HR interview. Tech interview is the important one.
Tech interview questions------------------------
They will ask about the project.They will ask general questions about it and most probably will not go intothe implementation part of it.So one must have a general idea about the project done.
Interview is mainly based on Data Structures.Somequestions are as follows:-- What is a tree,its application,order for insertion,deletion and traversal with worst case analysis.- What is a graph,its application.- Height of a tree- Balanced tree and how to balance a tree- Minimum Spanning Tree- Dijikstra's, Prim algorithms- Define a structure for a linked list.- Binary search and its analysis- Heap sort and its analysis- What is a heap and its application- Cache and its working- Memory(IO mapped)- Recursive fns and types, its adv and disadv.- Compiler(grammar)
*****C debugging questions like
(1)What is the problem with the following code
int * f(int a){int i;i=a;return(&i);}Ans-> We can't return address of auto variable as it is allocation is made in stack which is deallocatedwhen the function returns.
(2)a.h b.c c.c d.cint i=0 #include"a.h" #include"a.h" extern inti;void main{.....} b.o c.o d.o Compilation Phase
Linked to get exe. Will there be any problem in any phase.If yes then where and what? In linking phase as there will be multiple declarationof i.
*****You will be told to write some code like
(1)To find string length by using recursive function.(2)To find fibonaci series by using recursive function.(3)To write code for malloc so that allocation may be made fastly.(4)Write a fn prototype which return a pointer whichpoints to an array of 10 ints.
HR Interview------------
- Introduce yourself- Why should we take you- What you know about Sasken and etc.
Pattern
1) 60 questoins on CMainly qustions on Poniters in C - yashwant kanetkar C questions based on commnad line arguments data structure ( BST, tree traversals)2) Logical Reasoning - R. S. Agrawal LR is sufficienttest comprises of 2 sections, technical ( C ) and logical reasoning.. technical is for 60 mins, 60 questions...logical reasoning is for 30 mins,17 questions.... ..all the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c)compilation error and (d)compilation warning,runtime error.... in reasoning, all the 17 questions were paragraphs(arguement) of 5 to 6 sentences...five sentences(choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." think u got an idea after this.. .but they clearly mentioned after the test that they will be selecting 7 or 8 people out of 124 attended for the test on that day.......
Sasken Test
1)C test2)Aptitude3)technical
1)const char *p='c';which not allowed 1)p++ 2)*p++ 3) (*p)++4)all
2)#define putchar(c) printf("%c",c);
int c=69;putchar(c);
3) printf("%d",printf("ABC//"));
4) int func(int r){int static result;if(r<=0) result=1;elseresult=func(r-3)+func(r-1);return result;}
5) int i=3;while(i--){int i=100;i--;printf("%d..",i);}
6) file a.c
void test(){int i=20;printf("%d",i);}
file b.c
void main(){int i=10;test();printf("%d",i);}
o/p is----
Technical
Deadlock, graph(2), error detection in which layer of OSI,find no: of packets
SASKEN PAPER------------------------
There were around 85 Info-science, 30 Telecomm.. and 5 computer sc freshers.After the test HR announced that the result will be in 3 days i.e by Wednesday. Only those candidates who r shortlisted will be intimated by mail. Rest must assume that they r not shortlisted. If shortlisted they will have to come for a TECHNICAL INTERVIEW followed by a HR INTERVIEW.There may be further recruitment in SASKEN. I am not sure. Dont send ur CV's by mails. Just go to Sasken Campus and drop in ur resumes.
Address:Sasken Communications Technologies Limited.# 139/25 Amar Jyoti Layout, Ring Road,Domlur POBanglore 560 071India.
The questions were like this. Sasken New Pattern------------------------------Held on 9th August at 2:30 pm The text consists of two parts1) C test2) CSE01 TestDuration: 1hr---------------------------------------------------------1) C test -10 questions- Some questions were as follows I remember only a few.a) What is the parameter passing mechanism to Macros Called?b) void func(int x,int y){x=3;y=2;}main(){int i;func(i,i);print(i);}If the output must be 2 what is the parameter passing mechanism called?c) which of the following code will swap the two numbers? -3 choices was givend) which of the following is illegal for the program?main(){char const *p='p';}1)p++ 2) *p++ 3)(*p)++ 4) alle) what is the output of the following programvoid print(int ** arr){print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);}main(){int a[][]={ {1,2,3},{4,5,6}}int ** arr=a;print(arr);arr++;print(arr);}f) which of the following code swapps the two,numbers.- 4 choices were giveng) if the string " this is a " is present in the code of a function such as 'void func(void)' where will the variable stored in the memory.a) in the stack b) heap c) code or text segment as per implementation d) created whenfunc is called, stored in function stack space and destroyed as it goes out .
2) CSE01-15 questionsIn this section there was question from LD-gates, JK flip flop, sampling rate and few other then there was a few from OS - i dont remember the questions.
Sample Interview
In 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 inorder and postorder details. Is it neccessary 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)8) 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 - Semaphores12) About Computability (eg:- finding infinite loop), Complexity of algorithms13) What does compiler and assembler do?They asked grep command in Linux. How do u search '\n', using grep, in a file. They may ask some other commands if u say u r familiar and recently been using linux.About Networks? OSI reference model. what does transport layer do?TCP belongs to which layer?IP belongs to which layer?Where is error correction done?What is a connection oriented/ connection less transmission?What is meant by reliable transmission protocol? why is it called so?What is flow control and where it is done?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 C 10 Q for 10 Marks and Other one is in thier corresponding B.Tech Subjects 15 Q for 15 Marks.For CSE Students the subjects are Automata Theory Formal Languages,Data stcures,Discrete Mathematics,OperatingSystem,Digital Logic Design,Computer Organisation,Micro Processer and Computer Networks.
C Test------10 Q-10 MElectives---15 Q-15 MDuration of these two exams is 1Hr.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: 102.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: A3.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: 105.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 returnsan 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*xmain(){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: 1010.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
CSEA01 Test-----------I haven't remembered the Qs.I has forgotten Qs.They has given 5Q in OS,3Q in DM,2Q in ATFL,1Q in DLD,1Q in CO,1Q in MP 1Q in DS,1Q in CN.
10 ques of C 10 ques of aptitude 10 ques of comp sc.
i m sendin the ques of comp sc whch might help u
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: 4 choices r given probably (c)
5. 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 time
6. 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 sectionsi ) 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#includevoid 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#includevoid 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#includevoid main(){int a[20];clrscr();*a=(int*)malloc(sizeof(a));printf("%d",sizeof(a));getch();}
5)#include#includevoid 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.
8)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 nameb. Call by referncec. Call by value
ans : call by reference
Off Campus Written Test conducted in 3 at BangaloreThe test comprises of 2 sections: 1. Technical ( C ) & Technical Subject- 60 mins, 60 questions 2. Logical Reasoning.. - 30 mins,17 questions....
==> Questions in C were mostly from "pointers in c" and "test ur C skills" by Yeshwant Kanetkar... C questions based on command line arguments, data structure ( BST, tree traversals). All the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c) compilation error and (d) compilation, warning, runtime error.... Heard they are asking abt- ptr, string, arr, preprocessor, data structures etc.. C test was pretty ok pass by value, pass by reference etc. questions were asked The general test was pretty tough, they ask u fourier transforms,harmonics,Barkhuasen criterion,virtual memory,Whether FIFO is better than LRU etc. 4 questions were from fourier transforms the duration was 60 mins and no negative marking
C basics 10 questions ,very easy.Given a program and asked the output-type questons.from pointers 3-4 questions are there. 2)reg subject:very very easy:some from digital(on nand gates. Jk flip flop),from Information theory and coding,some from Micro processors.
In Logical Reasoning all the 17 questions were paragraphs (argument) of 5 to 6 sentences...five sentences (choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." :- R. S. Agrawal LR is sufficient
SASKEN PAPER HELD ON 9th AUG at 2:30pm--------------------------------------------------------------
The questions were like this.------------------------------The text consists of two parts1) C test2) CSE01 TestDuration: 1hr--------------------------------------------------------------- 1) C test -10 questions- Some questions were as follows, remember only a few.a) What is the parameter passing mechanism to Macros Called?b) void func(int x,int y){x=3;y=2;} main(){int i;func(i,i);print(i);}If the output must be 2 what is the parameter passing mechanism called?c) which of the following code will swap the two numbers? -3 choices was givend) which of the following is illegal for the program?main(){char const *p='p';} 1)p++ 2) *p++ 3)(*p)++ 4) alle) what is the output of the following programvoid print(int ** arr){print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);}main(){int a[][]={ {1,2,3},{4,5,6}} int ** arr=a;print(arr);arr++;print(arr);}f) which of the following code swaps the two numbers.- 4 choices were giveng) if the string " this is a " is present in the code of a function such as 'void func(void)' where will the variable stored in the memory.a) in the stack b) heap c) code or text segment as per implementation d) created when func is called, stored in function stack space and destroyed as it goes out .
2) CSE01-15 questionsIn this section there was question from LD-gates, JK flip flop, sampling rate and few otherthen there was a few from OS - don't remember the questions.
INTERVIEW
In 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 inorder and postorder details. Is it neccessary 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)
8) 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?
They asked grep command in Linux. How do u search '\n', using grep, in a file.
They may ask some other commands if u say u r familiar and recently been using linux.
About Networks? OSI reference model.
what does transport layer do?
TCP belongs to which layer?
IP belongs to which layer?
Where is error correction done?
What is a connection oriented/ connection less transmission?
What is meant by reliable transmission protocol? why is it called so?
What is flow control and where it is done?
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.
Next Paper
NOTE : Answer May Not be Accurate So Get An Idea of Questions.
What is the value of X after this execution
x = 0;
begin
parbegin
y = x;
x = x+1;
parend
parbegin
z =x;
x = z+1;
parend
end
a:1
b:0
c:2
d:1 or 2
2. Comparision of LRU and FIFO
a. FIFO IS always better
b. FIFO is always worst
c. FIFO is sometimes better
d. NOthing can be said.
ANS :D
3. How many minimum no of NAND GATES ARE required for construction of X-OR gate
6 7 5 8
ANS : 5 (but the correct answer is 4 ) if 4 is present that is correct answer otherwise 5
4.
If each counter has time delay of 15 n sec. Then what is the max time to change the state of 4 bit
synchronus counter
a. 60
b.15
c. 120
d. none
ans : 15
5. There is ADC of freequency 1 MHz. How much time it will take to convert a message stream of 6 bit
ans : 6 Micro Sec
6.
What is Baukshna's criteria for sustaining freequency.
some fk is given that( Iam not clear)
fk > 1
fk <1
fk =0
none
7.
which of the following is wrong:
ans : WCW is a context free language.where w is word formed by sequence of alphabets.
8.
find odd man out
LISP -Functional language
PROLOG - logic programming
C - imperative
ans : c- imperative. Iam not sure ask ur brother.
Fourier analysis 4 questions.
C
How macros are called
a. Call by name
b. Call by refernce
c. Call by value
ans : call by name.
2. fun( int x, int y){
x =3;
y =2;
}
main(){
int i;
fun( i,i);
printf("%d",i);
}
if the value is 2 then the calling mechanism
a. Call by name
b. Call by refernce
c. Call by value
ans : call by reference
3.fun(int i){
static int j =0;
x = x+j; j++
return ;
}
main(){
int x = 2;
I had not remembered the question exactly. but the essence is J will retain the value between successive function calls.
4.
cout << 3 != 2 << 1;
Syntax error.
5.main(){
int z=10,x=6,y=7;
( z ? x:y) =8;
}
ans : the statement does nothing. all values are same.
6. "This is a sting.."
It is string in a function. Where it will be stored.
a. stack
b.global heap
c. Data ro text segment.
d. none
c. Data or Text segment
7. One question i doent remember that Double pointer is given
for that my answer is : Segmentation error
8.fun( int x, int y){
int temp;
temp =x;
x =y;
y = temp;
}
main(){
int i =3,j =4;
fun(i,j);
printf("%d,%d",i,j);
}
ans : 3 4 (that means the values doesnot change)
}
}
) C test -10 questions- Some questions were as follows
I remember only a few.
a) What is the parameter passing mechanism to Macros Called?
b) void func(int x,int y)
{
x=3;
y=2;
}
main()
{
int i;
func(i,i);
print(i);
}
If the output must be 2 what is the parameter passing mechanism called?
c) which of the following code will swap the two numbers? -3 choices was given
d) which of the following is illegal for the program?
main()
{
char const *p='p';
}
1)p++ 2) *p++ 3)(*p)++ 4) all
e) what is the output of the following program
void print(int ** arr)
{
print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);
}
main()
{
int a[][]={ {1,2,3},
{4,5,6}
}
int ** arr=a;
print(arr);
arr++;
print(arr);
}
f) which of the following code swapps the two,numbers.
- 4 choices were given
g) if the string " this is a " is present in the code of a function such as 'void func(void)' where
will the variable stored in the memory.
a) in the stack b) heap c) code or text segment as per implementation d) created when
func is called, stored in function stack space and destroyed as it goes out .
Sasken Sample Test Paper.
Aptitude
1. 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
2. a person has certain number of cows and birds.they have 172 eyes and 344 legs.how many cows and birds does he have?
3. 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?
4. 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
5. 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?
6. 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?
7. 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?
8. 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
9. The hours remaining in a day is one-fifth of the hours passed in the day. What is the time?
10. My successor is my uncles only brothers son who is his only kid. (some what like this)
11. My successor is my uncles only brothers son who is his only kid. (some what like this)
12. 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
13. In a pet shop there are 120 eyes and 172 legs. How many birds and puppies are included in these?
14. 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
15. 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 preemptivefcfsround robinshortest 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 stackparenthesis matchinparsinglocal variables stored in runtimeall the above
9. which of the foll data structures can be randomly accessed givin loc1.linked kist implemented using array2.singly linked list3.double linked list4.both single and double linked list
10. Find output ………….Int *ptr=&const;………… ans:error
11. Find output ………..Function(i=10);…………… ans:error
12. #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=%d\n”,x,y); } note that the function SWAPis not within braces
13. 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]
14. what is int (*ptr)[]()?
15. Main(){int a[]={0,2,4,6,8};int *ptr;ptr=a;printf(“%d”, *((char *) ptr+4));}find output8 2 4 6 ANS= 4
16. which takes the same memory space regardless of the type of operating system?Char* char int float
17. 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
18. main(){char ch;for(ch=’0’;ch<=255;ch++)printf(“%c”, ch);}[ans : infinite loop
19. some program using variable b which was not initialized so ans error
Questions in C were mostly from "pointers in c" and "test ur C skills" by Yeshwant Kanetkar... C questions based on command line arguments, data structure ( BST, tree traversals). All the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c) compilation error and (d) compilation, warning, runtime error.... Heard they are asking abt- ptr, string, arr, preprocessor, data structures etc.. C test was pretty ok pass by value, pass by reference etc. questions were asked The general test was pretty tough, they ask u fourier transforms,harmonics,Barkhuasen criterion,virtual memory,Whether FIFO is better than LRU etc. 4 questions were from fourier transforms the duration was 60 mins and no negative markingC basics 10 questions ,very easy.Given a program and asked the output-type questons.from pointers 3-4 questions are there. 2)reg subject:very very easy:some from digital(on nand gates. Jk flip flop),from Information theory and coding,some from Micro processors.In Logical Reasoning all the 17 questions were paragraphs (argument) of 5 to 6 sentences...five sentences (choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." :- R. S. Agrawal LR is sufficient
The questions were like this.------------------------------The text consists of two parts1) C test2) CSE01 TestDuration: 1hr
#include#include
/*void print_arr(float **p){printf("%f %f %f \n",p[0][0],p[0][1],p[0][2]);}
void main (){float arr[2][3]={{0,1,2},{3,4,5}};float **fl_arr;clrscr ();fl_arr=(float **) arr;print_arr(fl_arr);fl_arr++;print_arr(fl_arr);}
# define putchar(c) printf("%c",c)
void main (){int s='c';clrscr ();putchar (s);printf("%d",printf("ABC\\"));}
void main (){int i;clrscr ();for(i=0;i<3;i++){int i=100;i--;printf("%d..",i);}}
void main (){int a[]={9,4,1,7,5};int *p;clrscr ();p=&a[3];printf("%d",p[-1]);}
void main (){int a[]={101,201,301,401,501,601,701,801,901,001};int *p; clrscr ();printf("%d",a);printf("arthi");printf("%d", ((char *)-a + sizeof(int)));p=(int *) ((char *) a +sizeof (int));printf("%d",*p);}
main (){int a[10]={10,9,8,7,6,5,4,3,2,1}; clrscr ();int *p=a;int *q=&a[7];printf("%d%d%d",q,p,(q-p+1));}
main (){int i=5; clrscr ();i= !i >3;printf("%d",i);}*/
void main (){int a[10]; clrscr ();3[a]=10;printf("%d ",*(a+3));}
The questions were like this.------------------------------The text consists of two parts1) C test2) CSE01 TestDuration: 1hr--------------------------------------------------------------- 1) C test -10 questions- Some questions were as follows, remember only a few.a) What is the parameter passing mechanism to Macros Called?b) void func(int x,int y){x=3;y=2;} main(){int i;func(i,i);print(i);}If the output must be 2 what is the parameter passing mechanism called?c) which of the following code will swap the two numbers? -3 choices was givend) which of the following is illegal for the program?main(){char const *p='p';} 1)p++ 2) *p++ 3)(*p)++ 4) alle) what is the output of the following programvoid print(int ** arr){print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);}main(){int a[][]={ {1,2,3},{4,5,6}} int ** arr=a;print(arr);arr++;print(arr);}f) which of the following code swaps the two numbers.- 4 choices were giveng) if the string " this is a " is present in the code of a function such as 'void func(void)' where will the variable stored in the memory.a) in the stack b) heap c) code or text segment as per implementation d) created when func is called, stored in function stack space and destroyed as it goes out .2) CSE01-15 questionsIn this section there was question from LD-gates, JK flip flop, sampling rate and few otherthen there was a few from OS - don't remember the questions.INTERVIEW In 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 inorder and postorder details. Is it neccessary 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)8) 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 - Semaphores12) About Computability (eg:- finding infinite loop), Complexity of algorithms13) What does compiler and assembler do?They asked grep command in Linux. How do u search '\n', using grep, in a file.They may ask some other commands if u say u r familiar and recently been using linux.About Networks? OSI reference model.what does transport layer do?TCP belongs to which layer?IP belongs to which layer?Where is error correction done?What is a connection oriented/ connection less transmission?What is meant by reliable transmission protocol? why is it called so?What is flow control and where it is done?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.
Next Paper
NOTE : Answer May Not be Accurate So Get An Idea of Questions.
What is the value of X after this execution
x = 0;
begin
parbegin
y = x;
x = x+1;
parend
parbegin
z =x;
x = z+1;
parend
end
a:1
b:0
c:2
d:1 or 2
2. Comparision of LRU and FIFO
a. FIFO IS always better
b. FIFO is always worst
c. FIFO is sometimes better
d. NOthing can be said.
ANS :D
3. How many minimum no of NAND GATES ARE required for construction of X-OR gate
6 7 5 8
ANS : 5 (but the correct answer is 4 ) if 4 is present that is correct answer otherwise 5
4.
If each counter has time delay of 15 n sec. Then what is the max time to change the state of 4 bit
synchronus counter
a. 60
b.15
c. 120
d. none
ans : 15
5. There is ADC of freequency 1 MHz. How much time it will take to convert a message stream of 6 bit
ans : 6 Micro Sec
6.
What is Baukshna's criteria for sustaining freequency.
some fk is given that( Iam not clear)
fk > 1
fk <1
fk =0
none
7.
which of the following is wrong:
ans : WCW is a context free language.where w is word formed by sequence of alphabets.
8.
find odd man out
LISP -Functional language
PROLOG - logic programming
C - imperative
ans : c- imperative. Iam not sure ask ur brother.
Fourier analysis 4 questions.
C
===============================
How macros are called
a. Call by name
b. Call by refernce
c. Call by value
ans : call by name.
2. fun( int x, int y){
x =3;
y =2;
}
main(){
int i;
fun( i,i);
printf("%d",i);
}
if the value is 2 then the calling mechanism
a. Call by name
b. Call by refernce
c. Call by value
ans : call by reference
3.fun(int i){
static int j =0;
x = x+j; j++
return ;
}
main(){
int x = 2;
I had not remembered the question exactly. but the essence is J will retain the value between successive function calls.
4.
cout << 3 != 2 << 1;
Syntax error.
5.main(){
int z=10,x=6,y=7;
( z ? x:y) =8;
}
ans : the statement does nothing. all values are same.
6. "This is a sting.."
It is string in a function. Where it will be stored.
a. stack
b.global heap
c. Data ro text segment.
d. none
c. Data or Text segment
7. One question i doent remember that Double pointer is given
for that my answer is : Segmentation error
8.fun( int x, int y){
int temp;
temp =x;
x =y;
y = temp;
}
main(){
int i =3,j =4;
fun(i,j);
printf("%d,%d",i,j);
}
ans : 3 4 (that means the values doesnot change)
}
}
) C test -10 questions- Some questions were as follows
I remember only a few.
a) What is the parameter passing mechanism to Macros Called?
b) void func(int x,int y)
{
x=3;
y=2;
}
main()
{
int i;
func(i,i);
print(i);
}
If the output must be 2 what is the parameter passing mechanism called?
c) which of the following code will swap the two numbers? -3 choices was given
d) which of the following is illegal for the program?
main()
{
char const *p='p';
}
1)p++ 2) *p++ 3)(*p)++ 4) all
e) what is the output of the following program
void print(int ** arr)
{
print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);
}
main()
{
int a[][]={ {1,2,3},
{4,5,6}
}
int ** arr=a;
print(arr);
arr++;
print(arr);
}
f) which of the following code swapps the two,numbers.
- 4 choices were given
g) if the string " this is a " is present in the code of a function such as 'void func(void)' where
will the variable stored in the memory.
a) in the stack b) heap c) code or text segment as per implementation d) created when
func is called, stored in function stack space and destroyed as it goes out .
1.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 milesb) 10 miles 10 milesc) 6 miles 6 miles2.a person has certain number of cows and birds.they have 172 eyes and 344 legs.how many cows and birds does he have?3.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?4.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 number5.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?6.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?7.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?8.my successor's father is my father's son. and i don't have any brothers or sons..who is my successor?a)nephewb)niecec)daughterd)myself9.The hours remaining in a day is one-fifth of the hours passed in the day. What is the time?10.My successor is my uncles only brothers son who is his only kid. (some what like this)11.My successor is my uncles only brothers son who is his only kid. (some what like this)12.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 another13.In a pet shop there are 120 eyes and 172 legs. How many birds and puppies are included in these?14.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 15.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 16Computer Science 1.which of these checks for structural errors of a languagea)lexical analyserb)parserc)intermediate coded)code optimisation2.threads in the same process share the samea)data sectionb)stackc)registersd) thread id3.the depth of a binary tree...a)nlogn(base 2)b) n*nc)n4.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 4000a)130b)140c)1505.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 preemptivefcfsround robinshortest job first7.problem to find the avg waitin time of sjf..given the burst times of each process8.which of the follwing may be implemented using a stackparenthesis matchinparsinglocal variables stored in runtimeall the above9.which of the foll data structures can be randomly accessed givin loc1.linked kist implemented using array2.singly linked list3.double linked list4.both single and double linked list10.Find output ………….Int *ptr=&const;………… ans:error11.Find output ………..Function(i=10);…………… ans:error12.#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=%d\n”,x,y); } note that the function SWAPis not within braces13.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]14.what is int (*ptr)[]()?15.Main(){int a[]={0,2,4,6,8};int *ptr;ptr=a;printf(“%d”, *((char *) ptr+4));}find output8 2 4 6ANS= 416.which takes the same memory space regardless of the type of operating system?Char* char int float17.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 9918.main(){char ch;for(ch=’0’;ch<=255;ch++)printf(“%c”, ch);}[ans : infinite loop19.some program using variable b which was not initialized so ans error
SASKEN Latest Fresher Placement Sample Question Question Paper 4************** INTERVIEW ****************************/In 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?SASKEN Latest Fresher Engineer Placement Sample Question Paper 43) 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 inorder and postorder details. Is it neccessary 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)Cool 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 - Semaphores12) About Computability (eg:- finding infinite loop), Complexity of algorithms13) What does compiler and assembler do?They asked grep command in Linux. How do u search '\n', using grep, in a file.They may ask some other commands if u say u r familiar and recently been using linux.About Networks? OSI reference model.what does transport layer do?TCP belongs to which layer?IP belongs to which layer?Where is error correction done?What is a connection oriented/ connection less transmission?What is meant by reliable transmission protocol? why is it called so?What is flow control and where it is done?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 isC 10 Q for 10 Marks and Other one is in thiercorresponding B.Tech Subjects 15 Q for 15 Marks.ForCSE Students the subjects are Automata Theory FormalLanguages,Data stcures,Discrete Mathematics,OperatingSystem,Digital Logic Design,Computer Organisation,Micro Processer and Computer Networks.C Test------10 Q-10 MElectives---15 Q-15 MDuration of these two exams is 1Hr.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: 102.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: A3.What is the output of the Program?main(){int i=5;i=!i>3;printf("%d",i);}Ans: 04.What is the output of the Program?main(){int a[10];3[a]=10;printf("%d",*(a+3));}Ans: 105.int (*p[10]) ();In above declaration what type of variable is P?Ans: P is array of pointers that each points toa function that takes no arguments and returnsan 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*xmain(){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: 1010.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: YesCSEA01 Test-----------I haven't remembered the Qs.I has forgotten Qs.They has given 5Q in OS,3Q in DM,2Q in ATFL,1Q in DLD,1Q in CO,1Q in MP 1Q in DS,1Q in CN.10 ques of C10 ques of aptitude10 ques of comp sc.i m sendin the ques of comp sc whch might help uCOMP SC.1. IN BINARY TREE IF PARENT HAS INDEX i then its left and right childoccurs at:ans (a) 2i and 2i+12. 1 prog is given n scope is askedans (b) static scope (probably)3. complete graph hasans (b) n vertices and n(n-1)/2 edges4. page fault is said 2 occur when:4 choices r given probably (c)5. probability that a frame is recieved with an error is P in asystem.probability that the first frame to b recieved with an error is afterthe 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 nodesans (b) check7. main advantage of AMI coding is(a) easy clock recovery(b) easy carrier recovery(c) reduced bandwidth req(d) reduced error rate8. recursive-descent parser is a(a) top-down parser(b) bottom-up parser(c) shift-reduce parser(d) LR parser9. min. no. of NAND gates reqd to implement a 2 i/p x-nor gate(a) 2(b) 3(c) 4(d) 510. 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 aboveThese are the Queston asked in the sasken wirtten held on 19th at 3.00 p.m batch.The Question paper is of three sectionsi ) c (most of the questions) and c++;ii) Apptitude (R.S agarwal)iii)basic commputerEach 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#includevoid 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#includevoid 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#includevoid main(){int a[20];clrscr();*a=(int*)malloc(sizeof(a));printf("%d",sizeof(a));getch();}5)#include#includevoid 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.7)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.Coola)for(int i=0; i<50 ;i++)for( int j=0; j<100; j++)a[j]=100;b)for(int i=0; i<100 ;i++)for( int j=0; j<50; j++)a[j]=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)9)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 isa. Call by nameb. Call by referncec. Call by valueans : call by referencesorry my memory last a question...(10th)"The question paper is a easy one but i think they are expecting a higher cut-off".In apptidute they ask train,socks(probability),work..In computer Basic's data structure (tree,queue) like best search method ..In technical round they will ask why we answered that option as the
SASKEN Latest Fresher Placement Sample Question Question Paper 3Pattern1) 60 questoins on CMainly qustions on Poniters in C - yashwant kanetkarC questions based on commnad line argumentsdata structure ( BST, tree traversals)2) Logical Reasoning - R. S. Agrawal LR is sufficientSASKEN Latest Fresher Engineer Placement Sample Question Paper 3hi,i have heard they are asking abt- ptr, string, arr,preprocessor,datastrucres.they may ask something more than thisalso.test comprises of 2 sections, technical ( C ) andlogical reasoning.. technical is for 60 mins, 60 questions...logical reasoning is for 30 mins,17 questions......all the questions were like " what is the output of the following program segment" andin many questions 3rd and 4th choices were (c)compilation error and (d)compilation warning,runtime error....in reasoning, all the 17 questions were paragraphs(arguement) of 5 to 6 sentences...five sentences(choices) will be given below and questions were asked like" which of the five if true will weaken or supports the argument above .."think u got an idea after this...but they clearly mentioned after the test that they will be selecting 7 or 8 peopleout of 124 attended for the test on that day.......Sasken Test1)C test2)Aptitude3)technical1)const char *p='c';which not allowed 1)p++ 2)*p++ 3) (*p)++4)all2)#define putchar(c) printf("%c",c);int c=69;putchar(c);3) printf("%d",printf("ABC//"));4) int func(int r){int static result;if(r<=0) result=1;elseresult=func(r-3)+func(r-1);return result;}5) int i=3;while(i--){int i=100;i--;printf("%d..",i);}6) file a.cvoid test(){int i=20;printf("%d",i);}file b.cvoid main(){int i=10;test();printf("%d",i);}o/p is----TechnicalDeadlock, graph(2), error detection in which layer of OSI,find no: of packetsSASKEN PAPER------------------------There were around 85 Info-science, 30 Telecomm.. and 5 computer sc freshers.After the test HR announced that the result will be in 3 days i.e by Wednesday. Only thosecandidates who r shortlisted will be intimated by mail. Rest must assume that they r notshortlisted. If shortlisted they will have to come for a TECHNICAL INTERVIEW followed by a HRINTERVIEW.There may be further recruitment in SASKEN. I am not sure. Dont send ur CV's by mails. Just goto Sasken Campus and drop in ur resumes.Address:Sasken Communications Technologies Limited.# 139/25 Amar Jyoti Layout, Ring Road,Domlur POBanglore 560 071India.The questions were like this.Sasken New Pattern------------------------------Held on 9th August at 2:30 pmThe text consists of two parts1) C test2) CSE01 TestDuration: 1hr---------------------------------------------------------1) C test -10 questions- Some questions were as followsI remember only a few.a) What is the parameter passing mechanism to Macros Called?b) void func(int x,int y){x=3;y=2;}main(){int i;func(i,i);print(i);}If the output must be 2 what is the parameter passing mechanism called?c) which of the following code will swap the two numbers? -3 choices was givend) which of the following is illegal for the program?main(){char const *p='p';}1)p++ 2) *p++ 3)(*p)++ 4) alle) what is the output of the following programvoid print(int ** arr){print("0 %f, 1 %f, 2 %f ",arr[0][0],arr[0][1],arr[0][2]);}main(){int a[][]={ {1,2,3},{4,5,6}}int ** arr=a;print(arr);arr++;print(arr);}f) which of the following code swapps the two,numbers.- 4 choices were giveng) if the string " this is a " is present in the code of a function such as 'void func(void)' wherewill the variable stored in the memory.a) in the stack b) heap c) code or text segment as per implementation d) created whenfunc is called, stored in function stack space and destroyed as it goes out .2) CSE01-15 questionsIn this section there was question from LD-gates, JK flip flop, sampling rate and few otherthen there was a few from OS - i dont remember the questions.
SASKEN Latest Fresher Placement Sample Question Question Paper 2 2004Sasken Exam 20th Jul 2004Pattern : C(10 Qs) + Aptitude(10 Qs) + Discpline based[CS/EC](10 Qs)Duration : 1 HrC questions------------SASKEN Latest Fresher Engineer Placement Sample Question Paper 1 20041.Consider the following declaration:-char const *p = 'd';Which of the following is not a permissible operation(a) *p++(b) ++p(c) (*p)++(d) All2.What is the output of the following code:-void print_arr(float **p){printf(" 0 %f 1 %f 2 %f\n",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 fault3.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 error4.What is the output of the following code:-void main(){printf("%d",printf("ABC\\"));}(a) ABC\\(b) 1(c) ABC\4(d) ABC\35.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) 136.What is the output of the following code:-void main(){int i;for(i=0;i<3;i++){int i="100;i--;printf(" p="&a[3];printf(" p=" (int*)((char" i="0;i<100;i++)for(j="0;j<10;j++)a[j]="0;ORfor(j="0;j<10;j++)for(i="0;i<100;i++)a[j]="0;(a)First" y =" zThen(a)...(b)yComputer science----------------1.Deadlock occur when(a)Some resources are held up by some process.(b)...(c)...(d)None of these2. A prefix expression can be equal to a postfixexpression reversed only if(a)It is left associative(b)It is commutative(c)It is right associative3.How many lines will be printed in the followingPascal pgm[I don't remember the Pascal version,so I am giving Cversion]void print(int n){if(n>0){print(n-1);printf("%d",n);//println(n) in Pascal version.print(n-1);}}(a)3(b)7(c)15(d)314.Maximum number of nodes in a tree with n levels.(a)2^(n-1)(b)(2^n)-1(c)2^(n-1) - 15.Complete graphwith n nodes have(a)n-1 edges(b)n(n-1)/26.If d is the degree of a node in a graph and n isnumber of vertices then number of edges in that graphis(a)Edi^n(b)0.25Edi(c)0.5Edi7.A grammar was given and 4 strings was given and theone which was not possible was to be chosen.8.A problem related to ethernet in which a stationsending a frame is of p probablity.There are mstations to send pckts.4 option was given.It was amathematical kind of question related to probablity.9.Which of the following layer in the OSI model doeserror handling(a)Data link(b)Network(c)Transport(d) a & c10.A network problem in which Data rate,Propagationdelay,and distance was given and it was to find howmany packets will be in the line.Choices where(a)5000(b)Not possible to find with given data(c)1000AInterview [For CS students]---------There is Tech as well as HR interview. Tech interviewis the important one.Tech interview questions------------------------They will ask about the project.They will ask generalquestions about it and most probably will not go intothe implementation part of it.So one must have ageneral idea about the project done.Interview is mainly based on Data Structures.Somequestions are as follows:-- What is a tree,its application,order forinsertion,deletion and traversal with worst caseanalysis.- What is a graph,its application.- Height of a tree- Balanced tree and how to balance a tree- Minimum Spanning Tree- Dijikstra's, Prim algorithms- Define a structure for a linked list.- Binary search and its analysis- Heap sort and its analysis- What is a heap and its application- Cache and its working- Memory(IO mapped)- Recursive fns and types, its adv and disadv.- Compiler(grammar)*****C debugging questions like(1)What is the problem with the following codeint * f(int a){int i;i=a;return(&i);}Ans-> We can't return address of auto variable as itis allocation is made in stack which is deallocatedwhen the function returns.(2)a.h b.c c.c d.cint i=0 #include"a.h" #include"a.h" extern inti;void main{.....} b.o c.o d.oCompilation PhaseLinked to get exe.Will there be any problem in any phase.If yes thenwhere and what?In linking phase as there will be multiple declarationof i.*****You will be told to write some code like(1)To find string length by using recursive function.(2)To find fibonaci series by using recursivefunction.(3)To write code for malloc so that allocation may bemade fastly.(4)Write a fn prototype which return a pointer whichpoints to an array of 10 ints.HR Interview------------- Introduce yourself- Why should we take you- What you know about Sasken and etc.
Sasken Latest Fresher Placement Sample Question Question Paper 1SASKEN COMMUNICATION INDIAThere r 10 ques. in three sections each, thus total 30 ques. 4 choices were given. 1 mark for each ans. no negative marking.SASKEN Latest Fresher Engineer Placement Sample Question Paper 1q.1 if phase of different frequency components of signal vary linearly then they all reach destination with delay1) delay also vary linerly.2) no change in delay,3)q.2 what is the relation in dbm and db?1) same2) dbm is 10 times db3) db is 10 times dbm4) db is relative measure and dbm is absolute measure.q.3 difference in PSK and QPSKa. slower sample rateb. greater sample ratec. slower bit rated. greater bit rate.q.4 what is the main problem with power line communicationa. high audio signal generationb. seperation of modulating and career signalc. (something) low pass filteringq.5 a signal is to be transmitted 1000km long distance sending 10 mbps . if signal consists of 1000 bits/package and takes 5 microsecs. to transmit then how much data is to be send such that line gets fully filled.a. 100b. 500cd.1000q.6 if a process is wide sense stationary thena. it's probability density function is also wssb. power spectral density is wssc. it's mean constant and auto correlation function depends only on time diff. t1-t2.d.q.7 for intelligent sound signal transmissiona. low pass filter of 1.8khz is to be used.b. hpf of 1.8khzc.d.q.8 if a 32 bit number in fractional form is to be converted into float then it is multiplied witha. 2^31b. 1/(2^31 - 1)c. 2^31 -1d.q.9 if signal is sampled at 8 khz and the signal of 1 khz is transmitted thenq.1 char const *p='p' then which of below is truea.**P =(this question u can get from VYOMS.com sample paper)q.2 recursive functioncount(n){if count<=1then result = 1;elseresult = count(n-3) + count(n-1)}for count(6) ans is:a. 3b. 6c. 9d. 12q.3 for(i=0;i<=50;i++)for(j=0;j<=100;j++)for(j=0;j<=100;j++)for(i=0;i<=50;i++) for this type of loop which one is fastera. sameb. firstc. secondd. depends on s/w and h/wq.4 #define putchar(%f,c)int c='d';putchar(c);what is the output?a. ,b. some numbersc. compiler errord. segmentation errorq.5 file atest(){ int a; }file bvoid main(void){ int b;b= test();}what is the outputa. ab. bc. not compiled,errord. compiles sucessfully,but give linker errorq.1 if 2economics books then the ratio of economics to science to novell isa. 1:2:14b. 2:1:7c. 14:2:1d.e.q.6 ira is taller than sam, harold is shorter than gene, elliot is taller than haroldsam and harold is of same height. thenwhich one is true.a.sam is shorter than haroldb. elliot is taller than genec. ira is taller than elliotd. elliot is shorter than genee. harold is shorter than iraq.7 if a(n) is to be entered following the rule [ a(n)^2 - 1 ] then what r the next three enteries.a. 0,-1,0b. 2,3,4c. 1,2,3d. 0,-1,2e. 0,-1,1The test comprises of 2 sections:1. Technical ( C ) & Technical Subject- 60 mins, 60 questions2. Logical Reasoning.. - 30 mins,17 questions....==> Questions in C were mostly from "pointers in c" and "test ur C skills" by Yeshwant Kanetkar... C questions based on command line arguments, data structure ( BST, tree traversals). All the questions were like " what is the output of the following program segment" and in many questions 3rd and 4th choices were (c) compilation error and (d) compilation, warning, runtime error.... Heard they are asking abt- ptr, string, arr, preprocessor, data structures etc.. C test was pretty ok pass by value, pass by reference etc. questions were asked The general test was pretty tough, they ask u fourier transforms,harmonics,Barkhuasen criterion,virtual memory,Whether FIFO is better than LRU etc. 4 questions were from fourier transforms the duration was 60 mins and no negative markingC basics 10 questions ,very easy.Given a program and asked the output-type questons.from pointers 3-4 questions are there. 2)reg subject:very very easy:some from digital(on nand gates. Jk flip flop),from Information theory and coding,some from Micro processors.In Logical Reasoning all the 17 questions were paragraphs (argument) of 5 to 6 sentences...five sentences (choices) will be given below and questions were asked like " which of the five if true will weaken or supports the argument above .." :- R. S. Agrawal LR is sufficientThe questions were like this.------------------------------The text consists of two parts1) C test2) CSE01 TestDuration: 1hr#include#include/*void print_arr(float **p){printf("%f %f %f \n",p[0][0],p[0][1],p[0][2]);}void main (){float arr[2][3]={{0,1,2},{3,4,5}};float **fl_arr;clrscr ();fl_arr=(float **) arr;print_arr(fl_arr);fl_arr++;print_arr(fl_arr);}# define putchar(c) printf("%c",c)void main (){int s='c';clrscr ();putchar (s);printf("%d",printf("ABC\\"));}void main (){int i;clrscr ();for(i=0;i<3;i++){int i="100;i--;printf(" p="&a[3];printf(" p="(int" p="a;int" q="&a[7];printf(" i="5;" i=" !i">3;printf("%d",i);}*/void main (){int a[10]; clrscr ();3[a]=10;printf("%d ",*(a+3));}
Subscribe to:
Posts (Atom)