## Amazon Interview Questions

- 0of 0 votes
What would be the sample class design of notification system?

- 0of 0 votes
What would be the sample class design of tic tac toe game?

- 0of 0 votes
What would be the sample class design of Outlook like meeting scheduler?

- 0of 0 votes
Given two arrays. One is for tasks (Processes) and each element depicts the amount of cores required to run the task. 2nd array is an array of CPU where each element depicts the no of cores in it.We have to tell how many maximum number of tasks can be allocated. Example: Task: [3, 5, 7], Cores: [1, 3, 5] . Here only task 0 and 1 can be allocated to CPU 1 and 2 . So, answer=2.

- 0of 2 votes
What is the best way to generate first N primes? (not primes up to N but first N primes)

- 0of 2 votes
How do find out the top trendings products on a last hour/day/monthly basis?

Given that we have access to a real-time stream of sold product ids.

- 0of 2 votes
Design Amazon prime video

- 0of 0 votes
How would you design a system where you have 1000 records in database and on UI you are showing them, a user can select single or bulk record which can be in any order and drag drop to reorder the sequence of the record. Example :

I have below records

1

2

3

4

5

a user selects 1 and dragdrops it on 5th position, so the new order becomes 2,3,4,5,1. This has to be done at the database layer and in efficient way. How to maintain continuous reordering sequence of records?

- 2of 2 votes
Give m balls and n bins. Find out how many ways to assign balls to bins. Notice the buckets has no order. Like (1,2,3) and (3,2,1) are considered the same.

eg, m = 3, n = 2, return 2. (1, 2) and (3, 0)

- -3of 3 votes
Two Sum. Then follow up three sum

- -1of 1 vote
How is code review done?

- -1of 1 vote
How is design review done?

- 0of 0 votes
Given a BST of memory sizes. Find best fit for a memory block of size M.

- 0of 0 votes
Given an infinitely large array and every element has tags associated with them, and there are about 10,000 tags (say) then sort the given array to get all tag-0’s first, tag-1’s next and so on in O(n).

- 1of 1 vote
For Amazon SDE-1 On Campus Interview, what are the topics I should study in Database Management ?

Just don't name the topics. Please elaborate too.

- -1of 1 vote
For Amazon SDE-1 On Campus Interview, what are the topics I should study in Computer Networking ?

Just don't name the topics. Please elaborate too.

- 0of 0 votes
Given a random MxN matrix and a positive integer, recursively Your program should then find a continuous path thought the matrix starting at position 0,0 that will sum to n. Your program shouldomly move left (col -1), right(col +1), up (row -1) and down (row+1)and can only use a position once in the sum. if there is a such path in the matrix, create the path in a separate matrix with the same size, and replacing the indices used with 1 and the rest 0.

- 0of 0 votes
Design a music streaming service like Pandora.

- -1of 1 vote
Where i can learn macros ?

- 4of 4 votes
Amazon phone interview

A queue of people are waiting to buy ice cream from you.

Each person buys one ice cream, which sells for $5.

Each customer is holding a bill of $5, $10 or $20.

Your initial balance is 0.

Find whether you will be able to make change for every customer in the queue. You must serve customers in the order they come in.

For example

5, 5, 5, 10, 20 -> true,

5, 5, 10 -> true,

10, 10 -> false

- 0of 0 votes
How you will design and make a website like Hackerrank? How you will measure and limit the running time and memory usage of the program.

- 0of 0 votes
Design a class for converting integer to Roman numerals.

- 0of 0 votes
Given k, and a binary string, determine if this contains all permutations of length k.

For example, 11001 contains all possible binary sequences with k=2 (00,01,10,11)

- 0of 0 votes
Design the Goodreads recommendation model.

Goodreads is a "social networking book" website that allows individuals to freely search its database of books.

- Any given user has a List of friends.

- User can add books to his/her shelve

- When a user logs in, we need to show the top 10 books owned by his friends

Example:

User1 has u2, u3, u4, u5 as friends

u2 owns b1, b2, …b10

u3 own b1, b2, b11…b20

u4 owns b1, b2, b11…b20

u5 owns b1, b33, b35, etc

topmost book is b1, second topmost book is b2 and so on.

If you maintain a cache of top 10 books in the user object for each of the users. How often will you update the cache ?

- 0of 0 votes
You have been given a generator string ab from which any number of strings can be generated recursively by inserting ‘ab’ at any location. You have been given an input string to check if that given string is valid or not.(i.e. generated by given with given string.)

eg.

Input: aabbab

Output: valid

Input: abbaab

Output: Invalid

I could not come up with a algorithm less than O(N*N)

- 0of 0 votes
Given a multiple tree, and multiple nodes that need to be deleted,

It is required to return a list of nodes so that the children of these nodes can be found after the nodes have been deleted.

- 0of 0 votes
Gives you an int m, and a set of char (0,1,2,3,4,5,6,7,8,9)

Lets you implement a function that generates a id based on the characters in the set. Each time you return a string, it must be unique. satisfying the same character can not appear consecutively more than m times, such as m = 3, "1000" is valid,

"0000" is not valid.

The smaller the string, the better.

- 1of 1 vote
Let’s say you have two input arrays with sorted elements. Find the union.

a[] = {2, 10, 14, 19, 51, 71}

b[] = {2, 9, 19, 40, 51}

Union = {2, 9, 10, 14, 19, 40, 51}

- 0of 0 votes
A group of friends are tracking the miles per gallon for each of their cars. Each time one of them fills up their gas tank, they record the following in a file: His or her name The type of car they drove How many miles driven since they last filled up How many gallons purchased at this fill up Date of the fill Their data is formatted as a comma separate value (csv) file with the following format for each row:(#person,carName,milesDriven,gallonsFilled,fillupDate) Miles are recorded as floating-point numbers and gallons as integers. Please create a program that allows members of this group to determine the miles per gallon (MPG) of each of their cars during a specific time range. Note: person may have more than one so a time range query might need to output data for one or more cars. A skeleton class will be provided; your job will be to complete the program. The principal function for querying MPG is of the form (the exact name, data types, etc., can be learned by inspecting the "solution" class in the skeleton code): GetRangeMPG(PersonName, StartDate, EndDate) Returns list of objects containing (CarName, MPG) MPG is calculated as (total miles traveled during time period)/ (total gallons filled during time period. The dates you receive in the query should be treated inclusively.

- 0of 0 votes
To push dominoes, find out how many dominoes are standing in the end

For example, the input is ".R...RL..R..L..", which means pushing the 2nd, 6th, and 12th dominoes to the right and pushing the 8th and 15th dominoes to the left. This example returns 4th. 1,7,16,17 blocks are standing