zynga previous papers 2011
1.Find duplicates in Array. I presented solution in O(n) time and space using hash.
we can do it in O(n) time and constant space. Assumption: range of numbers is known.
2.Reverse a Linked List. Iterative and then recursive
3.Reverse words : "I love to play" becomes "play to love I".
sol:
reverse each word in string then reverse total string
4.n=4 and k=3 . team name can be formed by four digits 1,2,3,4 . so n=4 now make team number using any three digits so that b1<b2<b3.
Basically print numbers which are in form b1<b2<b3..e.g. 123,124,234 etc
5. write a function that takes two numbers a and b and returns a.b eg: a=10 and b=12 output will be 10.12
1.Find duplicates in Array. I presented solution in O(n) time and space using hash.
we can do it in O(n) time and constant space. Assumption: range of numbers is known.
2.Reverse a Linked List. Iterative and then recursive
3.Reverse words : "I love to play" becomes "play to love I".
sol:
reverse each word in string then reverse total string
4.n=4 and k=3 . team name can be formed by four digits 1,2,3,4 . so n=4 now make team number using any three digits so that b1<b2<b3.
Basically print numbers which are in form b1<b2<b3..e.g. 123,124,234 etc
5. write a function that takes two numbers a and b and returns a.b eg: a=10 and b=12 output will be 10.12
No comments:
Post a Comment