Amazon Interview Question for SDE-2s


Interview Type: In-Person




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

Amazon recommendation system is not code, but mathematics and statistics, specifically linear algebra.
Here are links to how they have implemented it.

[ cs.umd.edu/~samir/498/Amazon-Recommendations.pdf ]
[ google.co.in/patents/US8095521 ]

- NoOne February 09, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

was this for the itern position?

- m February 27, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

i like your approach.
did you get offer?

- amzn_geek March 15, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

class Movie {

string m_movieId;
float m_rating;
vector<Movie *> m_similarMovies;

public:
bool visited = false;

    Movie(string movieId, float rating): m_movieId(movieId), m_rating(rating) {}

    string getId() const { return m_movieId; }

    float getRating() const { return m_rating; }

    void addSimilarMovies(Movie *movie) {

        m_similarMovies.push_back(movie);
        movie->m_similarMovies.push_back(this);
    }

    vector<Movie*>& getSimilarMovies() {
        return m_similarMovies;
    }
};

- Anonymous March 20, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

Yes and sorry if I wasn't clear but this was specifically about that section at the bottom of product description page where we show people who bought this product also bought these... and question was how would you design storage and data structure to enable fast retrieval of products so that page rendering isn't slowed down.

My solution was to have a graph in cache where each product has edges to its related 20 products and a hashmap with product id and product node in there so we can quickly retrieve current product using product id and then its related 20 products using edges. Then he asked me to implement a class for this and then asked me how would you test this.

He then dug deeper into how many products would you store and how much memory would you need? etc.

- Anonymous February 10, 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