61 views

Uploaded by naninanyesh

hi

hi

© All Rights Reserved

- Access Specifiers
- Advanced Programming with lcc_win32
- MX_Command Language Reference
- ib1500172b.pdf
- How Do I Compare Strings in Java_ - Stack Overflow
- 28 TAC Examples
- ladderen.pdf
- MCSL-017 C and Assembly Language Programming lab by ignousolvedassignments.com
- Networker mminfo
- zclVolume1
- quis 6-1
- Java Programmes List (IMP)
- Software Development Vtocb
- ch04-2
- 04-Basic-Syntax
- EKT120_LECTURE08_ARRAYS2
- Programming language
- ACR30 Proprietary Active X Component2.pdf
- 02 Strings
- 34-35 Tupas&Umadhay

You are on page 1of 12

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

%d

%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)

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.

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 do not

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

%d

%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.

I got a mail from HR of Amazon, Hyderabad. They were recruiting for Kindle team in Chennai. I replied

with my CV and was invited for the interview. I told him I would not be able to make it to the interview

on 6th. He asked me to take an online test on 4 Feb and see if I can make it to their office by afternoon. I

did the same.

Below are the questions in the online test:

Q1. Search for a value in a given BST.

Q2. Return the number of distinct pair of elements in a given array that add up to a given number.

On 6th Feb, there were 2 rounds of interview. I can't remember most of the questions but below are a

couple of them:

Q1. Return the first non-repeating character in a string.

Q2. Given an array of integers that first increases and then decreases, (a) determine the index of highest

integer, and (b) search for a given value.

I wasn't selected, rightly so. Nor did I expect to be. The interviewers who came from Chennai were

young, dynamic and appeared hard-working, besides guiding me towards a solution when I was stuck. I

learned alot. Thanks, Amazon.

Rated : +196 , -61

Go to Amazon.com First of all, research all info you can on Amazon processings.

Interview process is

1. Personal Introduction round (PIR)

You will be questioned about

(a) yourself

(b) why you want to join amazon?

(b) what's you fav color & why?

(c) speak about you memorable days in your life?(2 mins)

(d) speak about your college days.(mem moments)

(e) tell about chetan bhagat's books (ur opinion)

2. Passage writing

You will be given some scenario based questions.

(so random)

3. Navigation round (about 20 questions)

Using Amazon.com you can answer them. The thing is you should be able to categorize the product.

4. Operations round (HR)

Here they will check your confident level.

Somehow, sometimes, they also conduct test to check typing speed, Mocking chat.

Rated : +38 , -3

Hi Friends

Interview Questions:

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

Rated : +134 , -55

Below are a list of certain questions that some of my friends and I were asked during an interview for the SDE position.

It was an amazing experience. Though they tend to focus PRIMARILY on Data Structures throughout, they also give good

weightage to your Problem Analyzing Skills and OS.

1. Given a dictionary with limited words. Check if the string given to you is a composite of two words which are already present

in the dictionary.

2. Given a single linked list of certain nodes. Switch adjacent nodes. Eg. 1 2 3 4 will be 2 1 4 3.

3. What is the function of the 'finally' block in Java ? Under what conditions does the finally block not get executed, if this is

possible?

4. Display all the nodes at the same level in a tree.

5. Given a binary search tree. Traverse only the left sub-tree.

6. Given a n-ary tree. Devise an algo which determines the position at which the 3rd B is present from the given index in constant

time complexity.

Try it for binary tree.

What is hashing. What is constant time complexity?

Which are the data structures which have constant time complexity. HINT - they both use indexes?

The preprocessor method will use what data structures to ensure the getA() or getB() function will determine the 3rd B's position

in constant time complexity.

7. Is {a, n, d} a palindrome ? If you are given a random string, is it a palindrome or not ?

8. Implementation of AVL tree.

P. S. The tech panels which came down for the interviews are amazingly helpful and vastly experienced. So you better work

you're arse off if you wanna pass all 3 tech rounds + telephonic interview!

Hi all,

I interviewed at Amazon. I applied through employee reference. The interview panel is going on very

friendly nature and mostly they wanted pure coding. They asked Data structures and algorithms and

scenario based questions on which you have selected technology like C, C++, Java...etc and in OPS round

they are checking your confidence levels and your logical thinking for this purpose they asked puzzles.

So friends be prepared well to crack the interview.

FIRST ROUND: Technical Aptitude Test.

It comprised of 20 technical objective questions and two programs to be solved in 1 HR 30 mins.

