Wednesday, 13 March 2019

Adobe Placement Paper 2

Engineering Round:(15 questions)

1 Finding height of binary tree
2. Number of times multiplication is required:
int computeXn(int x int n)
{
if(n%2=0)
{
return x*x;
}
else if(n%2=0)
{
int y computeXn(x n/2);
return y*y;
}
else if(n%2=1)
{
int y computeXn(x n/2);
return y*y*x;
}
}
Calculating power of a tree for 5^12.

3. Polynomial A+Bx+Cx^2+....+Nx^(n-1) this representation is more suitable for which data structure. Then P and Q are two such polynomial and how to add that two using that data structure. WAP for that.

4. Specification of variables in one language: letter follow by letter or digit.
options:
1. (LUD)*
2. L.(LUD)* => this one right.
3. L.(L.D)+
4. L.(L.D)*
5.


C Round:(10 questions)

1. Diff between typedef and #define?

2. getbis function gives n bits from the position p of an binary no A.

3. You have to sort large data. But your memory does not have so much space. how you can sort that.

4. a[2][3][4] pointer representation

5. You have two threads T1 and T2 they are reader and writer respectively.
With some specification:
ADDNEW.Process
PROCESS.SET
PROCESS.RESET
ENTER CS
EXIT CS
LOOP
EXIT LOOP
WAIT# PROCESS

6. sprintf() function used how and what means?

7.An array given Arr[] which is in decreasing order. How many swapping required in
for(int index=0;index
{
for(int j=n-index;j
{
if(a[j]>a[j+1])
{
swap(a[j],a[j+1]);
}
}
}

8. Finding Output:
int arr[]={10,20,30,40}
int varible_ptr=arr[0];
for(int index=0;index<4;index++)
{
printf(" arr[%d] = %d", index, *(varible_ptr+index));
varible_ptr+=sizeof(int);
}

Thanks to Pramod Tiwari

Please comment if you find anything incorrect, or you want to improve the topic discussed above.

No comments:

Post a Comment