Showing posts with label Adobe. Show all posts
Showing posts with label Adobe. Show all posts

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.

Tuesday, 12 March 2019

Adobe Placement Paper 1 (Written Test) - 2011

Following is the written paper consisting of C++ , Engineering questions.
1. void main()
{
char ch1[]=”hello”,ch2[]=”hello”;
if(ch1==ch2)print(“equal”);
else print(“unequal”);
}
predict the output

2. char *p1=”the world is”;
char *p2=”the world is beautiful”;
p1=p2;
p2=”beautiful”;
print(p1);
print(p2);

3. WAP to find whether an arithmetic expression is delimited by proper braces. (matching braces).


4. char ch[16]=”the world is”;
ch[13]=’b’;
print(ch);

5. An array A is given with starting address 5000 .
int A[]={1,2,3,4,5};
print(A+1,&A+1);

6. char * ch1[]={“abcd”,”efgh”,”ijkl”,”mnop”};
char** ch2[]={ch1,ch1+1,ch1+2,ch1+3};
char***ch3;
ch3=ch2;
print(*(*ch3));

Engineering
1. An instruction code of 1 byte(known as bytecode) in JVM is used by a machine. How many (instructions/bytecode) are possible?

2. Multiply 2 no. a and b without the use of * operator recursively. It should not do more no. of additions than the smaller no.

3. Two sets (arrays) A and B are given. Find two no. a and b from A and B respectively such that a+b=val, where val is another input.

4. Check whether a no. is palindrome or not, without converting it to a string or array of any type

5. Reverse a singly linked list.

6. A NxN matrix is given containing only 1’s and 0’s. Every row is sorted in descending order. Find the row containing maximum no. of ones.

7. Numbers ending in 3 have at least one multiple having all ones. for eg., 3 and 13 have a multiples like 111 and 111111 respectively. Given such a no. , find the smallest such multiple of that number. The multiple can exceed the range of int, long. You cannot use any complex data structure.

8. Four processes of 1gb,1.2gb,2gb,2gb are there and RAM available is 2gb. We have a time shared system. Which of the following is the most appropriate scheduling algorithm?
   a. all processes are loaded sequentially 1 by 1
   b. load one process at a time and execute processes in RR fashion
   c. load 1gb, 1,2gb first then processes 3 and 4 follow
   d. All processes can be loaded together and CPU time shared among them

9. if (lock)
      wait
   else
      lock=1
    CS
    lock=0
     a. No issues
     b. works only for uniprocessor systems
     c. data insufficient
     d. won’t work on any system

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