gravatar

Blog # 93 : Amazon Interview Questions 2013 Batch (1)



Written Round (1 hour 30 minutes):

20 MCQs (mostly from latest GATE paper)

2 Programming questions:

1) An operation "swap" means removing an element from the array and appending it at the back of the same array. Find the minimum number of "swaps" needed to sort that array.
Eg 3124
output: 2 (3124->1243->1234)

2) find if there exists a path from root to leaf in binary tree with sum K.



Interview:

Round 1 (1 hour 15 minutes):


write programs on paper keeping in mind all the boundary cases and complexity of the code. Following were  the programs:

1) Find if the given linked list is a palindrome or not (including inplace reversal of linked list)

2) We have a right rotated sorted array.Eg
   4  5  1  2  3
You need to find where this rotation had occured.

3) There exists a linked list such that each node has two pointers next and random. Random pointers points to any other node in the same linked list or to 
itself or NULL. Clone this linked list.


Round 2 (1 hour 15 minutes):

First part was mainly concerned with questions related to OOPs, second part included OS and lastly algorithms and miscellaneous.

OOPs

1) interviewer turned the laptop towards me and then asked me to write an "interface" for this laptop. Then he asked me to implement this interface.
2) Event handler. Asked how will you tell whether a key on the laptop has been pressed or not. Write a function (whose signature I had written in interface).
3) Difference between interface, abstract class, instance.

OS

He asked me back to back questions which covered topics:
1) Processes and threads (Asked example, desing a software which will be having three components-file copy, data transfer, user input efficiently)
2) Multi-threading
3) Scheduling Algorithms (both Process and thread)
4) Synchronization (many questions from mutex and semaphore)
5) Deadlock (deadlock prevention, avoidance, etc)
6) context switching

Algo and misc

1) Scenario: In gmail if somebody wants to sort mails according to name, date, size, etc which sorting algorithm is most accurate one for this puropse.
2) quicksort and heapsort.
3) what are shared library.
4) Other type of libraries.


Round 3 (1 hour):

Write the programs for following:
1) COunt the total number of parenthesis pattern for a given number n. 
Eg 
n=1
()
count=1
n=2
()() (())
count=2
n=3
()()() ()(()) (())() ((())) (()())
count=3

2) If the given graph is bipartite or not.
3) (not code only ds) Scenario: There is a huge database of telephone numbers. Each telephone number is unique and information (name, address, etc) of the user is attached to this telephone number. Design a data structure to store this.

Round 4 (1 hour):

HR plus techincal
1) Tell me about yourself.
2) What is your educational background.
3) Why Amazon

tech:
1) delete nth element from the end in a linked list.
2) find the maximum sum subarray in an array A of size n which may also contain negative numbers.

Selected!