Hi guys this is the placement paper pattern of Amazon given on 19 th june 2008

1. Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.

2. What are the 4 basics of OOP?

3. Define Data Abstraction. What is its importance?

4. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.

5. Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.

6. Given a string,find the first un-repeated character in it? Give some test cases

7. You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)

8. Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.

9. What is a C array and illustrate the how is it different from a list.

10. What is the time and space complexities of merge sort and when is it preferred over quick sort?

11. Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

12. Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.

13. Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

14. Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.

15. How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

16. Explain polymorphism. Provide an example.

17. Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

18. You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?

19. Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number



Reblog this post [with Zemanta]

Hi guys this is the placement paper pattern of Amazon given on 27th august in hyderabad ....

Written Test has 2 Sections A, B In Section A there were 20 Questions:

Time :30 min
Small Answer Type
Multiple choice
Aptitude

1.Two tables emp (empid,name,deptid,sal) and dept(deptid,deptname) are there.write a query which displays empname,corresponding deptname also display those employee names who donot belong to any dept.
2.Display the employees whose salary is less than average salary.
3.what is the output of the program
main()int c=5;
printf("%d\n%d\n%d",c,c<<2,c>> 2);
}

4. main()
{
int a[8][10],c=0,i,j;
for(i=0;i<10;
i++) for(j=0;
j<8;j++) a[j][i]=c++;
printf("%d",a[3][6]);
}
5.What is the wrong in this program
main()
{
char *p,*q;
p=(char *)malloc(25);
q=(char*) malloc(25);
strcpy(p,"amazon" );
strcpy(q,"hyd");
strcat(p,q);
printf("%s",p);
}
6.write prefix and post fix notation for (a+b)*c-(d+e)^(f-g)
7.what is the output of the program
main()
{
int i=5;
printf("%d",fun(fun(fun(fun( fun(i))))));
}
void fun (int i)
{ if(i%2) return (i+(7*4)-(5/2)+(2*2));
else return (i+(17/5)-(34/15)+(5/2));
}
8.When it is always true boolean fun
(node *p)
{
return ((p==null)||(p->next==null)|| (p->info<=p->next->info)&&( fun(p->next)));
}
a) when list is empty or has one node
b) when the ele are sorted in non decreasing order
c) when the ele are sorted in non increasing order
9.what is x here (x&&!(x&(x-1))==1)
a) x is always a prime
b) x is a power of 2
c) x is even d)x is odd
10 .What is the difference between deep copy and shallow copy
11.In java what is the difference between sleep() and wait()12.What happens when the parent process of a child process exits before the child ?
13.There are three persons A,B,C .A shots the target 6 times out of 7 shots .B shots 4 out of 5 shots .Then what is the probability of hitting the target twice when 2 persons are selected at random.
14.what is valid in cpp char *cp; const char *cpp; 1) cpp=cp; 2) cp=cpp;
15.write program to swap 2 variables without using extra memory.
16.write a shell command to find all java files present in nested directories.
17.There are 6 pairs of black socks and 6 pairs of white socks.What is the probability to pick a pair of black or white socks when 2 socks are selected randomly in darkness.
18.A string of alphanumeric is there.Find a string that starts with b and ends with 3 characters. section B (we have to write programs) time:30 min
1.There is a sorted array which is of very large size.In that all except one no. are repeated once.How to find that non repeated no.
2.There are 2 linked lists.Those 2 lists are meeting at a point.How to find that meeting point.



Reblog this post [with Zemanta]

The paper was prepared by INSTITUTE OF BANKING PERSONNEL SELECTIONS-MUMBAI.

Aptitude Written Test (Total time: 90 Min, 150 questions)

Section-1 English Language Ability (50 questions)

Section-2 Quantitative Aptitude (50 questions)

Section-3 Logical Reasoning (50 questions)

All 150 questions are given in the beginning, and you can attempt any section at any time. There is individual cut-off in each section. Negative marking 0.25 marks for each wrong answer.

