-->



HP Placement Paper


Unix:

1) Two way communication is possible by means of means of Which of the following
Ans: unix_socket
2) wc -l x>x prints out
Ans: wc command prints 0
3) The background process that continously runs
Ans: deamon process

DBMS
4) Fragmented packet is reunited at
a) Destination
b)at next gateway
c)at highest MTU gateway
d)at the next router

5) The following address 93.58.5.0 belongs to which class
a) Class A b) class B c) class C d) class D

6) Network to host protocol is
Ans: RARP

7) Assume there are 32 registers .An instructuion can hold upto 3 registers . The opcode is of 4 bits. What is the minimum size of instruction.
Ans: the minimum sizeof instruction has nothing to do with number of registers

8) Minimum no of nand gates require to implement xor gate
Ans : 4 gates
Data Structures:
1)Given a doubly linked list .you are given with a node n and a pointer p associated with it. What are the operarions that are to be performed to delete that node.

2)swapping the elements of left child of a tree with that of right child .
revswap(node*)
{
node* tree;
if(tree!=null)
swap(tree->left,tree->right)
revswap(tree->left);
revswap(tree->right);
}
if given tree is
1
2 3
4 5 6 7
What is the output for about function applied?
Ans:
1
3 2
7 6 5 4

3)t(n)=4+t(n/2) ,t(0)=1. What is the complexity ?

4) In hashing each element can be found with complexity of
Ans: 1

5) In a program all the addresses that are to be binded to the caller function are done by
a)compiler b) linker c) loader d) run time allocator
6) s->v[integer]
interger->interger,integer/termial
Ans: a[2,3,5]

7) char 1 byte , short of 2 bytes , integer of 4 byte,
stuct
{
char a;
char b;
int a[2];
short d;
int e;
char i;
} name;
sizeof(name)
Ans:16

8)main()
{
int i=1;
switch(i)
{
i++;
case 1: printf("case1");
break;
case 2: printf("case 2");
break;
default: printf("default");
}
Ans: when we compile we get warning that unreachable code and if we execute we get "case 1"will be printed.

9)Write a program of swapping using pointers