Pages

Wednesday 12 September 2012

zynga recent paper 2012



Zynga test pattern :2012
posted by :24x7techbytes

test contains 15 questions

14 multiple choice questions and one programming question

Q1.simple puzzle

Q2.some zings are zangs ,some zangs are zongs which of following conclusion is correct

a.some zings are zongs
b.some zongs are zings
c.some zongs are zings
d.none of the above

ans :c

Q3.find next letter in sequence J,H,G,F,D,S

a.I
b.C
b.T
d,A

ans :d

Q4.what is ouput for following program
int main()
{
enum xxx{a,b,c=217483640,d}
printf("%d %d",b,d);
return 0;
}

a.2 214748364
b.1 217483641
c.compile time error
d.1 -214748364

5.what is output for following program
void f(int a)
{
 static int x=a;
if(x==a)
printf("eqaul");
else if(x>a)
printf("greaterthan");
else
printf("lessthan");
}
int main()
{
f(2);
f(1);
return 0;
}

a.equal equal
b.equal greaterthan
c.equal lessthan
d.greaterthan lessthan

ans :b

Q6.which of following is equal to !(!A&&!B)

a.!(B&&A)
b.A&&B
c.A||B
d.!(A||B)

ans :c

Q7.what is output of following code
#define f1(a,b) a+b
#define f2(c,d) c*d
int main()
{
int x=f1(12,18)/f2(6,4);
printf("%d",x);
}
a.9
b.24
c.15
d.1

ans :b

Q8.you have a piece of tape n cms long fold should result in a tape whose length is an integer number of cms for eg:
a 7cm tape can be folded at the 3 cm mark to prodece 4cm tape what is min no of folds required to reach  1 cm tape
a.log2(n)
b.log2(n)-1
c.log2(n-1)+1
d.log2(n+1)-1



Q9.what is output
 conside char takes 2 bytes and short takes 2 bytes

struct str
{
int a;
int b;
};
void main()
{
str s;
s.a=10;
s.b=10;
short *sh=(short *)((void *)&s);
cout<<*sh<<endl;
}

a.20
b.10
c.1290
d.2570

Q10.starting from a white corner cell on a 8*8 chessboard if king makes 100 moves what is number of final position he can achieve (king can move one position in west ,south and nort and east)

a.1
b.4
c.32
d.64

Q11.a perfectly balanced binary tree contains 1 to 1023 and root contains value 1 and value increasing one towards leaf then what level does 768 present
a.1
b.2
c.10
d.7

ans :c

Q12.find output for following code

#define add(a,b) a+b
#define mul(c,d) c*d

int main()
{
int a=10,b=20,c=30;
d=mul(c,add(a,b));
printf("%d",d);
}
a.320
b.900
c.610
d.none

ans :c

13.what is output of following program

int main()
{
int *a=0;
a++;
return 0;
}
a.compile time error
b.segmentation fault
c.no error
d.none of the above

14.what is output of program
#define f(a,b) a##b
 int main()
 {
 int a1=1,a2=2,a3=3,a4=4.a5=5;
 for(i=1;i<=5;i++)
 printf("%d ",f(a,i);
 }
a. 1 1 1 1 1
b. 2 2 2 2 2
c. 1 2 3 4 5
d.compile time error

15.write a program to given a linked list and input k
 
  10->20->30->40->50->60->70->80->90->100

  if  k=2
  output: 20->10->40->30->60->50->80->70->100->90

  if k=3
  output:30->20->10->60->50->40->90->80->70->100

  if k=4
  output:40->30->20->10->80->70->60->50->100->90