Amazon Interview Question for SDE1s


Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

caution long answer below:


okay at last i got some time to answer your question .
LRU page replacment,mostly used in operating system but you see it doesn't make sense to me for a website with millions of products ,i mean indexing each product for a single customer and manipulating those indexes relevant to each customer not efficent neither cool.

from my point of view there are three ways to look for at problem


1. Either they use a collection of separate column values to store
products you search or view


problem:-

but com'on how novice is it ,and its not a college project which you are doing just because you are suppose to ,its pure bussiness so this is neither cool not flexible ,and yes cool here means its doesn't seems geeky.

2. Use Browser caches to store and retriev your past history to show suggestions

problem :-

its a good way to do such thing and cool as well but you see broswer caches are small data stores and storing some user related data on user machine is not at all proffesional in terms of bussiness.
so its cool but not flexible for a complex structure like amazon

3.combination of first and second points (i.e columns + browser caches)

there's a catch here that instead of columns amazon may use a graph based database (i.e google for neo4j) using the caches data it can further make nodes and a simple dfs travesal can provide a collection of connected products and using counting inversiopn techinques can give you the data for people who viewed this also viewed this product and whalaaaaaaa you have it..

so these are my point of view on how they would be implementing it ,i would love to have a healthy discussion or re-explanation in case you need it

(note : these are my own point of views it doesn't resembels any of amazons perspective )

- saurabh March 16, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@puneeth.nie.s there are many sections on the advertisement page(here the home page
"amazon.in",correct me if i'm wrong ) which particular section you are talking about ,there is a suggestion list which shows products according to your previous search /buy /interest and many more , are you talking about that or the advertisement slider showing different offers?

- saurabh March 10, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yeah! I was talking about the same thing in main Amazon site, amazon.in based on our search/buy/interest, it will show advertisment. Can you please me the what all the classes should I need to use ? Are they using LRU Cache Algorithm?

- Anonymous March 10, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey

- Anonymous March 10, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use browser cache to suggest products searched by user.
For suggesting similar products bought by other users, maintain a weighted graph with products as nodes. Weight will refer to the number of customers who bought the two connected products.
Product nodes can be stored in hashmap(to search a product in graph in O(1) time).
To suggest k similar products, use a k size min heap.

- Iram22 March 09, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More