Section- 1:

Q1-15: Comprehension, Antonyms, Synonyms There is a big paragraph (one full page) about regularization of banking acts, etc.

Q1-9 are based on the content of the paragraph.

Q10-12 are Antonyms for some words appeared in the paragraph.

Q13-15 are Synonyms for some words appeared in the paragraph.

Q16-20 (Incomplete Paragraph about Development and Education in Punjab and U.P. was given) In these questions, we need to insert the appropriate word from the options given.

Q21-25: (Ordering sentences in a paragraph) There are 5 Sentences given. They have asked for the correct sequence of those sentences. For example the asked question is which sentence is 2nd? 3rd? etc.

Q26-35: (Sentence improvement) There are 10 sentences. A part of the sentence is in bold part. From the options, we need to improve the meaning of the sentence.

Q36-45: (Identifying error in the sentence) Each Sentence was broken in to 5 parts. We need to find out which portion is having error. Sorry I forgot the other 5 questions.

Except the questions 1-9, I answered all confidently.

Conclusion: Practice Comprehension more, because reading the paragraph itself will take10-15 min. Then answering questions is too difficult.

So, go for other questions which are relatively simple and you feel comfortable.

Section- 2:

Quantitative Aptitude: ( R.S.Agrawal level, but time is very crucial) I am giving you, the topics covered.

1.Compound interest (1q)

2.Simplification (10q)

3.Data Interpretation(15q)

There are 3 Tables and each table comprises of 5 questions.

4.Series Completion (5q)

5.Squre root (1q)

6. Trains (1q)

7.Probability (5q)

Actually I overlooked the other 7 questions, because I have answered only 25 in 30 min. Then I moved to other section. There is no time to see any question 2nd time. So, do it right first confidently. Some questions are (none of these) options type. So doing confidently first time is important.

Do not check your calculation if u get none as your answer. Because they will test confidence by putting none option.

Conclusion: Do all questions in R.S.Agrawal atleast once to get confidence. Emphasize more on DI, Probability. Questions are simple but managing time is imp.

Section- 3:

Logical Reasoning :

Two puzzles on seating arrangement of students- 10q. These puzzles are simple.

example: There are 10 students, five will sit in Row A, and others in Row B. K will sit in between D and E. M is not interested to sit at the end in a row……. like that conditions will be given, Accordingly we can arrange.

Statements and Conclusions- 5q.

There are 4 statements, All cats are dogs, some dogs are squirrels. No Squirrel is Dove. Some doves are cats. etc . Then 3 conclusions were given. and we need to identify which are following. This question is not correct. DO not try to solve it. Just to have an idea I have mentioned.

Blood relations (5q)

The model is like this: A+B means A is brother of B

A-B means A is mother of
AxB means A is father of B

A/B means A is sister of B

Then what will be p+q-r? etc. Please refer R.S.Agrawal Blood Relations Type 3 Coded Relations. (P.NO.237)

Coding & Decoding (7q)

For the numbers 0-9, They have given some letters as their codes. And if a word starts with vowel then code should start with $ symbol, if a word ends with vowel then code should end with # symbol. etc . Now 5 words were given we need to find out their codes.

Odd man out (1q)

A.27 B.64 C.125 D.512 E.216.

ans b

64 is cube as well as square but the others are only cubes.

Data sufficiency (5q):

Three statements were given and one question was given. To answer this question, we need to find out which data is required from the above 3 statements?

Like this total 5 q were given

New model questions (7q)

Five three digits numbers were given. 1 is added to the first digit of all numbers and 1 is subtracted from the middle digit.

Then QUESTIONS are which is lowest, highest? ect.

Example: 546, 687, 456, 274, 487

After modifying according to the given conditions, 636, 777, 546, 364, 577. Now you can arrange these numbers either ascending or descending order to answer the questions.


Reblog this post [with Zemanta]