Most of the questions were on OS. I am mentioning few questions here.

1. Question on fork() system call.

Code was given with few forks we were asked to find out number of child processes and how many

times a given printf statement will be executed.

2. C language question Dangling Pointers .

We were given 3 Functions and we have to find out which function call will result in Dangling Pointer.

3. A Numerical on 2-level page table in OS.

4. Question like which of the following is used by Java.

A) NFA

B) DFA

C) PDA

D) Turing Machine

5. Question On Threads.

Which portion is shared between Process and Threads (Code section, Processor register etc).

6. Question on Tree.

Preorder traversal of a BST was given we have to find out its postorder traversal.

7. C Language question on Format Specifier.

Like which of the following is not a Format specifier.

8. Java question on String Concatenation Operator (+) inside System.out.println();

9. Mix of Printf and Fork was given and we were asked the output.

10. Page reference string were given and we have to find out number of page faults in

FIFO, LRU and optimal page replacement policy.

11. Question on thrashing from OS.

I don't exactly remember other questions but most of them were from OS.

2 programs.

1st)

An array containing mix of +ve and -ve numbers were given and we have to arrange those numbers so

that final array has alternating +ve and -ve numbers but without changing the original order.

2nd)

program based on keypad of a Mobile.

keypad has keys with each key having few digits and alphabets on it.

A number was given say 235 then we have to write a program that finds all permutations of alphabets

while typing 235 like adj, adk, adl and so on. Without changing the original sequence.

SECOND ROUND:

It was Coding Round.

2 Programs for 1 Hr.

1st)

Reversing a Linked List k elements at a time.

2nd)

Array of integers was given with part of it sorted in ascending order and a part in descending order (one

part following the other)

We have to apply binary search on this array to find out a given number.

THIRD ROUND: Technical interview.

- Program to find out square root of a float without using any library function.

- Array of 1's and 0's is given we have to find out subarray of size k with most number of 1's and most

number of 0's respectively.

- Question on time and space complexity (find time and space complexity of given code).

- Question on bitwise operators in C (how to set, reset, toggle given bit).

2 Lane road was given some cars moving in upward direction and some in downward

speed of cars were given along with their arrival time at a specific point on a road, we have to write a

program to find out length of each car and % of cars moving in upward and downward direction.

finally 4 students were selected

int arr[] = {0,1,3,5}

output = 0 0r 1

2. Find out elements which is not duplicate in the given array.

Int arr[] = {1,3,5,7,1,3,5}

Output = 7

3.write a function that returns the element which is having maximum occourance in the given string

Char input_str [] = "the things are thin"

So it will returns "t" as it's occourance is 3 times.

4. Algorithm

5. How to rename all the files at the given directory from .jpg to .jpeg.

6. Write a script which reverse the given string x = "the pen is mine" the output is mine is pen the.

7. I want to delete a file in 1000 hosts.1000 host names are provided.

9. Print the line from 20 to 30th of a file.

10. Forgot

- Access SpecifiersUploaded byshamik
- Advanced Programming with lcc_win32Uploaded byJeff Pratt
- MX_Command Language ReferenceUploaded byOng Yee Seng
- ib1500172b.pdfUploaded byAmit Jholapara
- How Do I Compare Strings in Java_ - Stack OverflowUploaded byKunal Kumar
- 28 TAC ExamplesUploaded byaptureinc
- ladderen.pdfUploaded byAmaraa Ganzorig
- MCSL-017 C and Assembly Language Programming lab by ignousolvedassignments.comUploaded bySumit Ranjan
- Networker mminfoUploaded byJuruma_
- zclVolume1Uploaded byahmed_497959294
- quis 6-1Uploaded byHendi Fedora
- Java Programmes List (IMP)Uploaded bygangaprasada
- Software Development VtocbUploaded byeramessh
- ch04-2Uploaded byCanji
- 04-Basic-SyntaxUploaded byNeeraj Kumar
- EKT120_LECTURE08_ARRAYS2Uploaded byMuhammad Faiz bin Ahmad Shafi
- Programming languageUploaded byIsabellaPerigina
- ACR30 Proprietary Active X Component2.pdfUploaded bybetohres
- 02 StringsUploaded byDavid Tang
- 34-35 Tupas&UmadhayUploaded byLance_Joshua_7907
- Quizez for All LevelsUploaded bysorin_matias
- Voice Translation Rules v2Uploaded byPehh Love
- CS301SolvedMCQsUploaded byMuhammadRizwanIslamKhan
- H10-solution[www.alirezaweb.com].pdfUploaded byVahid Esmaeilzadeh
- Algorithms For predictinoUploaded byRamanKaur
- Focs MidtermUploaded byjoe
- M.Malliaris and Saharon Shelah- Regularity Lemmas for Stable GraphsUploaded byUwem356
- Binary Search TreesUploaded byalok_choudhury_2
- MCQs_Ch_2_FSC_part2_NaumanUploaded byusman7888
- B_Citare_JSA.pdfUploaded byDana Iulia Leoca

