## Amazon Interview Questions

- 1of 1 vote
Add two link list, can not modify the link list, can not reverse the link list first and second.

Link list 1 - 1->2->3->7

Link list 2 - 2->9

Out put Sum - 1->2->6->6

- -2of 4 votes
Find the frequency of a number in array in less than bigo n time

Array 1,2,2,3,4,5,5,5,2

Input 5

Output 3

Array 1,1,1,1,

Input 1

Output 4

Keep in mind less than bigo n

Thanks

- 3of 3 votes
Design backend system for bookMyShow.com like system which supports below use cases:

1) When user selects cities, list of cities is displayed.

2) When user selects city, movie list is displayed.

3) When user selects movie, list of theatre is displayed.

4) When user selects theatre, show timing is displayed.

5) When show timing is selected, user is asked for no of seats that he wants to book

6) When user selects no of seats, seats are displayed to choose from.

7) When user selects seats, then total price is displayed.

8) When total price is selected, then user is directed to payment gateway and payment is done and on payment success, ticket is mailed to him.

More questions on how can we scale the system, and handle concurrent users request for same seat etc.

- 2of 2 votes
Design a movie ticket booking system like bookmyshow.com

Follow-up question -

1) How do you handle issues like scalability, concurrency, fault-tolerance etc.

2) Show movie theaters near to user where movie is playing and seats are available

3) Design database. What kind of DB would you use SQL or No-SQL

4) In real time how would you show which seats are booked which are free

5) If theaters do not have any api for fetching information then what can we do about it.

- 1of 1 vote
Design Uber. Low level Design needed (OOPS based - classes, relations, message flow etc.)

- 0of 0 votes
Design Cricinfo website

- 0of 0 votes
Design snake n ladder game to be played online

- 0of 0 votes
This is a system design question. Design a Event booking system. Imagine that event registry etc is all implemented. A user can log in, check the available events and then books it. Design a system for event booking

- -1of 1 vote
Find K which decides the number of open brackets are equal to the number of closed brackets.

input : (())

output : 2

Reason : if we divide the string at 2nd position, we get two open brackets and two closing brackets, and they are same .

input : (())))(

output : 4

Reason : if we divide the string(not necessarily equally) at 4rth position, we have (()) on the left side and on the right side we have ))( , as you can see, on the left half, we have two opening brackets and on the right half we have two closing brackets and they are equal .

input : ))

output : 2

Reason : there is no open brackets , so if we divide taking the whole string's length, we have )) on the left half and nothing on the right half. Now you can see that on the left half there is no open brackets and on the right half there is no closed brackets.

This question should be clear by now and remember you have to find out that K .

- -5of 5 votes
Fill the arrray with elements from 0 to 9.

based on thier frequency.

a[1]=3 means, 1 is repeated for 3 times(1 must present 3 times in that array)

a[2]=4 means 2 is repeated for 4 times.(2 must present twice in that array)

- 0of 0 votes
Find the Maximum number of distinct nodes in a binary tree path

- 0of 0 votes
Write test cases to test a browser App

- 1of 1 vote
A = "ffgggtvshjsdhjfffffffhvjbjcharu"

Find the max consecutive repitative chracter

Output : f -> 7

- 0of 0 votes
A = {1,2,4,-6,5,7,9,....}

B = {3, 6, 3, 4, 0 .......}

n = 5 -> pairs whose sum is n

Output = (1,4), (5,0)....

- 0of 0 votes
find the given Binary tree is mirrored tree or not

should be like

60

/ \

30 30

/ \ / \

20 50 50 20

- 0of 0 votes
Given a BST (Binary Search Tree) , Each node value should replace with sum of the node which are greater-than the given node.

conditions :

No Extra space / variable can use

Modify the existing tree in optimal way.

- 0of 0 votes
Design a system having multiple jobs, interacting with each other such that :

1) A job can run for very long periods (1-2 days)

2) A node can fail/crash on which certain job is running

system should be scalable

3) Amount of data getting transferred is huge

4) Data in the system is very sensitive and needs security

job/s can fail

- 0of 0 votes
Top View of a Binary Tree in constant space

- 0of 0 votes
Given a pattern containing only Is and Ds. I for increasing and D for decreasing. Devise an algorithm to print the MINIMUM number following that pattern. Digits from 1-9 and digits can’t repeat.

Example:

1. Input: D Output: 21

2. Input: I Output: 12

3. Input: DD Output: 321

4. Input: II Output: 123

5. Input: DIDI Output: 21435

6. Input: IIDDD Output: 126543

7. Input: DDIDDIID Output: 321654798

- 0of 0 votes
Implement ConcurrentHashMap class in Java

- 0of 0 votes
Implement LinkedHashMap class in Java

- 0of 0 votes
You have been given a grid with some doors, walls and some empty spaces.

1st part : You have to tell the least no of moves to go from random position in the grid to the nearest door. You can move in four directions only, i.e, left, right, above, below.

2nd part : Least distance of every empty cell to the nearest door. Lots of discussion was done on both the parts of the problem.

- 0of 0 votes
Design garbage collector in Java

- 0of 0 votes
Maximum triangle path Sum : Starting from the top of a pyramid of numbers like below, you can walk down going one step on the right or on the left, until you reach the bottom row:

55

94 48

95 30 96

77 71 26 67

One of such walks is 55 -> 94 >- 30 -> 26. You can compute the total of the numbers you have seen in such walk, in this case it’s 205.

Your problem is to find the maximum total among all possible paths from the top to the bottom row of the triangle. In the little example above it’s 321.

- 0of 0 votes
Design a online shipment tracking system.

- -1of 1 vote
Design a system to upload images and tag them. Ability to search images with single and multiple tags.

- 1of 1 vote
Given a very large binary number which cannot be stored in a variable, determine the remainder of the decimal equivalent of the binary number when divided by 3. Generalize to find the remainder for any number k.

- 0of 0 votes
Given a file having many lines of text(words) and given a dictionary having an API function boolean isValid(String word), which will return true is a word passed to this function is valid word in dic.,and will return false if given passed argument is not a valid word in dic.

Now read the file and check if each word as well as all possible words from its L to R and R to L combinations, are valid words in dic. or not.

- 1of 1 vote
Given sequentially placed boxes, each representing a number( which may be positive or negative), we need to select the numbers in order to have the maximum sum, having the constraint that if we select a given box, we cannot select adjacent box to it, but can select any other.

- 0of 0 votes
Given 2 integers, add them without using any arithmetic operator