Saturday, March 14, 2009

Redpine Paper


Paper Type : Technical - Database
Test Location : HCU Campus
Posted By : abi

HI all ......................



Test pattern consists of four subjects.

The paper having 100 marks.



1) C - 42 marks(each question carries 3 or 2 marks on objective and descriptive)

2)Data Structures - 18 marks (only objective 2 or 3 marks)

3)Operating Systems - 30 marks (it consists objective and descriptive,some problems on memory management)

4)Computer Networks-10 marks(both objective and descriptive)



The following questions are given below.



1)what is output for the following program.

#include

main()

{

int *p,*q,i;

p=(int *)100;

q=(int *)200;

i=q-p;

printf("%d",i);

}

a)100 b)25 c)0 d)compile error

Ans : b) 25


2)what is output for the following program.

#include

#define swap(a,b) temp=a,a=b,b=temp;

main()

{

int a=5,b=6;

int temp;

if(a>b)

swap(a,b);

printf("a=%d,b= %d",a,b);

}

a)a=5 b=6 b)a=6 b=5 c)a=0 b=6 d)None



Ans : a a=5 b=6



3)what is output for the following program.





#include

main()

{

unsigned char i;

for( i=0;i<300;i++)

{

printf("*");

}

}



a)299 b)300 c)infinite d)none



ans: c (infinite)



4)what is output for the following program.

#include

main()

{

int n=2;

int sum=5;

switch(n)

{

case 2:sum=sum-2;



case 3:sum*=5;

break;

default :sum=0;

}

printf("%d",sum);

}



a)15 b)0 c)6 d)none



ans: a (15)



5)/* what is the program indicates */

#include

main()

{

char *q;

int *ip;

q=(char *)malloc(100);

ip=(int *)q;

free(ip);

}



a)it frees all allocated memory.

b)it frees 400 bytes of memory.

c)

d)segmentation fault.



Ans :



6)What is output for the following program.

#include

main()

{

int a=10,b=5;

if(a=a&b)

b=a^b;

printf("a=%d,b=%d",a,b);

}



a)a=0,b=5 b)a=10 b=5 c)a=0,b=0 d)none

Ans: a a=0,b=5



7)What is output for the following program.

#include

main()

{

int a[5],i,*ip;

for(i=0;i<5;i++)

a[i]=i;

ip=a;

printf("%d",*(ip+3*sizeof(int)));

}



a)0 b)5 c)1 d)none

Ans: d (none)



8)What is the size of the structure.

#include

main()

{

struct

{

char a;

short b;

int c;

}temp;

}

a)7 b)8 c)12 d)120

ans:b



9) What is output for the following program.

#include

main()

{

unsigned char c[]={0x1,0x2,0x3,0x4,0x11,0x22,0x33,0x44};

unsigned int *p=c;

unsigned short *s=c;

printf("%x %x %x",c[2],p[2],s[2]);

}

Ans: please execute this program.



10) What is the difference between these two declarations:



i) int *f()

ii) int (*f)()

a) b) c) d)



11) Define pointer to function that take argument as character pointer and return void pointer.



Ans: void *(*f)(char *)



12) 5-2-3*5-2 evaluates 18 then



i) - left associative * has precedence over -

ii) - right associative * has precedence over -

iii) * left associative - has precedence over *

iv) * right associative - has precedence over *



a) i b)ii c) iii d)iv

Ans: iv



DataStructure questions:



1)Difference between re-entrance and recursion.

2)In which datastructure recursion can be used.

Ans: Stack.

3)Merge sort problem can be solved using which method.

Ans: Divide and conquer strategy.

4)8 queens problem can be solved by using which method.

Ans: Back tracking.

5,6) Two problems related to inorder and post order.

First answer was : + - * a b c d (In objective its answer was (d) )

Second answer was : inorder



Operating systems:



1)what are the necessary conditions for Deadlock

refer Galvin

Answer was : b&c

2)Two problems on memory management .

One answer was : 68.5 ns(average access time.)

3) what are the different types of IPC mechanisms.

Ans:

1)direct communication.(messages)

2)Indirect communication.(mail box)

3) Synchronous/Asynchronous communication.(Naming.)

4) Context switching.

Ans : A

5) Specify any 3 regarding the context of process?

Ans:

1)Process state.

2) Process Attribute.

3)Accounting Information.

4)See PCB (Process control Block) in Galvin Book.



6)Advantages and Disadvantages of cache buffer?

7)Increasing memory many page faults occur(I dont know Question exactly)?

Ans: FIFO



Computer Networks



1)What is the use of ICMP in TCP/IP stack?

2)What is the use of ARP in TCP/IP stack?

3)What is the header length of Ether Net MAC.

4)What is the mechanisms used for error detection in Data Link Layer?

Ans: CRC(cyclic redundency check.)

Related Articles :


Stumble
Delicious
Technorati
Twitter
Facebook

0 comments:

Post a Comment

Career Launchers!!!

Note:

This blog can be viewed using all the browsers but can be best viewed in Mozilla Browser.
 

Career Launchers!!! Copyright © 2010 LKart Theme is Designed by Lasantha