- ---03-02-2016-page-14Uploaded bynaninanyesh
- ---28-02-2016-page-13Uploaded bynaninanyesh
- f5f69084763272f07f96670218d708c0-1Uploaded bynaninanyesh
- ---29-February-2016-page-9Uploaded bynaninanyesh
- 041f22b2714576ce159769cda91cf1bd-1Uploaded bynaninanyesh
- 20160229b_012124001Uploaded bynaninanyesh
- 20160229b_013124001Uploaded bynaninanyesh
- My Exam SyllabusUploaded bynaninanyesh
- a47c984524ae9fa2d0d021af355f03f0-1.pdfUploaded bynaninanyesh
- ---NIPUNA-03-02-2016Uploaded bynaninanyesh
- ---03-02-2016-page-13.pdfUploaded bynaninanyesh
- 555a35fcd2a390e80cc971e4a2d15be1-1Uploaded bynaninanyesh
- ---3-February-2016-page-3.pdfUploaded bynaninanyesh
- ---3-February-2016-page-1.pdfUploaded bynaninanyesh
- 20160203b_013124001Uploaded bynaninanyesh
- ---3-February-2016-page-3Uploaded bynaninanyesh
- ---3-February-2016-page-1Uploaded bynaninanyesh
- 20160202b_012124001Uploaded bynaninanyesh
- 20160202b_013124001Uploaded bynaninanyesh
- ----page-11.pdfUploaded bynaninanyesh
- 9bc08e74acf5b94de2adb731fda12cf1-1Uploaded bynaninanyesh
- ---2-February-2016-page-10.pdfUploaded bynaninanyesh
- ---2-February-2016-page-6Uploaded bynaninanyesh
- ---2-February-2016-page-2Uploaded bynaninanyesh
- ---2-February-2016-page-1Uploaded bynaninanyesh
- 20160201b_012124001Uploaded bynaninanyesh

- HIT1301-HIT2080 Outline 2012 S1Uploaded bySahan Kumarage
- System Software Internals AdvancedUploaded byKrishna Prasad
- VB for Very Bright Kids - Part 5 Beyond This BookUploaded bynur amira
- Writing Endian-Independent Code in CUploaded byhhung516
- Dates Format in SasUploaded byRajinder Kr
- ripting With SiebelUploaded byFayaz Syed
- Chapter 5Uploaded bylalitha
- 23593363 Mark AnalysisUploaded byLaxmanNaidu
- DBT notesUploaded byamit_ambastha
- eclipseCDT8.0-cheatsheetUploaded byphilipsd
- 99883625-39309384-Chottu-Sharma-NotesUploaded bydheeraj
- Testing of the Cache Memory in the OpenSPARC T1Uploaded byProject Symphony Collection
- [TUTORIAL] How to Use Logging FilterUploaded byJohn Angolluan
- mongo db v1 2Uploaded byapi-250285776
- 6.3 Race ConditionsUploaded byPavan Kalyan
- RulesUploaded bySuresh Kanneganti
- Flyweight PatternUploaded byMinal Patil
- Weekssignment_(1)_solnUploaded byP.Honey
- monitorUploaded byIndira Devi Pedaprolu
- SOA in Banking_ a Review of Current Trends and Standards Based on an Example of a Real-Life Integration Project Delivered to a Financial Services CustomerUploaded bymike
- Manual Felics GBUploaded byjolustan2009
- Vhdl Paper SolutionUploaded byVaibhav
- Apache Spark Python SlidesUploaded byDouglas Leite
- Design PatternUploaded bySatya Prakash Gupta
- Indexing & HashingUploaded bySri Pavithra
- AdoUploaded bySamrat Pv
- Sitambas Patel UI Developer Resume NewUploaded byadesh
- Oracle Training TopicsUploaded bysumanth_0678
- Rashmi Sharma ResumeUploaded bysolo_gaurav
- c MaterialUploaded bysravan.oem